I created a blacklist rule to filter out messages:

From: *@job.com yes

It works, partly, except that part of those messages are sent with a return-path other than job.com. I Googled a bit and Mailscanner actually check the return-path field when you specify "From:". I can't seem to find a why to actually match the From header.

Is there a way to make a rule that matches the From header?


You'll find that this kind of filter is a lot easier to set up in procmail than in Spamassassin, and procmail will co-exist happily with Spamassassin.

  • I typed Spamassasin, but I meant Mailscanner... I don't know if procmail and mailscanner are inter operable, but I'll look into it. I do have procmail experience, so writing filter rules in there would be simple. – Halfgaar Apr 15 '11 at 11:25

Just for the record: I used /etc/Mailscanner/spam.assassin.prefs.conf and put this in it:

blacklist_from *@job.com
blacklist_from *@experteer.com

The file wasn't loaded by Mailscanner initially, but all I had to do was include a symlink to it in /etc/spamassassin/ (named mailscanner.cf in my case). Newer Debian (based) distro's don't require this symlink anymore, but this is an old deprecated server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.