Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to confirm email source

Tags:

email

I send an email from my smtp server, for example, setting From to [email protected]. The recipient will think that email comes from anydomain. How to confirm the email source?

like image 288
developer Avatar asked Mar 09 '10 04:03

developer


2 Answers

There are several approaches to dealing with email forgery:

  • Use PGP or SSL signed certificates
  • Use SPF
  • check the Received headers (although this isn't reliable)
  • reply back to the sender and ask if they actually sent it. If you know the sender, maybe ask them in person or over the phone.

The main thing to realise is that the From: address isn't any form of guarantee about the originator of a message.

Edit: okay I now understand that you're just trying to tag the mail message somehow so that you can recognise which server generated it (in a non-secure way). Here's how using .NET's MailMessage:

System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.Headers.Add("X-Is-Development", "true");
like image 173
p00ya Avatar answered Oct 20 '22 14:10

p00ya


Email Headers has more details.

like image 1
Shoban Avatar answered Oct 20 '22 13:10

Shoban