How to make a copy of all outgoing mails

Last Update 1998-01-21

This is a copy of a Usenet article found with DejaNews Research Service.

From:         Homme Bitter <H.Bitter@syntegra.nl>
Date:         1997/06/20
Message-ID:   <33AA593A.4B701C3F@syntegra.nl>
Newsgroups:   comp.mail.sendmail

It took me some time, but,
I have it solved...
This can also be used as a general purpose mailfilter too, excellent for
detecting spam and other unpleasant things.

Solution:

Let sendmail map everything through procmail, let procmail do to your
mail whatever you want with it and map it back.

That was the easy part...
Now for the syntax.

Add some local rules to your m4 config file ( use m4, ALWAYS ! ).

MAILER(`procmail')dnl
LOCAL_RULE_0
R$*<@$*.procmail>$* $1@<$2>$3 map back of procmail copy
LOCAL_RULE_0
R$*<@$+>$* $#procmail $@/etc/procmailrc $:$1@$2procmail$3 send all
external mail to procmail

this will send all mail through procmail using the file /etc/procmailrc
as the config file for procmail.

I use this one:

:0 c:
/var/mail/archive

Once I found this all out ( with a little help, I might add ). it all
seemed so simple....

Maybe this would be a good item to add to the faq, since it is a general
purpose add on for sendmail that can be used for many useful purposes.

Known problems:
Sending to a top leve domain doesn't work, it somehow looses a dot, but
then again, there are no mailaddresses in toplevedomains, to my
knowledge, so, who cares.
This version only works for mail wit a @ sign in the address, it's kind
of hard to split up an address that consists of only one string.

Good luck, I hope the mail-commutity is happy with this.

Homme

[(links)] [Hints] [Avoiding Spam] [FAQ] [cf/README] [New]
Copyright © Claus Aßmann Please send comments to: <ca@informatik.uni-kiel.de>