Matt Dunford wrote:
On 10/25/06, Geoff Soper
<geoff(_dot_)procmail4(_at_)alphaworks(_dot_)co(_dot_)uk> wrote:
I've got a virtualised web server (FC3, Plesk and Virtuozzo) hosting a
number of domains. I've installed SpamAssassin and call it from
.procmailrc files as described at
http://wiki.apache.org/spamassassin/UsedViaProcmail :
:0fw: spamassassin.lock
* < 256000
| spamassassin
The problem I'm facing is that a lot of incoming mail is skipping
SpamAssassin, I'm guessing that the if the lock is on, the call is
skipped rather than queued? I know it's passing the code as I've put a
filter before and after the call which adds a X header to the mail and
I'm seeing these two X headers but no evidence of the mail being
processed by SpamAssassin.
Can anyone suggest what I can do to solve this problem? I'm reluctant to
remove the lock as the SpamAssassin documentation suggests this is to
stop overloading by multiple SpamAssassin instances. I'd rather it
waited for the lock to free than skipping over it.
Hi Geoff,
If promail encounters a lock file, it will wait for it to be released.
After a certain amount of time (the LOCKTIMEOUT and TIMEOUT
variables), I believe it will consider it a stale lock and break that
lock.
The only reason procmail should skip your recipe is if the condition
returns false. Perhaps there are more emails bigger than 250 kb
coming through your system? I hope not, but that's one possibility.
For debugging, I suggest turning on logging and recording the size of
the email. Then watch the log to see if the emails that skip the
recipe are indeed smaller than 250 kb.
VERBOSE=yes
SIZE=`wc -c` # this will be in bytes
:0fw: spamassassin.lock
* < 256000
| spamassassin
Also, if your site is experiencing a high amount of traffic, consider
using spamc/spamd, which is much faster than invoking spamassassin
every time an email comes through. And I believe spamd will take care
of handling and queueing concurrent requests, so you wouldn't need a
lock file in your procmailrc either.
OK, from your most helpful suggestions I've turned on logging and it
looks like overloading is my problem:
procmail: Match on "< 256000"
procmail: Locking "spamassassin.lock"
procmail: Executing "/usr/bin/spamassassin"
Out of memory!
procmail: [31201] Thu Oct 26 12:34:13 2006
procmail: Program failure (1) of "/usr/bin/spamassassin"
procmail: Rescue of unfiltered data succeeded
procmail: [31201] Thu Oct 26 12:34:13 2006
procmail: Unlocking "spamassassin.lock"
I've since found the page
http://wiki.apache.org/spamassassin/NoProcessOnOverload which seems to
detail this problem and a potential solution. However, the described
solution seems a bit of a sticking plaster solution and I'd rather
address the root issue of overloading. Your suggestion of spamd/spamc is
one I've seen elsewhere when people are speaking about reducing load but
I'm unsure as to how to implement this. Do I simply replace "|
spamassassin" with "| spamc" or is there more to it than that?
A final question, I use LOG="comment" in my .procmailrc file to add
extra info to my log (i.e. which filter was matched in the
pre-SpamAssassin filtering) but can't work out how to get a new line
character after the comment! Everything I try either does nothing or
just prints the escaped newline character. Any suggestions?
Thanks very much,
Geoff
____________________________________________________________
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