SMTP

Section: Maintenance Commands (8)
Updated: local
Index Return to Main Contents
 

NAME

smtp, smtpd, in.smtpd - SMTP talker and listeners
smtpqer, runsmtpq, smtpq - SMTP enqueuing, queue running and listing
cleansmtpq, returnsmtpmail - SMTP queue cleaning and mail returning  

SYNOPSIS

/usr/lib/mail/smtp [ -h helohost ] targethost sender recipient
cd /usr/spool/smtpq; /usr/lib/mail/smtpd
cd /usr/spool/smtpq; /usr/etc/in.smtpd sourcehost.sourceport
/usr/lib/mail/smtpqer [ -h helohost ] targethost sender recipient
/usr/lib/mail/runsmtpq
/usr/lib/mail/smtpq
/usr/lib/mail/cleansmtpq
/usr/lib/mail/returnsmtpmail *.sh ...  

DESCRIPTION

These routines provide a minimal stand-alone SMTP service. It consists of small programs that can be used with a central mail router like upas, a system of your own construction, or sendmail.

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.  

FILES

/usr/spool/smtpq      the SMTP queue
queue/*.sh    envelopes

queue/*.msg   message contents

queue/*.errs  errors from running
smtp
temp.*        incoming messages, created in smtpd's current directory
 

SEE ALSO

RFC 821 - Simple Mail Transfer Protocol, ARPA Internet, NIC, SRI  

DIAGNOSTICS

By default, the talker program exits with the return codes defined in <sysexits.h> for sendmail. To disable this, compile with -DNOSYSEXITS; it will exit with code 1 for all errors.  

HISTORY

The SMTP talker (client) was written by Ian Darwin in 1985, as a simple telnet-like program that just talked from stdin to a remote SMTP. In late 1986, it was built into a full talker with some functions stolen from the public domain MIT UNIX TCP/IP implementation.

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.  

BUGS

The SMTP implementation is minimal, and could stand some fleshing out.

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.


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
SEE ALSO
DIAGNOSTICS
HISTORY
BUGS

This document was created by man2html, using the manual pages.
Time: 07:13:12 GMT, December 12, 2024