Tuesday, November 26, 2002 08:00 AM
An "Errors-To" header is ancient, deprecated, and should not be used, nor set, anymore since the early 1980's.
A "Return-Path" header (or alternatively, a "Unix From_ line", depending on the mailbox file format) is typically added when the message is delivered to the end recipient's mailbox/maildrop/mailstore, by just copying the value from the SMTP envelope MAIL FROM field.
So you (the sender) do not create this header. Rather, you set the SMTP envelope sender field, before you send the message. Sometimes the value will be altered along the way (due to CNAME's, firewall gateways, other rewriting rules, on intermediate mail relay servers), and might end up looking different in the final Return-Path that the recipient's mailbox gets, than when you set it before you sent the message. In the old days when the whole Internet mail format was designed, the return path could get long, because of intervening uucp hops, bitnet/decnet/csnet gateways etc.
See "How can I explicitly set the SMTP FROM: attribute when sending a message?" (http://java.sun.com/products/javamail/FAQ.html#smtpfrom).