add option to ruleset to accept incoming spammy messages to a configured mailbox

this is based on @bobobo1618's PR #50. bobobo1618 had the right idea, i tried
including an "is forwarded email" configuration option but that indeed became
too tightly coupled. the "is forwarded" option is still planned, but it is
separate from the "accept rejects to mailbox" config option, because one could
still want to push back on forwarded spam messages.

we do an actual accept, delivering to a configured mailbox, instead of storing
to the rejects mailbox where messages can automatically be removed from.  one
of the goals of mox is not pretend to accept email while actually junking it.
users can still configure delivery to a junk folder (as was already possible),
but aren't deleted automatically. there is still an X-Mox-Reason header in the
message, and a log line about accepting the reject, but otherwise it is
registered and treated as an (smtp) accept.

the ruleset mailbox is still required to keep that explicit. users can specify
Inbox again.

hope this is good enough for PR #50, otherwise we'll change it.
This commit is contained in:
Mechiel Lukkien
2023-08-09 18:03:29 +02:00
parent 383fe4f53a
commit 9c31789c56
9 changed files with 98 additions and 35 deletions

View File

@ -5,6 +5,12 @@ Accounts:
Domain: mox.example
Destinations:
mjl@mox.example: nil
mjl2@mox.example:
Rulesets:
-
SMTPMailFromRegexp: remote@example\.org
AcceptRejectsToMailbox: mjl2junk
Mailbox: mjl2
RejectsMailbox: Rejects
JunkFilter:
# Spamminess score between 0 and 1 above which emails are rejected as spam. E.g.