I've worked on
sendmail for many years,
and many employers have been remarkably patient
about letting me work on a large project
that was not part of my official job.
This includes time on the INGRES Project at
the University of California at Berkeley,
at Britton Lee,
and again on the Mammoth and Titan Projects at Berkeley.
Much of the second wave of improvements
should be credited to Bryan Costales of ICSI.
As he passed me drafts of his book on
sendmail I was inspired to start working on things again.
Bryan was also available to bounce ideas off of.
Many, many people contributed chunks of code and ideas to
sendmail. It has proven to be a group network effort.
Version 8 in particular was a group project.
The following people made notable contributions:
I apologize for anyone I have omitted, misspelled, misattributed, or
At this point, I suspect that at least a hundred people
have contributed code,
and many more have contributed ideas, comments, and encouragement.
I've tried to list them in the RELEASE_NOTES in the distribution directory.
I appreciate their contribution as well.
- John Beck, Hewlett-Packard
Keith Bostic, CSRG, University of California, Berkeley
Andrew Cheng, Sun Microsystems
Michael J. Corrigan, University of California, San Diego
Bryan Costales, International Computer Science Institute
Pär (Pell) Emanuelsson
Craig Everhart, Transarc Corporation
Tom Ivar Helbekkmo, Norwegian School of Economics
Allan E. Johannesen, WPI
Jonathan Kamens, OpenVision Technologies, Inc.
Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
Brian Kantor, University of California, San Diego
Murray S. Kucherawy, HookUp Communication Corp.
Bruce Lilly, Sony U.S.
Motonori Nakamura, Ritsumeikan University & Kyoto University
John Gardiner Myers, Carnegie Mellon University
Neil Rickert, Northern Illinois University
Eric Schnoebelen, Convex Computer Corp.
Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
Christophe Wolfhugel, Pasteur Institute & Herve Schauer Consultants (Paris)
Special thanks are reserved for Michael Corrigan and Christophe Wolfhugel,
who besides being wonderful guinea pigs and contributors
have also consented to be added to the ``sendmail@CS.Berkeley.EDU'' list
and, by answering the bulk of the questions sent to that list,
have freed me up to do other work.
Arguments must be presented with flags before addresses.
The flags are:
- Set operation mode to
x. Operation modes are:
m Deliver mail (default)
s Speak SMTP on input side
a* ``Arpanet'' mode (get envelope sender information from header)
d Run as a daemon
t Run in test mode
v Just verify addresses, don't collect or deliver
i Initialize the alias database
p Print the mail queue
- Indicate body type.
- Use a different configuration file.
Sendmail runs as the invoking user (rather than root)
when this flag is specified.
- Set debugging level.
- -f addr
- The sender's machine address is
- Sets the full name of this user to
- -h cnt
- Sets the
hop count to
cnt. This represents the number of times this message has been processed
sendmail (to the extent that it is supported by the underlying networks).
Cnt is incremented during processing,
and if it reaches
sendmail throws away the message with an error.
- Don't do aliasing or forwarding.
- -r addr
- An obsolete form of
- Set option
x to the specified
value. These options are described in Section 5.6.
option to the specified
value (for long form option names).
These options are described in Section 5.6.
- Set macro
x to the specified
- Set the sending protocol.
Programs are encouraged to set this.
The protocol field can be in the form
host to set both the sending protocol and sending host.
-pUUCP:uunet sets the sending protocol to UUCP
and the sending host to uunet.
(Some existing programs use -oM to set the r and s macros;
this is equivalent to using -p.)
- Try to process the queued up mail.
If the time is given,
sendmail will run through the queue at the specified interval
to deliver queued mail;
otherwise, it only runs once.
- Run the queue once,
limiting the jobs to those matching
Xstring. The key letter
X can be
I to limit based on queue identifier,
R to limit based on recipient,
S to limit based on sender.
A particular queued job is accepted if one of the corresponding addresses
contains the indicated
- Read the header for
Bcc: lines, and send to everyone listed in those lists.
Bcc: line will be deleted before sending.
Any addresses in the argument vector will be deleted
from the send list.
- -X logfile
- Log all traffic in and out of
sendmail in the indicated
logfile for debugging mailer problems.
This produces a lot of data very quickly and should be used sparingly.
There are a number of options that may be specified as
These are the e, i, m, and v options.
the f option
may be specified as the
This appendix describes the format of the queue files.
These files live in the directory defined by the
Q option in the
sendmail.cf file, usually
All queue files have the name
AAA99999 is the
id for this message
x is a type.
The first letter of the id encodes the hour of the day
that the message was received by the system
(with A being the hour between midnight and 1:00AM).
All files with the same id collectively define one message.
The types are:
- The data file.
The message body (excluding the header) is kept in this file.
- The queue control file.
This file contains the information necessary to process the job.
- A temporary file.
These are an image of the
qf file when it is being rebuilt.
It should be renamed to a
qf file very quickly.
- A transcript file,
existing during the life of a session
showing everything that happens
during that session.
qf file is structured as a series of lines
each beginning with a code letter.
The lines are as follows:
- The version number of the queue file format,
used to allow new
sendmail binaries to read queue files created by older versions.
Defaults to version zero.
Must be the first line of the file if present.
- A header definition.
There may be any number of these lines.
The order is important:
they represent the order in the final message.
These use the same syntax
as header definitions in the configuration file.
- The controlling address.
The syntax is
localuser:aliasname. Recipient addresses following this line
will be flagged so that deliveries will be run as the
localuser (a user name from the /etc/passwd file);
aliasname is the name of the alias that expanded to this address
(used for printing messages).
- The ``original recipient'',
specified by the ORCPT= field in an ESMTP transaction.
Used exclusively for Delivery Status Notifications.
It applies only to the immediately following `R' line.
- A recipient address.
This will normally be completely aliased,
but is actually realiased when the job is processed.
There will be one line
for each recipient.
Version 1 qf files
also include a leading colon-terminated list of flags,
which can be
`S' to return a message on successful final delivery,
`F' to return a message on failure,
`D' to return a message if the message is delayed,
`B' to indicate that the body should be returned,
`N' to suppress returning the body,
`P' to declare this as a ``primary'' (command line or SMTP-session) address.
- The sender address.
There may only be one of these lines.
- The job creation time.
This is used to compute when to time out the job.
- The current message priority.
This is used to order the queue.
Higher numbers mean lower priorities.
The priority changes
as the message sits in the queue.
The initial priority depends on the message class
and the size of the message.
- A message.
This line is printed by the
and is generally used to store status information.
It can contain any text.
- Flag bits, represented as one letter per flag.
Defined flag bits are
r indicating that this is a response message
w indicating that a warning message has been sent
announcing that the mail has been delayed.
- The total number of delivery attempts.
- The time (as seconds since January 1, 1970)
of the last delivery attempt.
- The i-number of the data file;
this can be used to recover your mail queue
after a disastrous disk crash.
- A macro definition.
The values of certain macros
(as of this writing, only
$s) are passed through to the queue run phase.
- The body type.
The remainder of the line is a text string defining the body type.
If this field is missing,
the body type is assumed to be
undefined and no special processing is attempted.
Legal values are
- The original MTS value (from the ESMTP transaction).
For Deliver Status Notifications only.
- The original envelope id (from the ESMTP transaction).
For Deliver Status Notifications only.
As an example,
the following is a queue file sent to
the person who sent the message,
the submission time
(in seconds since January 1, 1970),
the message priority,
the message class,
and the headers for the message.
Hreceived: by vangogh.CS.Berkeley.EDU (5.108/2.7) id AAA06703;
Fri, 17 Jul 92 00:28:55 -0700
Hreceived: from mail.CS.Berkeley.EDU by vangogh.CS.Berkeley.EDU (5.108/2.7)
id AAA06698; Fri, 17 Jul 92 00:28:54 -0700
Hreceived: from [22.214.171.124] by mail.CS.Berkeley.EDU (5.96/2.5)
id AA22777; Fri, 17 Jul 92 03:29:14 -0400
Hreceived: by foo.bar.baz.de (5.57/Ultrix3.0-C)
id AA22757; Fri, 17 Jul 92 09:31:25 GMT
H?F?from: email@example.com (Eric Allman)
H?x?full-name: Eric Allman
Hsubject: this is an example message
This is a summary of the support files
sendmail creates or generates.
Many of these can be changed by editing the sendmail.cf file;
check there to find the actual pathnames.
- The binary of
- A link to /usr/sbin/sendmail;
causes the alias database to be rebuilt.
Running this program is completely equivalent to giving
- Prints a listing of the mail queue.
This program is equivalent to using the
-bp flag to
- The configuration file,
in textual form.
- The SMTP help file.
- A statistics file; need not be present.
- Created in daemon mode;
it contains the process id of the current SMTP daemon.
If you use this in scripts;
use ``head -1'' to get just the first line;
later versions of
sendmail may add information to subsequent lines.
- The textual version of the alias file.
- The alias file in
- The directory in which the mail queue
and temporary files reside.
- Control (queue) files for messages.
- Data files.
- Temporary versions of the qf files,
used during queue file rebuild.
- A transcript of the current session.
- This page intentionally left blank;
replace it with a blank sheet for double-sided output.
TABLE OF CONTENTS
[Contents] [Previous] [Next]
This document was translated by troff2html v0.21 on May 31, 1996.
Please send comments to: