procmail
[Top] [All Lists]

Filtering spam and forwarding mails

2006-11-24 10:01:56
Hello,

I recently had to implement spam filtering on a Debian Sarge server
(procmail 3.22-11, postfix 2.1.5-9, courier-imap-ssl 3.0.8-4sarge5).

We have several users here getting mail - some of them get their mails
forwarded to their private mail address, too. This forwarding had been
done via /etc/aliases.
We also have some group addresses, which every user in the group
receives, to simplify communication.

I inserted into /etc/procmailrc, as the subject of every spam mail
begins with the string *****SPAM***** :
:0
* ^SUBJECT: \*\*\*\*\*SPAM\*\*\*\*\*
$MAILDIR/.Spam/

This works fine. But spam mails are still forwared to the private mail
addresses.

Is there a possibility to filter outgoing mails with procmail? If the
answer is "yes" you can stop reading and start telling me how to do
that. :-)

I tried several other things:
I deleted forwarding in /etc/aliases and activated it in /etc/procmailrc
(I don't want to use $HOME/.procmailrc as there are too many users):
DROPPRIVS=yes
:0 c
* ^To:(_dot_)*user1(_at_)businessmailaddress(_dot_)edu
! user1(_at_)privatemailadress(_dot_)org

But now every user gets a mail multiple times forwarded to his private
address if the mail is sent to user1 and user2. I don't understand why
this is the case as this also happens if I add a test that "$HOME"
equals "/home/user1", which should only be true if user1 gets the mail
in my understanding.

So I deleted that and tried:
DROPPRIVS=yes
:0 c
* ^X-Original-To:(_dot_)*user1(_at_)businessmailaddress(_dot_)edu
! user1(_at_)privatemailadress(_dot_)org

Now getting mails multiple time is fixed, but if I send a mail to
group1(_at_)businessmailaddress(_dot_)edu no one of this group gets the mail
forwarded to the private address(which completely makes sense, but does
not solve my problem).

Any help is really appreciated!

Kind regards
Patrick



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Filtering spam and forwarding mails, Patrick Häcker <=