title: How to confirm sender of an incoming email?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2406719/how-to-confirm-email-source">how to confirm email source</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to know how do email services such as Hotmail and Yahoo confirm that the "From" header was not spoofed. I mean, you didn't try to send an email in behalf of someone else.</p>
  
  <p>I was now trying to spoof on Facebook Messages, using a php script to send an email to my @facebook.com email, spoofing the "From". I received it in behalf of that friend account. However, an alert saying "Unable to confirm --Friend Name-- as the sender." appeared.</p>
  
  <p>What does Facebook (and other services) do to confirm that?</p>
  
  <p>Please note that extensions (emailname+extension@mydomain.com) would not work for me. My idea is to simulate something similar as Facebook Messages support for emails.</p>
  
  <p>I believe that just checking headers is not enough. I assume I'll have to check DNS/SPF stuff, but I'm not sure how to do that, and even what to do.</p>
  
  <p>It would help me allot if you could indicate me some "algorithm" (preferentially in php) with steps to check for spoofing. Thank you!</p>