Posted on Leave a comment

Virtualmin Mail – Enabling Sieve Support

For years now I’ve used Virtualmin for my hosting requirements, and have made use of Procmail to filter my mail into folders (it’s the default, and rather tightly integrated). The only issue with this system is having to login to two different things for mail: I use Rainloop Webmail for general mail viewing, but the Procmail filters are only editable through the Usermin section of Virtualmin. This is awkward to say the least, so being able to use Sieve which is already supported by Rainloop is a better option. (Sieve is also supported via plugin in Roundcube).

Since we’re going to still need Procmail for the Virtualmin-managed Spam & Virus scanning functions, we will add Sieve at the end of Procmail. There are some

First thing, get Sieve installed via Dovecot, with the following:

yum install dovecot-pigeonhole

Some configuration changes are required to Dovecot to get the Sieve server running, /etc/dovecot/conf.d/15-lda.conf should have this section:

protocol lda {
 # Space separated list of plugins to load (default is global mail_plugins).
 mail_plugins = sieve

Finally, in /etc/dovecot/conf.d/20-managesieve.conf, uncomment this section to enable the managesieve server:

service managesieve-login {
 inet_listener sieve {
 port = 4190

After these changes are made, restart Dovecot to get the configs reloaded. It’s easy to check if the Sieve server is listening by running the following command:

lsof -i:4190
dovecot 58667 root 15u IPv4 34795427 0t0 TCP *:sieve (LISTEN)
dovecot 58667 root 16u IPv6 34795428 0t0 TCP *:sieve (LISTEN)

Now for some minor changes to /etc/procmailrc to direct mail to Dovecot for delivery:

VIRTUALMIN=|/etc/webmin/virtual-server/ --exitcode 73 $LOGNAME
* ?/bin/test "$EXITCODE" = "73"
* ?/bin/test "$VIRTUALMIN" != ""
:0 w

I personally got an error when I made all these changes, which in my case was a permissions issue on the Dovecot log:

Can't open log file /var/log/dovecot: Permission denied
procmail: Program failure (75) of "/usr/libexec/dovecot/deliver"

This was solved by opening the permissions for /var/log/dovecot, this then vanished, and the logs confirmed Sieve was working properly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.