All email messages contain Internet headers full of important information about the sender and the path the message took as it crossed mail servers before ending up in your inbox. There are two types of headers in Yahoo emails: the brief header and the full header.
Although an attacker can include forged information in the brief header and make a suspicious email look legitimate, he can't forge the full header. You can get the IP address of the sender in Yahoo Mail by looking at an email's full header.
Log in to Yahoo Mail, select Inbox from the left pane to view all received emails and then click the suspicious email to open it.
Click More and select View Full Header from the menu to display the Full Header box, which contains the IP address of the sender, among other useful information about the message.
Scroll down using the right scroll bar until you find the X-Originating-IP line to find the IP address of the sender.