dspam Training

Training dspam from Thunderbird junk messages
Dovecot Antispam Plugin

Retrain spam message

dspam --user username --source=error --class=spam /path/to/message

Classify a message without training on it:



doveadm, the Dovecot administration utility, can be used to manage various parts of Dovecot. It can be very useful for performing complex searches of mailboxes as well as deleting or moving the messages it finds.

Search Examples
Find messages that sent to before 2011-01-01:

doveadm search -u mailbox Sent TO SENTBEFORE 2011-01-01

Same query but display the physical size of the messages, along with the message filename:

doveadm fetch -u size.physical mailbox Sent TO  SENTBEFORE 2011-01-01

Display just the physical size of the messages found:


Dovecot Anti-Spam Plugin

The antispam plugin allows you to retrain the spam filter by simply moving emails in and out of the Spam folder.

cd /extra/src
wget -O dovecot-antispam-plugin.tar.gz
tar zxf dovecot-antispam-plugin.tar.gz
cd dovecot-antispam-plugin-5ebc6aae4d7c

Configure and build it:

ACLOCAL='aclocal -I /usr/local/share/aclocal' ./
./configure --prefix=/usr/local
make install

To configure it, edit /usr/local/etc/dovecot/conf.d/90-plugin.conf:


Master Users

Dovecot allows you to have Master Users who are able to log in as other users. It's also possible to directly log in as any user using a master password, although this isn't recommended.

Edit /usr/local/etc/dovecot/conf.d/auth-master.conf.ext and enable a passwd file for the master user(s):

passdb {
  driver = passwd-file
  master = yes
  args = /usr/local/etc/dovecot/passwd.masterusers

  # Unless you're using PAM, you probably still want the destination user to
  # be looked up from passdb that it really exists. pass=yes does that.
  pass = yes

Edit /usr/local/etc/dovecot/conf.d/10-auth.conf and add a separator for between the usernames. Also, enable the auth-master.conf.ext config file:


Autocreate folders

How to automatically create folders in the user's maildir when they login. Handy for creating folders for maildrop.

Dovecot has an Autocreate pluging that can automatically create and subscribe folders when a user logs in.

Dovecot 2.0.x includes the autocreate plugin by default. To enable it, edit /usr/local/etc/dovecot/conf.d/20-imap.conf and add it to the mail_plugins list:

protocol imap {
  mail_plugins = $mail_plugins autocreate

To create folders, add them into /usr/local/etc/dovecot/conf.d/90-plugin.conf:

plugin {


Shared IMAP folders

Create shared IMAP folders that multiple users can access. in OS X 10.3 doesn't see the Shared folders? Something with the INBOX prefix wackiness of OS X?
Thunderbird - couldn't get it to see the subfolders of a shared folder.



Download the latest tarball of the Dovecot source:

cd /extra/src
tar zxf dovecot-2.3.10.tar.gz
cd dovecot-2.3.10

Configure Dovecot with support for vpopmail, compile and install it. If you want POP3 as well as IMAP, you need to specify it in the configure options.

./configure --with-vpopmail
make install

Create the necessary users and group for Dovecot to run as:

groupadd dovecot
useradd -g dovecot -s /bin/false -c "Dovecot Mail Server" dovecot


Subscribe to RSS - dovecot

Recent Updates

  • 1 year 1 month ago
  • 1 year 1 month ago
  • 1 year 1 month ago
    php 8.x
  • 1 year 1 month ago
  • 1 year 1 month ago
    Drop Centos 5/6 stuff