How to use Procmail to disable spamassassin for one user
Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a honeypot mailbox that I want to turn
off the spamassassin engine for. I need to
stop spamassassin from doing any processing
of mail for this mailbox, so setting rule scores
is not the answer here. Spamassassin is invoked
system wide from procmail.
Here is the /etc/procmailrc file:
INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
...and here's the included spamassassin-default.rc file
:0
* ^TO_honeypot
/var/spool/mail/honeypot
:0fw
| /usr/bin/spamassassin
If my recipes are, correct it should only run
spamassassin on mail not destined for the
honeypot account. But when I look at messages in
that mailbox I can see they still got processed
by spamassassin.
Can anyone tell me where I am going wrong?
We have procmail 3.22 and spamassassin 2.44 on
Redhat 9.
Can anyone tell me where I am going wrong?
Best way to find out yourself is copy your procmailrc and set these:
VERBOSE=on
LOG=somelogfilename
then run some messages.
That wouldn't deliver mail to honeypot at all then... would it?
Uh. I was focussing on not filtering for piping to spamassassin. Try reversing recipe order should do.
I'll try to turn on logs for a few seconds -this is a busy server.
Better not "play" on servers. If you have no development, staging or private box at least mimic your setup to test under an unprivileged account like I described here: http://www.linuxquestions.org/questi...80#post2166780. Note in your case you don't have to run the spamassassin command but only the second "cat spammsg001" line with your recipe file (the "-m spammsg001.rc" part).
Now I understand why I was seeing mail messages
with spamassassin scores in the honeypot mailbox:
its because there are aliases that point to the
honeypot. I should have said that -sorry.
So, how do I get procmail to match not just on
the mailbox name, but on any aliases that also
point to it?
(I suspect its difficult since sendmail doesn't
put the expanded mailbox name into the headers;
just the alias).
Now I understand why I was seeing mail messages with spamassassin scores in the honeypot mailbox: its because there are aliases that point to the honeypot. I should have said that -sorry.
Well, most important thing is you now have a *method* to debug / remember / find out...
So, how do I get procmail to match not just on the mailbox name, but on any aliases that also point to it?
(I suspect its difficult since sendmail doesn't put the expanded mailbox name into the headers; just the alias).
Pipe the alias through a Smrsh which executes Procmail which executes Spamassassin: http://reuben.budiardja.org/blog/ind...ser-table.html
I have used it only with delivery to a named mailbox.
For those following, here is the solution to my problem which was
subtley different from the one in the blog.
1) Create your honeypot user account
2) Create aliases in /etc/aliases file that point to the honeypot
E.g.:
sales: honeypot
3) Create an additional alias that delivers honeypot's mail to a
program. This must be symbolically linked to in /etc/smrsh and
(this bit me) *has at least chmod 555 permissions*. Run newaliases
4) In the script execute procmail with an argument that is the path
to a procmail recipe file. E.g.
exec procmail /some/path/recipe_rc
5) In the recipe file add:
0:
/var/spool/mail/honeypot
Now any mail for honyepot, whether sent to the account, or any of its
aliases, is not processed by spamassassin. So now my mail server won't
get hammered by spamassassin when honeypot fills up with spam (to mix
rather a large number of metaphors!).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.