Can i extracts orginal email address from echange mail

The age-old problem of extracting the original email address from an email that has been forwarded or replied to!

Unfortunately, it's not always possible to extract the original email address from an email that has been forwarded or replied to, as the email headers may have been modified or stripped during the forwarding or replying process. However, there are some techniques you can try to increase the chances of extracting the original email address:

  1. Check the "From" header: The "From" header may still contain the original email address, especially if the email was forwarded or replied to using a simple forwarding mechanism.
  2. Look for the "Reply-To" header: The "Reply-To" header may contain the original email address, especially if the email was replied to using a reply-to-all feature.
  3. Check the "Return-Path" header: The "Return-Path" header may contain the original email address, especially if the email was forwarded or replied to using a more advanced forwarding mechanism.
  4. Use email header analysis tools: There are several online tools and plugins available that can help you analyze email headers and extract original email addresses. Some popular options include:
    • Email Header Analyzer (online tool)
    • Header Analyzer (online tool)
    • Mailvelope (browser extension)
    • Email Header Viewer (plugin for Microsoft Outlook)
  5. Check the email body: Sometimes, the original email address may be mentioned in the email body, especially if the email was forwarded or replied to using a simple forwarding mechanism.

Here's an example of how you can use the "From" header to extract the original email address using Python:

import email

# Load the email message
with open('email.eml', 'rb') as f:
    msg = email.message_from_bytes(f.read())

# Extract the "From" header
from_header = msg['From']

# Extract the original email address from the "From" header
original_email = from_header.split('<')[1].split('>')[0]

print(original_email)

Keep in mind that these techniques may not always work, especially if the email has been heavily modified or forwarded multiple times.