NAME
SYNOPSIS
DESCRIPTION
OPTIONS
INTERFACE
EXTENDED SMTP
SECURE SOCKET LAYER SUPPORT
FILES
SEE ALSO
SEE ALSO
AUTHOR

## NAME

smtp - zmailer SMTP client transport agent

## SYNOPSIS

smtp [ -678deEHrPsVxW ] [ -c channel ] [ -h heloname ] [ -l logfile ] [ -p remote-port ] [ -T timeouts ] [ -S /path/to/smtp-tls.conf ] [ -F forcedest ] [ -L localidentity ] host

## DESCRIPTION

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.

## OPTIONS

-6 -7 |  | Prefer IPv6 type socket and addresses, if available. forces SMTP channel to be 7-bit, and thus forcing all 8-bit texts to be MIME-QP-encoded for the transport.
-8 |  | forces SMTP channel to be 8-bit-clean, and as such, to decode the message while trans- porting 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 -h host |  | use the "EHLO"-greeting only if the remote server initial banner reports "ESMTP" on it. 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 [IP-number].
-H -L localident |  | Disable the per default active forced 8-bit headers conversion into MIME-2-format. specifies (for multi-homed machines) that they should use specified identity when connect- ing 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.
-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 knowl- edge and do exactly what the router says in cases where delivering to an explicit IP address is inappropriate.
-P |  | disable SMTP-PIPELINING usage (ESMTP keyword: PIPELINING)

-S /path/to/smtp-tls.conf

| Transport-Layer-Security (a.k.a. Secure-Socket-Layer) feature configuration file. When this is supplied, and system is compiled to possibly use it, and the remote system reports EHLO capability of STARTTLS, this client attempts to turn on the encryption on the socket. There exists also a posssibility of demanding TLS mode of the connection - if so has been demand, but it is not available, email is not sent over the connection.

-T timeouts specifies the timeouts when waiting for various things. Possible 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 From "DATA" verb issuance until "354" 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 prints a version message and exits.

-W |  | turns on the DNS WKS checking, and if the remote system does not have SMTP in its WKS-bits, email delivery to such address is aborted with an error message.

## INTERFACE

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.

relative-spool-path [ <TAB> hostname ]

This program produces diagnostic output on the standard output. Normal diagnostic output is of the form:

id/offset<TAB>notify-data<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>.

## EXTENDED SMTP

When user sends out 8-bit mail with proper headers, this module can send it out to conforming servers either in 8-bit transparent manner, or down-converting Content-Transfer-Encoding: 8BIT to Content-Transfer-Encoding: 7BIT or Content-Transfer-Encoding: QUOTED-PRINTABLE depending on what is the mail contents.
This works only with Content-Type: text/plain thus no fancy multipart/alternate et.al. schemes..
When Content-Transfer-Encoding: -header is not present in the headers, and recipient has not declared 8-bit SMTP capability, mail contents are treated with old 7-bit stripping method.

## SECURE SOCKET LAYER SUPPORT

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. #| tls-cert-file @MAILVAR@/db/smtpserver-cert.pem tls-key-file @MAILVAR@/db/smtpserver-key.pem tls-CAfile @MAILVAR@/db/smtpserver-CAcert.pem #tls-CApath /path/to/CAdir/ #tls-loglevel 0 # Value from 0 thru 4 #| #| If the TLS mode is MANDATED for a session, copy this file to #| e.g. "smtp-tls-mandatory.conf", uncomment following line, and #| point those channels to use that new file. #| #demand-tls-mode |

## FILES

/etc/zmailer.conf
/var/spool/postoffice (POSTOFFICE)

## SEE ALSO

scheduler(8)

## SEE ALSO

router(8)

RFC 821 RFC 1123 |  | The basic SMTP specification Various 821 parameter clarifications |

Several extended SMTP facilities are implemented:

RFC 1341/1521/2045 RFC 1342/1522/2047 RFC 1425/1651/1869 RFC 1426/1652 RFC 1427/1653/1870 RFC 1428 RFC 1830 RFC 1854/2197 RFC 1891 RFC 1893/2034 RFC 1985 RFC 2487 RFC 2554+M$ Exchange RFC 2554+NetScape |  | MIME specification (body, formats) MIME specification (headers) ESMTP EHLO framework ESMTP 8BITMIME ESMTP SIZE Basic MIME conversion rules ESMTP CHUNKING ESMTP PIPELINING ESMTP DSN ESMTP ENHANCEDSTATUSCODES ESMTP ETRN ESMTP STARTTLS ESMTP AUTH LOGIN ESMTP AUTH=LOGIN

## AUTHOR

This program authored and copyright by:
Rayan Zachariassen <rayan@cs.toronto.edu>
MIME downconverting feature (RFC1428) by:
Matti Aarnio <mea@utu.fi>