smtp - zmailer SMTP client transport agent
smtp [ -678deEHrPsVxW ] [ -c channel ] [ -h heloname ] [ -l logfile ] [ -p remoteport ] [ -T timeouts ] [ -S /path/to/smtptls.conf ] [ -F forcedest ] [ -L localidentity ] host
smtp is a ZMailer transport agent which is usually only run by the scheduler(8) to transfer messages to a remote Internet host using the SMTP protocol. The smtp program must be run with the same current directory as the scheduler, namely POSTOFFICE/transport.
The program scans the message control files named on stdin for addresses destined for its channel and the host given on the command line. If any are found, all matching addresses and messages are transferred in a single SMTP conversation. The destination host might in fact be served by any available mail exchanger for that host.
-6 -7 |
Prefer IPv6 type socket and addresses, if available. forces SMTP channel to be 7bit, and thus forcing all 8bit texts to be MIMEQPencoded for the transport. |
|
-8 |
forces SMTP channel to be 8bitclean, and as such, to decode the message while transporting it (is it is MIME QP encoded). |
|
-c channel -d -e |
specifies which channel name should be keyed on. The default is smtp. turns on debugging output. asks that for every destination address specification with a matching channel name, an MX lookup is done on the hostname to see whether the currently connected host can provide service for that destination. The default is to just do a textual name comparison with the destination hostname as given on the command line. |
|
-E |
use the "EHLO"greeting only if the remote server initial banner reports "ESMTP" on it. |
|
-h host |
specifies the hostname for the SMTP HELO greeting. The default is the hostname of the local system, as returned by gethostname(2) or uname(2). |
|
-F forcedest |
overrides delivery destination by forceing all email to be sent to given forcedest hostname, or literal [IPnumber]. |
|
-H |
Disable the per default active forced 8bit headers conversion into MIME2format. |
|
-L localident |
specifies (for multihomed machines) that they should use specified identity when connecting to the destination. Think of server with multiple IP numbers due to virtual hosting, for example. At such systems there may be situation when virtual identity needs to be used for reaching the destination system. Understood formats for local identity are: "iface:eth0" (eth0 device in the system) |
|
-l logfile |
specifies a log file where the complete SMTP command transaction will be copied. Each line in the log will be prefixed with the process id of the transport agent process, so the same log file can be used by all SMTP clients. |
|
-r |
asks to set up SMTP connections using a source TCP port number under 1024. This is in the range of port numbers only available to a privileged process on some UNIX systems, which has led to some misguided attempts at mail security based on this mechanism. |
-s |
asks to report the progress of the SMTP conversation and data transfer on the command line in a way that will be visible to ps(1). |
|
-x |
turns off MX lookups on delivery connections. This may be used ignore public MX knowledge and do exactly what the router says in cases where delivering to an explicit IP address is inappropriate. |
|
-P |
disable SMTPPIPELINING usage (ESMTP keyword: PIPELINING) |
-S /path/to/smtptls.conf
TransportLayerSecurity (a.k.a. SecureSocketLayer) feature |
T timeouts |
submodes are: |
conn=3m |
Timeout to wait for the TCP connection establishment. The default is 3 minutes. |
|
tcpw=3m |
Timeout to wait at lowlevel TCP socket write() routines for the socket to accept some more input. The default is 5 minutes. |
cmd=5m (or plain value) |
Waiting for command replies (e.g. MAIL FROM, et.al.) The default is 5 minutes. |
data=2m |
responce. The default is 2 minutes. |
||
dot=10m |
From "DATA" phase ending "." issuance until "250 OK" report reception (this is after the TCP write pipeline has completed). The default is 20 minutes. (RFC 1123 gives 10 minutes.) |
-V -W |
prints a version message and exits. turns on the DNS WKS checking, and if the remote system does not have SMTP in its WKSbits, email delivery to such address is aborted with an error message. |
This program reads in processable file names relative to the current working directory of the scheduler (namely: $POSTIOFFICE/transport/). Optionally on the same line the scheduler may tell which host is to be looked for from the recipients of the message.
relativespoolpath [ <TAB> hostname ] |
This program produces diagnostic output on the standard output. Normal diagnostic output is of the form:
id/offset<TAB>notifydata<TAB>status message |
where id is the inode number of the message file, offset is a byte offset within its control file where the address being reported on is kept, status is one of ok, error, or deferred, and the message is descriptive text associated with the report. The text is terminated by a linefeed. Any other format (as might be produced by subprocesses) is passed to standard output for logging in the scheduler log.
The exit status is a code from <sysexits.h>.
When user sends out 8bit mail with proper headers, this module can send it out to conforming servers either in 8bit transparent manner, or downconverting ContentTransferEncoding: 8BIT to ContentTransferEncoding: 7BIT or ContentTransferEncoding: QUOTEDPRINTABLE depending on what is the mail contents.
This works only with ContentType: text/plain thus no fancy multipart/alternate et.al.
When ContentTransferEncoding: -header is not present in the headers, and recipient has not declared 8bit SMTP capability, mail contents are treated with old 7bit stripping method.
If you are using a version which has been made to use OpenSSL 0.9.4, or latter version, you are able to encrypt the SMTP protocol session in case the remote end supports RFC 2487 defined STARTTLS facility.
Possible example of the smtp-tls.conf file is given below:
#|
#| This is example configuration file for TLS support at the SMTP TA
#| programs, e.g. SMTP Client.
#|
tlscertfile @MAILVAR@/db/smtpservercert.pem
tlskeyfile @MAILVAR@/db/smtpserverkey.pem
tlsCAfile @MAILVAR@/db/smtpserverCAcert.pem
#tlsCApath /path/to/CAdir/
#tlsloglevel 0 # Value from 0 thru 4
#|
#| If the TLS mode is MANDATED for a session, copy this file to
#| e.g. "smtptlsmandatory.conf", uncomment following line, and
#| point those channels to use that new file.
#|
#demandtlsmode
/etc/zmailer.conf
/var/spool/postoffice (POSTOFFICE)
scheduler(8)
router(8) |
||
RFC 821 |
The basic SMTP specification |
Several extended SMTP facilities are implemented:
RFC 1341/1521/2045 |
MIME specification (body, formats) |
This program authored and copyright by:
Rayan Zachariassen <rayan@cs.toronto.edu>
MIME downconverting feature (RFC1428) by:
Matti Aarnio <mea@utu.fi>