From 025db13070cabde62aed0b9c694baaaa4538b205 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 11 Dec 2013 00:56:02 +0100 Subject: Configure dovecot's antispam filter. Mails to be retrained are stored in the spooldir /home/mail/spamspool; later a daemon catches them up and feed them to sa-learn(1p). (On busy systems batch-process the learning should be much more efficient.) The folder transisition matrix along with the corresponding actions can be found there: http://hg.dovecot.org/dovecot-antispam-plugin/raw-file/5ebc6aae4d7c/doc/dovecot-antispam.7.txt See also dovecot-antispam(7). --- roles/IMAP/files/etc/dovecot/conf.d/20-imap.conf | 68 ++++++++++++++++++++++ roles/IMAP/files/etc/dovecot/conf.d/90-plugin.conf | 21 +++++++ .../files/etc/dovecot/conf.d/auth-ldap.conf.ext | 2 +- 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 roles/IMAP/files/etc/dovecot/conf.d/20-imap.conf create mode 100644 roles/IMAP/files/etc/dovecot/conf.d/90-plugin.conf (limited to 'roles/IMAP/files/etc/dovecot/conf.d') diff --git a/roles/IMAP/files/etc/dovecot/conf.d/20-imap.conf b/roles/IMAP/files/etc/dovecot/conf.d/20-imap.conf new file mode 100644 index 0000000..6771cc7 --- /dev/null +++ b/roles/IMAP/files/etc/dovecot/conf.d/20-imap.conf @@ -0,0 +1,68 @@ +## +## IMAP specific settings +## + +protocol imap { + # Maximum IMAP command line length. Some clients generate very long command + # lines with huge mailboxes, so you may need to raise this if you get + # "Too long argument" or "IMAP command line too large" errors often. + #imap_max_line_length = 64k + + # Maximum number of IMAP connections allowed for a user from each IP address. + # NOTE: The username is compared case-sensitively. + #mail_max_userip_connections = 10 + + # Space separated list of plugins to load (default is global mail_plugins). + #mail_plugins = $mail_plugins antispam + + # IMAP logout format string: + # %i - total number of bytes read from client + # %o - total number of bytes sent to client + #imap_logout_format = bytes=%i/%o + + # Override the IMAP CAPABILITY response. If the value begins with '+', + # add the given capabilities on top of the defaults (e.g. +XFOO XBAR). + #imap_capability = + + # How long to wait between "OK Still here" notifications when client is + # IDLEing. + #imap_idle_notify_interval = 2 mins + + # ID field names and values to send to clients. Using * as the value makes + # Dovecot use the default value. The following fields have default values + # currently: name, version, os, os-version, support-url, support-email. + #imap_id_send = + + # ID fields sent by client to log. * means everything. + #imap_id_log = + + # Workarounds for various client bugs: + # delay-newmail: + # Send EXISTS/RECENT new mail notifications only when replying to NOOP + # and CHECK commands. Some clients ignore them otherwise, for example OSX + # Mail ( for list of plugins and +# their configuration. Note that %variable expansion is done for all values. + +plugin { + antispam_backend = spool2dir + + antispam_trash = TRASH + antispam_unsure_pattern_ignorecase = MailTrain;MailTrain/* + antispam_spam = SPAM + + # The first %%lu is replaced by the current time. + # The second %%lu is replaced by a counter to generate unique names. + # These two tokens MUST be present in the template! + antispam_spool2dir_spam = /home/mail/spamspool/%u-%%10lu-%%06lu.spam + antispam_spool2dir_notspam = /home/mail/spamspool/%u-%%10lu-%%06lu.ham +} diff --git a/roles/IMAP/files/etc/dovecot/conf.d/auth-ldap.conf.ext b/roles/IMAP/files/etc/dovecot/conf.d/auth-ldap.conf.ext index 8e88b27..15eb306 100644 --- a/roles/IMAP/files/etc/dovecot/conf.d/auth-ldap.conf.ext +++ b/roles/IMAP/files/etc/dovecot/conf.d/auth-ldap.conf.ext @@ -23,7 +23,7 @@ passdb { # args = /etc/dovecot/dovecot-ldap-userdb.conf.ext # # # Default fields can be used to specify defaults that LDAP may override -# #default_fields = home=/home/virtual/%u +# default_fields = home=/home/mail/%d/%n #} # If you don't have any user-specific settings, you can avoid the userdb LDAP -- cgit v1.2.3