SENDMAIL

Synopsis

SENDMAIL /?

SENDMAIL /bd [/q time] [/C filename]

SENDMAIL [/bm] [/v[+|-]] [/HELO[+|-]] [/AUTH[+|-]] [/STRIPNEWSHEADERS[+|-]] [/f mailbox] [/t[+|-]] [/SRV_SUPERDOMAINS[+|-]] [/SRV_SELF[+|-]] [/IMPLICIT[+|-]] [/IP6ADDR[+|-]] [/CLIENTIP[+|-]] [/CLIENTPORT[+|-]] mailboxes …

Description

The SENDMAIL command is a workalike submission agent that is provided for the benefit of those MUAs and other programs that were badly written in that they are hard-wired to use UCB "sendmail". The use of sendmail -bd -q30m -Cc:\mptn\etc\sendmail.cf is hard coded into OS/2's TCP/IP configuration program, for example.

UCB sendmail has many operating modes. However, on OS/2 only three of those modes are actually invoked. Thus SENDMAIL only supports the command line options for three of the UCB sendmail modes, "queue flush", "smtp dæmon", and "message submission".

Even then, the first two of those modes are shims. SENDMAIL will simply do nothing when invoked in either mode. This is because the architecture of the mail system in the Internet Utilities is radically different to that of UCB sendmail. SENDMAIL actually performs neither of the two functions. The delivery of queued mail and the handling of SMTP connections are performed by other, separate, dedicated dæmons in the Internet Utilities. Queue scanning is performed by The SMTP Post Office Daemon, and SMTP Relay service is provided by The SMTP Relay Daemon.

The third supported mode of UCB sendmail is the one mode in which SENDMAIL will take action: message submission mode. In this mode of operation SENDMAIL reads a message in RFC822 form from its standard input and the envelope from its command line, canonicalises them both, and submits them to the MTS by sending them to the SMTP Submission server. In other words, SENDMAIL acts as a shim to convert command-line submission used by some MUAs into SMTP Submission submission.

SENDMAIL locates the SMTP Submission server to use from a domain name supplied as the value of the SMTP_SUBMISSION_DOMAIN environment variable. It maps this domain name onto a server IP address and port number in the normal way, using submission as the service name, tcp as the transport name, and 587 as the well-known port number. SENDMAIL will respect the ports and weights specified by the DNS data for the domain.

Note: SENDMAIL only falls back to backup servers if a TCP connection attempt to the server is unsuccessful. If SENDMAIL cannot either find or connect to an SMTP Submission server, it will exit with an error and the message will not be submitted. Similarly, an error protocol response from the server is a fatal error, that again will prevent the message from being submitted.

If there is no SMTP Submission domain name, the SMTP Submission server can be specified by IP address using the SMTP_SUBMISSION_IP_ADDRESS environment variable, instead.

In addition to canonicalizing the message, SENDMAIL prepends a "Received:" line to the message describing its passage through SENDMAIL.

SENDMAIL always writes any progress log information to its standard error stream. To save the log in a file, simply redirect the standard error stream to the file.

Security considerations

UCB sendmail is notorious for security problems. But SENDMAIL is merely a "shim", a compatibility layer, on top of the MTS proper. It is regarded as an extension of the MUAs that use it, rather than an integral part of the MTA, and so isn't trusted any more than MUAs normally are, and does nothing more than that which an MUA is allowed to do directly in any case. It plays no part in the routing, queueing, transport, or delivery of messages; doesn't invoke delivery or robot programs itself; and opens no sockets other than one to the SMTP Submision dæmon. It has no hand in accepting messages from other systems via SMTP Relay. It doesn't even have the final say on header rewriting and converting submitted messages to canonical form.

When used in -bm mode, SENDMAIL uses the SMTP Submission service for message submission, and is thus subject to whatever canonicalization mechanisms are in place at the SMTP Submission server. The SMTP Submission service in the Internet Utilities, for example, performs envelope and message canonicalization. SENDMAIL also performs envelope and message canonicalization itself. This ensures that envelopes and messages are in canonical form even if SENDMAIL is used with some other SMTP Submission service that does not perform canonicalization itself.

Examples

To send the contents of rfc822.txt (whose contents must be in standard RFC 822 format) to user "JdeBP", marking it as coming from user "sysop":

  [c:\]sendmail -bm -f sysop JdeBP < rfc822.txt

Command-specific options

/V
Enable verbose mode.

Note: The SMTP conversation displayed when verbose mode is on is merely the conversation between SENDMAIL and the SMTP Submission dæmon.

/HELO
Enable sending an EHLO/HELO command first. HELO and EHLO are not required parts of the SMTP Submission protocol and good servers will just ignore them if they are sent. Sending them is in most cases just a waste of a round-trip delay.
/STRIPNEWSHEADERS
Enable hiding common news (RFC 1036) headers that cause problems for some mail systems. Any Path:, NNTP-Posting-Host:, NNTP-Posting-Date:, XRef:, and Newsgroups: headers in the message are renamed by prepending X-Renamed- to their names.
/C
This option is only present because programs that invoke UCB sendmail often use it. It is ignored.
/bd
This option is only present because programs invoke UCB sendmail with the /bd option. SENDMAIL will warn that dæmons are started by other commands in the Internet Utilities, and simply exit.
/Q
This option is only present because programs that invoke UCB sendmail with the /bd option often use it. It is ignored.
/bm
Read a message from standard input and submit it to the MTS addressed to the recipients specified on the command line. (This is the UCB sendmail default if no other /b options are specified.)
/F
Specify the envelope sender and default sender, for use with the /bm option.
/T
Request SENDMAIL to parse the contents of the message for the envelope sender and additional recipients when the /bm option is used.

The Internet Utilities are © Copyright Jonathan de Boyne Pollard. "Moral" rights are asserted.