About
The sender is an envelope email address (mailbox) that:
- indicates where the message came from
- is set during a SMTP transaction by the MAIL FROM command
- is not seen by message recipients (final users)
The sender is also known as:
- the return path
- the mail from address
- the bounce address
Sender vs Author (From:)
The value is generally the author (ie the address in the from header) but in other cases such as a mailing list, it may be not.
Example
- For a mailing list, it can be a bounce email with or without a tag (ie +)
[email protected]
- For a single send, it can be the user
[email protected]
Return-Path Header
If there are multiple relays, the original sender can be found in the Return-Path header.
Sender Policy
In a SMTP transaction, the sender should conform to the Sender Policy Framework (SPF)
Library
Java
You set the bounce with the mail.smtp.host property
Properties props = new Properties();
props.put("mail.smtp.host", "my-mail-server");
Session session = Session.getInstance(props, null);