-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod_smtp_greylisting: Add ability to greylist messages in SMTP.
This adds the ability to greylist incoming email, a common technique used to defer potentially spammy messages which results in "less spam by deferring", with the idea that many spammers do not retry temporarily failures. The implementation here, while following RFC 6647 to some extent, takes a different approach from conventional approaches to greylisting, with the primary aim of reducing the chances that legitimate (ham, or non-spam) mail is delayed for any reason. In particular, greylisting is contingent about meeting two conditions: * A minimum fail count. Many spammers deviate from the SMTP standards in way that commit an outright protocol violation or are, at the very least, suspicious. We already track this and tarpit senders that increase the fail count, but this is also a good sign that the message could be spam, and greylisting might make sense. * A minimum spam score, as reported by SpamAssassin. This is less conventional, since typically greylisting is performed in order to deter potential spam to reduce system load, as spam filtering is a resource-intensive process. However, as our focus is less on high-throughput and more on effectiveness and convenience, it can make sense to analyze the message for spam, and greylist the message if it has a higher spam score. Collectively, conditioning greylisting on these two criteria allows us to avoid greylisting at all for the majority of legitimate mail. This avoids delays that are commonly a source of frustration with greylisting.
- Loading branch information
1 parent
caab081
commit 9327c0c
Showing
18 changed files
with
741 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ maildir=/home/bbs/maildir ; Where users' email is stored. | |
; WARNING: You could open the catchall mailbox up to receiving a lot of spam by enabling this! | ||
; The specified catch all mailbox must belong to a user directly (it cannot be an alias). | ||
; Default is none (disabled unless specified). | ||
; The catch all address applies to ALL domains. | ||
; The catch all address applies to ALL domains. To add a catch-all for a single domain, use an alias instead. | ||
quota=10000000 ; Default maximum mail quota (in bytes), allowed per mailbox. Default is 10 MB. | ||
; A per-mailbox quota override can be imposed by specifying the quota in bytes in a .quota file in a mailbox's root maildir. | ||
trashdays=7 ; Number of days messages can stay in Trash before being automatically permanently deleted. | ||
|
@@ -93,5 +93,6 @@ trashdays=7 ; Number of days messages can stay in Trash before being automat | |
;abuse = sysop | ||
;root = sysop | ||
|
||
;* = sysop ; Catch-all for all domains. Equivalent to enabling the catchall setting in [general]. If present, MUST be first. Order matters! | ||
;*@bbs.example.net = sysop ; Define catch-all for entire domain. Be sure to define these BEFORE any other aliases for the domain. Order matters! | ||
;[email protected] = sysop | ||
;*@bbs.example.net = sysop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; mod_smtp_greylisting - SMTP message greylisting | ||
; This module is active as long as this config file is present. | ||
; Greylisting should only be done on the mail server that receives mail directly from the Internet. | ||
; Spam filtering, if being done, should be done on the same server so that the spam score is available for greylisting checks. | ||
[general] | ||
; Define conditions required to evaluate messages for greylisting. | ||
; Messages meeting this criteria will be greylisted. You can fine tune these to control what messages get greylisted. | ||
; On one extreme, set both to 0 to greylist every incoming message. On the other, to greylist only the most obviously spammy messages, increase min_spamscore. | ||
; Since greylisting may incur delays in receiving legitimate mail, it is recommended that min_spamscore be set to at least 1, to avoid unnecessarily delaying ALL messages. | ||
; It is recommended that you change min_failcount only in response to observation of real traffic. | ||
min_spamscore = 2 ; Minimum rounded X-Spam-Score value required to consider greylisting a message. The header value is a float (e.g. 7.3) but is rounded down for comparison. Default is 2. | ||
min_failcount = 1 ; Minimum SMTP failure count (~protocol violations or suspicious activity) to consider greylisting a message. Default is 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.