smtp sends the mail message on its standard input to targethost which in turn will deliver the message to recipient as being from sender. smtp can be used with sendmail instead of the latter's built-in IPC mailer. Here is a mailer definition we have used; your mileage will vary:
Mether, P=/usr/lib/mail/smtp, F=SsDFuCX, S=11, R=21, A=smtp $h $g $u
Every SMTP talker identifies itself in the ``host.domain'' part of the SMTP HELO message. Normally smtp uses the gethostname(2) call to get the hostname, and the compiled-in DOMAINNAME, to identify itself. The -h option allows you to override both values with one string, i.e., -herewhon.peter.edu. If you are using sendmail , then -h should be added to the Mether definition with ``-h$j'' (but this has not yet been tested). In upas, a typical rule is
^([^!]+)\.(mil|gov|edu|com|uk|org|net)!(.+)$ | "smtpqer -h dom.ain \1.\2 \s \3"
smtpd is a 4.2BSD (or later) network daemon: it listens on the SMTP port (TCP port 25 usually) for an SMTP talker, receives a mail message from it and hands the message to cmail (or equivalent other mail system). in.smtpd is a similar 4.3BSD (or later) inetd daemon: it expects an SMTP connection on file descriptor zero (0) and the sourcehost and sourceport as its argument (sourcehost in hexademical; sourceport in decimal).
smtpqer queues its standard input and shell commands to invoke smtp with smtpqer's standard input and arguments, and to remove the queued files if smtp is successful. It then runs runsmtpq.
runsmtpq locks the SMTP queue, executes all the shell command files in the SMTP queue, and unlocks the SMTP queue. runsmtpq is stolen outright from the SM paper in the proceedings of the Portland Usenix conference.
smtpq shows the contents of the SMTP queue.
cleansmtpq returns to sender mail which has been in the SMTP queue for more than three days and removes it from the queue.
returnsmtpmail takes the names of ``envelope'' shell files, returns the messages therein and removes the messages from the SMTP queue.
The SMTP listener (daemon) was synthesised by Geoff Collyer by smashing together an old nicname daemon written by Ian with more public-domain SMTP code from MIT.
smtpqer and smtpq were written by Geoff Collyer. runsmtpq, cleansmtpq and returnsmtpmail were stolen from the SM Portland Usenix paper and adapted by Geoff Collyer. Peter Honeyman installed it under upas on the Internet and fixed a lot of bugs. Some remain.
smtp and smtpqer could profitably handle multiple recipients on the same machine, but dealing with bad recipients would be tricky.
smtpd and in.smtpd create files named temp.* in their current directories, so they should be run in the SMTP queue directory.
smtp and smtpd limit connect time to 30 minutes, which can be optimistic.