Sunday, March 7, 2004 10:15 PM
The "Return-Path" header, and/or "Unix From line" is written by the receiving mail agent, not the sending one. (note the "Unix From line" comes from the envelope e.g. son-of-rfc 821, not the "From:" header field of son-of-rfc 822!)
What you get, Return-Path and/or Unix From, depends on the mailbox message format at delivery/local dropoff time; you will get one or the other or maybe both.
Also note that a "Received" header should have been added at every hop, by every SMTP server along the way. So the sender field in the final Received header, written by the final SMTP server, should look very similar to the Return-Path and/or Unix From line.
It (Return-Path and/or Unix From, plus the final Received header) is based on what it (the receiving SMTP server) got, in the MAIL FROM field of the SMTP envelope, subject to whatever DNS canonicalization etc. might happen at the receiving end, distinct from what was written by the sender.
The days of complicated return paths containing UUCP bang paths, BITNET/CSNet/DECNet etc. translations are probably gone for good, but still CNAME's will be canonicalized, etc. in the sender and recipient envelope fields, before the final delivery.
If this doesn't make sense to you, then you're probably not ready to write and maintain an Internet email application, not yet.
So in your sending application you probably want to set the envelope sender field, distinct from the "From:" and/or "Reply-To:" headers.