Archiving copies of inbound messages with Sendmail

Archiving copies of inbound messages with Sendmail

The following is probably made obsolete by this or this .[note added 13 July 2005

For some time now we have a method for archiving incoming mail that suits us well. It does not require deep knowledge of sendmail.

We use the feature of mail.local that it can take multiple delivery arguments. So while the usual configuration delivers mail with the following arguments to Mlocal in the sendmail.cf:

A=mail.local -f $g -d $u

(where $u is the addressee) we created a user "archive" and modified the argument list to:

A=mail.local -f $g -d $u archive which also appends a copy of every incoming message to /var/mail/archive. We use a cron job to compress and rotate this file out to a different server for safekeeping. We feel that this is a lot more useful than keeping midnight backups of /var/mail for months or years.

Forwarded mail and mail handled by user-specified procmail in the .forward file is not archived. This might be considered a bug or a feature. The RCPT TO: address is also not available for some messages, this has not proven to be a problem for us, but it may be a concern.

An alternative method using Procmail is documented here .

The archives can be read with any email client, though we expect to make an extract with grepmail for the MUA to read when a user request for old mail is made.

Daniel Feenberg
feenberg at nber.org