Discussion:
Moving Spam Messages to Spam Folder is done by MDA
Dauser Martin Johannes
2018-05-20 23:36:23 UTC
Permalink
I'm having some problems moving messages marked as spam to the IMAP spam
folder.  I'm aware that amavis-new will run spamassassin and clamav then
pass it back to postfix for delivery but currently it's being
DISCARDED.  Messages that don't contain a virus I'd like to move into a
SPAM folder.
Is this done within AMAVIS or is this done once the mail is handed back
to postfix for delivery?
Look for spam_lovers, virus_lovers and final_spam_destiny in the
documentation.
Amavis can pass to recipient's email address, bounce, reject or discard
the email. Oh, and quarantine it of course.

Moving emails with spam tags to a special folder is the job of your
Mail Delivery Agent (MDA), which is most likely using the IMAP-Protocol
(e.g. dovecot -- i.e. pigeonhole ). Depending on your MDA there are
different ways to achieve this.



I gave my users a simple sieve-script rule, which needs to be fed to
dovecot's pigeonhole by the user himself. But it should be possible to
set this as a general rule.

require ["fileinto"];
# rule:[SpamIntoJunk]
# Move mails which Spamassassin tagged as spam into the "Junk" folder.
if header :contains "X-spam-flag" "YES" {
     fileinto "Junk";
}

Our Junk folder is on the same level as the INBOX, otherwise you need
to adjust the command fileinto.

INBOX
emails
+ folders_defined_by_user
Junk
Drafts
Sent
Trash

Loading...