Clarification of Answer by
spot_tippybuttons-ga
on
12 Sep 2002 15:37 PDT
Generally, receiving a numerical error code other than zero (which is
success) means the whole job didn't work, especially when you are
batching e-mails. If a specific user can't be delivered to, Sendmail
will drop this message in the queue and retry it again later. How much
later depends on your Sendmail configuration settings. You may or may
not get an error code if this happens depending on your implementation
and other flags to Sendmail. This is in part a hold over from the "old
days" when it was normal for remote systems to be temporarily
unavailable on a regular basis.
When you complete the job, you can force the queue to reprocess
immediately if you want. The command for this on most implementations
is:
sendmail -q
The best thing to do for error handling is to set up an e-mail account
specifically to receive bounces. When you generate the e-mail, set the
"from" address to the error account. Set the "reply to" address to the
account that should receive real mail from users, i.e. the list
administration account.
The error account will collect all the bounced mails. The best thing
to do then is to write an automated script that will parse the
addresses out of all of the bounces and remove them from your mailing
list. People frequently change e-mail accounts and forget to update
their list subscriptions and the like, so it is normal to have some
number of dead addresses on any mailing list. Pruning the dead
addresses will help you save time next time you send your list.
I'm not sure what kind of system access you have, but if you don't
want to have to parse the mailbox after the fact, you can use the
Sendmail alias command and the #error directive to redirect everything
from the error account to a script as soon as it is received. You will
find more information about how to use the alias command in your man
pages. There is also a very good book by O'Reilly, appropriately
titled "Sendmail" that has pretty much anything you ever wanted to
know about Sendmail. You can read more about the book at
http://www.ora.com/catalog/sendmail2/
Here is a list of exit codes for Sendmail from the 8.12.6 source code.
Note: These are NOT to be confused with the return codes that Sendmail
sends by TCP/IP to the remote host. These are the command line exit
codes.
(0) EX_OK -- successful termination
(64) EX_USAGE -- The command was used incorrectly, e.g., with the
wrong number of arguments, a bad flag, a bad syntax in a parameter, or
whatever.
(65) EX_DATAERR -- The input data was incorrect in some way. This
should only be used for user's data & not system files.
(66) EX_NOINPUT -- An input file (not a system file) did not exist or
was not readable. This could also include errors like "No message" to
a mailer (if it cared to catch it).
(67) EX_NOUSER -- The user specified did not exist. This might be
used for mail addresses or remote logins.
(68) EX_NOHOST -- The host specified did not exist. This is used in
mail addresses or network requests.
(69) EX_UNAVAILABLE -- A service is unavailable. This can occur if a
support program or file does not exist. This can also be used as a
catchall message when something you wanted to do doesn't work, but you
don't know why.
(70) EX_SOFTWARE -- An internal software error has been detected. This
should be limited to non-operating system related errors as possible.
(71) EX_OSERR -- An operating system error has been detected. This is
intended to be used for such things as "cannot fork", "cannot create
pipe", or the like. It includes things like getuid returning a user
that does not exist in the passwd file.
(72) EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
etc.) does not exist, cannot be opened, or has some sort of error
(e.g., syntax error).
(73) EX_CANTCREAT -- A (user specified) output file cannot be created.
(74) EX_IOERR -- An error occurred while doing I/O on some file.
(75) EX_TEMPFAIL -- temporary failure, indicating something that is
not really an error. In sendmail, this means that a mailer (e.g.)
could not create a connection, and the request should be reattempted
later.
(76) EX_PROTOCOL -- the remote system returned something that was "not
possible" during a protocol exchange.
(77) EX_NOPERM -- You did not have sufficient permission to perform
the operation. This is not intended for file system problems, which
should use NOINPUT or CANTCREAT, but rather for higher level
permissions.
(78) EX_CONFIG -- configuration error
Good luck with your mailing!