Make Spamassassin learn spam mails

Mark Sapiro mark at msapiro.net
Tue May 2 04:11:53 UTC 2017


On 05/01/2017 08:14 PM, Eoin Kim wrote:
> 
> Thanks for your reply. So, I guess the mutt is being used as an MUA for postfix user and the inbox of postfix user would be '/var/spool/postfix/incoming' something like that? So, this concept is not intercepting the incoming emails, is it? The mails will continue flowing as usual? I have to read manuals further but if you don't mind, I'd like to know the principle of this method. Thanks a lot.


Actually, in my case, mutt is the MUA used by a user whose name is not
root, but whose UID is 0. (Note that this is not recommended) and mutt's
inbox for that user is /var/spool/mail/username.

Note that this is probably an uncommon situation as it is probably much
more common for users to access their "inbox" via imap or pop3 from some
remote MUA. Thus, the forwarding address makes more sense. Also note
that a straight inline forward is not the best idea as it alters the
message.

I simplified things when I said

I also have an alias in my postfix that is effectively

Spam_Report: "|spamc -u postfix -L spam  || true"

It is actually

Spam_Report: "|filter|spamc -u postfix -L spam  || true"

where 'filter' is a program that reads an email message with an attached
message from stdin and writes just the attached message to stdout after
removing a few MailScanner headers. Thus, to learn a message as spam,
one forwards it as an attachment to the Spam_Report address.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the MailScanner mailing list