The UCB sendmail compatibility utility, the SMTP Submission dæmon, and the Direct Submission utility all transform the submitted messages and envelopes that they receive to a canonical form before adding them to the maildrop.
The transformation involves three things, a default host name, a default domain name, and a default sender. The first two are components of an SMTP mailbox name. The third is a full mailbox specification. It can even name multiple mailboxes.
Each of the three programs obtains these items from slightly different places:
SENDMAIL and MAILTO:
The default sender is the first that exists of:
It defaults, in the absence of all of the above, to the name "os2user".
The default hostname is the first that exists of:
It defaults, in the absence of all of the above, to the name ".".
The default domain name is obtained as per compatibility-mode name qualification in the DNS client library.
The default sender is empty.
The default hostname and the default domain are the value given in the
EHLO verb by the client.
The default sender is subjected to the standard mailbox name canonicalizations before it is itself used.
MAILUSER environment variables
are intended to be MTS-specific, to provide specific host and user names
for use by the mail system that override the host and user names that are
configured for general use by the system administrator or set by the login
program. So whilst
%USERNAME%@%HOSTNAME% may not be a valid
%MAILUSER%@%MAILHOST% should be.
Canonicalization transforms the envelope of the message (supplied on the command line for SENDMAIL and MAILTO, supplied via the SMTP conversation for SMTPSD) and the following headers in the message itself:
To:header containing an empty mailbox-group is added.
/STRIPNEWSHEADERSoption is enabled.
Sender:are supplied, then
From:is added, using the value of the default sender. If
From:is supplied but contains more than one mailbox, and
Sender:is not supplied,
Sender:is added, using the value of the default sender.
The standard mailbox canonicalizations are applied to all mailboxes listed in the envelope, to the default sender, and to mailboxes listed in the headers noted above. They use the default host name and the default domain name.
All comments are stripped.
Muhammed.(I am the greatest)Ali@(the)Vegas.WBA
Missing angle brackets are added.
<email@example.com, firstname.lastname@example.org, email@example.com>
<firstname.lastname@example.org>, <email@example.com>, <firstname.lastname@example.org>.
Commas are inserted to separate multiple mailbox names.
Source routing is stripped.
Pseudo "bang paths" are stripped.
Mailboxes without the
@ symbol at all have that and the
default host name added.
Mailboxes without domains have the default host name added.
Mailboxes with single-label domains (and no trailing dot) have the
default domain name appended, as long as the default
domain name isn't a domain literal (such as
<mary@x>, <joe@y>, <fred@z.>
<email@example.com>, <firstname.lastname@example.org>, <fred@z>.