Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for spamassassin userprefs - reject threshold #281

Merged
merged 1 commit into from
Feb 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion plugins/spamassassin
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the options. Confused yet? :-) It looks like this in practice:

=over 4

=item reject [threshold]
=item reject [threshold|userprefs]

Set the threshold where the plugin will reject the mail. Some
mail servers are so useless that they ignore 55x responses not coming
Expand All @@ -42,6 +42,10 @@ retrying until the mail expires from their queue.
Depending on your spamassassin configuration a reasonable setting is
typically somewhere between 12 to 20.

By setting reject = userprefs, the required threshold will be taken
from spamassassin userprefs. Usually used in conjunction with
spamd_user = vpopmail.

The default is to never reject mail based on the SpamAssassin score.

=item munge_subject_threshold [threshold]
Expand Down Expand Up @@ -424,6 +428,13 @@ sub reject {
return DECLINED;
};

if ($reject eq 'userprefs') {
$reject = $sa_results->{required} or do {
$self->log(LOGERROR, "error, reject disabled ($status, $learn)");
return DECLINED;
};
}

if ($score < $reject) {
if ($ham_or_spam eq 'Spam') {
$self->log(LOGINFO, "fail, tolerated, $status < $reject, $learn");
Expand Down