Dovecot

Dovecot 2.4 LDAP configuration

We will create a basic LDAP configuration for Dovecot 2.4 which features new confguration syntax. The example uses asynchronous lookups for userdb and passdb queries. ## LDAP ldap_uris = ldap://ldap.example.com:389 ldap_auth_dn = cn=mail,ou=Services,dc=example,dc=com ldap_auth_dn_password = <secret_password> ldap_base = ou=Users,ou=Mail,dc=example,dc=com ldap_starttls = yes passdb ldap { passdb_use_worker = yes passdb_ldap_filter = (&(objectClass=mailUser)(mailDrop=%{user})(!(mailEnabled=FALSE))) ldap_bind = yes fields […]

Mail Server using LDAP backend w/ Postfix and Dovecot

We will set up Postfix and Dovecot using an OpenLDAP backend with a custom LDAP schema. Our schema uses a dedicated organization unit called mail which acts as a container for all of our hosted domains and users. The virtual mail users will use their primary e-mail address to login to the server and each […]

Allow users to categorize spam using IMAP

We will allow users to categorize mail as Spam by placing them in user-specific Spam mailboxes. Contrary moving a message flagged as Spam to any other mailbox will relearn it as Ham. IMAPSieve configuration Dovecot supports this via its IMAPSieve plugin which we will configure in our custom configuration /etc/dovecot/local.conf to avoid touching release-specific files in […]

Sieve filter recipes

Spam filtering Some mailing-lists tend to be more spammy than others. If we put a filter before they are handled by the rest of the script, we can fish for bad guys before they get filed. #selective spam filter if allof (envelope :matches :domain “From” [“*debian.org”,”*kernel.org”,”*icinga.org”,”*mutt.org”,”*nginx.org”], header :contains “X-My-Unique-Spam-Flag” “Yes”) { fileinto “Spam”; stop; } […]