Mail not getting through Procmail with Spamassassin


Strange problem began last week. Emails to some accounts were not getting through at all. I discovered that Spamassassin had stopped. When I restarted it, the problem persisted.
Only by turning off Spamassassin in the config, would these accounts work normally. Meanwhile, some other accounts were working fine.
And all accounts had previously been working fine.

I have done some testing, and have noted the following:-

-> Spamassassin running, Spamassassin is active on, active on
-> Send an email to
-> Email received by Postfix and handed off to Procmail
-> Email disappears…
-> In the Edit Mail Users panel for info@, there is notification of new mail at correct time
-> But email doesn’t show up in Maildir, and is not delivered to either IMAP or POP service

-> Spamassassin running, Spamassassin is NOT active on, NOT active on
-> Send an email to
-> Email received by Postfix and handed off to Procmail
-> Email received…

So, somewhere between Spamassassin and Procmail the messages are being lost…
Unfortunately, this is slightly beyond my server maintenance knowledge.
I hope that someone out there can point me in the right direction!




It sounds like you’ve done a lot of detective work already! :slight_smile:

Since emails are getting to your server, that means you can use the logfiles in order to track down where the messages are going.

That’s my recommendation of where to go next – send yourself an email to an account you’ve had trouble with, and then look at the email logs (either /var/log/messages or /var/log/mail.log).

In there, you should see the email being received, as well as what all happens to it before it gets handed off to procmail. If there’s errors with Postfix or SpamAssassin, they should show up there.

And then, if you don’t notice anything at that point, do you see it being handed off to procmail? If so, the next step is to look in /var/log/procmail.log, and see what’s happening in there.

You should be able to see what folder procmail puts it in. If there’s an error of some sort, feel free to note that here and we can try to figure that out.


Hi Eric:-

Thanks for your comments… I checked the Mail log and there are no errors for the missing emails - here’s an example:-


Mar 31 22:39:56 vps postfix/smtpd[25689]: EAD6219842566: client=unknown[], sasl_method=PLAIN, sasl_username=user.mydomain

Mar 31 22:39:57 vps postfix/cleanup[13586]: EAD6219842566:

Mar 31 22:40:00 vps postfix/qmgr[26248]: EAD6219842566:, size=22551, nrcpt=1 (queue active)

Mar 31 22:40:20 vps postfix/local[13613]: EAD6219842566:,, relay=local, delay=24, delays=4/0.01/0/20, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

Mar 31 22:40:20 vps postfix/qmgr[26248]: EAD6219842566: removed


Apr 1 10:41:39 vps postfix/smtpd[13821]: 715B719842F04:[]

Apr 1 10:41:39 vps postfix/cleanup[22384]: 715B719842F04:

Apr 1 10:41:39 vps postfix/qmgr[13360]: 715B719842F04:, size=1852, nrcpt=1 (queue active)

Apr 1 10:42:38 vps postfix/local[32558]: 715B719842F04:,, relay=local, delay=59, delays=0.09/0.08/0/59, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)

Apr 1 10:42:38 vps postfix/qmgr[13360]: 715B719842F04: removed

So it must be something to do with Procmail - I will investigate the logs…

Thanks for your help, as ever!



Looks like you’re correct, I don’t see anything wrong above either; it’s indeed just delivering those messages to procmail, so let’s see what procmail has in store for us :slight_smile:


Okay - figured out what the problem is - bit of an RTFM, really.

The missing email was being processed correctly by procmail, but then ending up in the /Maildir/.spam folder


Now - in my defense - I had not expected it to go there because in the Procmail Delivery Settings of Spamassassin the “Action for messages classified as spam” is set to “Deliver Normally” - I was expecting Spamassassin to just mark the headers and pass it on - not to quarantine it…

Any idea why it would be doing this?

Furthermore - it looks like one of the domains has ended up on a spam blacklist - so it was treated as a false positive…

So I will go back to the spamassassin settings and adjust… And try to get myself removed from the blacklist!

Thanks again for all your help.

Just for fun, would you be willing to triple check that the SpamAssassin settings you’re describing above are indeed set for this particular domain (rather than for some other domain on the system)?

It’s possible to set those for one domain, and not for another.

You can view those by first choosing the domain from the drop-down on the top-left, then going into Server Configuration -> Spam and Virus Delivery.

If it is set the way you want it, with spam going into the Inbox – try changing it to something else, then back again.


Thanks Eric. Looks like the local settings were indeed over-riding the global settings… Double doh!
But to be honest, the quarantine approach suits my users best, so I think I’ll stick with it.

Upon further investigation, the main problem here appears to have been a Spamassassin bug, whereby it marks an email dated from 2010 with “FH_DATE_PAST_20XX The date is grossly in the future.” - this appears to be a known issue with older Spamassassin distros, e.g.
And this has been causing a lot of false positives since Jan 1st, 2010, hence my discovery of the problem.

There is a solution proposed here:

If you need to disable this test manually, place the following in your file:

score FH_DATE_PAST_20XX 0.0

So I think I might just try this, and assume that the distro will be updated before 2020 :wink:

Thanks for all your help in solving this.



More great detective work :slight_smile:

Yeah, that problem does crop up on some SpamAssassin installs. In addition to what you discovered above, running “sa-update” is supposedly able to correct it, as that will pull in more recent rule files that correct the problem.

However, to be safe, you might consider doing both for the time being :slight_smile:


Great - thanks - I have updated spamassassin and added the following daily cron:-

sa-update && service spamassassin restart

And I’ll monitor the spam folders for this problem in future!