Any reason why sieve would not work?

18 posts / 0 new
Last post
#1 Wed, 09/11/2013 - 18:59

Any reason why sieve would not work?

I have installed Roundcube, and enabled managesieve plugin, and created a Filter to move all mail to a folder, but its not working

I have installed pidgeonhole using yum install dovecot-pigeonhole

I have configured dovecot and other config files 10 x as per instructions online, and many insturctions, they all the same thing. I am pretty sure my config files are all correct.

Postfix config has this added as per online instructions:- mailbox_command = /usr/libexec/dovecot/deliver -f $FROM_ENVELOPE -d $DEST_USERNAME

But sieve just does not work. No record of it in dovecot log, no sieve.log created.

Its driving me nuts, I just cant see how sieve is not being called when I followed all the instructions right.


Wed, 09/11/2013 - 19:11

At the bottom of /etc/postfix/ I can see:- mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d

So commented this out, but mail is not delivered at all now, I guess my mailbox_command above is wrong or some other issue.

I also read somewhere I can have spam checking after this, is that right?

Cant believe its so hard to get some decent filters! Installed roundcube and sieve because the Usermin filters are too basic.

Wed, 09/11/2013 - 22:25


Yeah, Virtualmin's mail stack makes use of procmail... you can change that, but it'll require a bit of configuration to do so. It also means you'd need to develop a solution to handle spam and virus processing, as those are all setup via procmail by default.

You can see the main procmail config in /etc/procmailrc.

It's possible to comment out the mailbox_command added by Virtualmin (the one using procmail-wrapper), and to use an alternate mailbox_command instead (such as the dovecot one you mentioned above).

I'm unfortunately not familiar with the specifics of making that work, but the logs should be able to help you there. If it's not working, take a peek at the logs and see what they show.

The email logs are located in either /var/log/maillog, or /var/log/mail.log. In reviewing those, look for where the messages are being delivered to. For example, using using procmail-wrapper, you'd see a line such as this:

delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

You'd want to make sure that it's showing it being delivered to your custom command instead of procmail-wrapper.


Thu, 09/12/2013 - 03:42

I thought the mailbox_command line in Postfix was all we need to deliver it to dovecot and sieve, and no need to change procmail. If thats the case my command must be wrong..

But anyway... I would like spam filtering. So maybe I should give up in sieve.

The problem is Usermin filters are not as good. i have posted another post here about Usermin filters: I have posted another thread on there to discuss Uesermin filters to see if I can continue to use Usermin and Procmail.

May I ask why sieve is not supported and procmail is used? From my research online it seems sieve is better, and the main bonus for users is there are plugins for Roundcube to create advanced filters beyond Usermin capabilities. I cannot find any procmail plugin for Roundcube, looks like we would be stuck with managing them in Usermin or edit the procmail file direct which is obviously not possible for all my users as they are not technical.


Thu, 09/12/2013 - 04:10

But anyway... I would like spam filtering. So maybe I should give up in sieve.

I'm about to install ASSP ( for spam filtering. Maybe that's an alternative for you too.

May I ask why sieve is not supported and procmail is used? From my research online it seems sieve is better ...

I would like to use sieve too so that's an important question for me too.

Thu, 09/12/2013 - 08:27


Sorry guys, email delivery using Dovecot and sieve isn't supported at this time... both Virtualmin and Usermin are very tied to procmail in the way they work.

It's not that you couldn't use sieve -- it's possible to do so -- but you'd lose access to some Virtualmin features, such as spam and virus scanning, as those are handled via procmail in a way that doesn't reliably work via sieve.

Regarding the mailbox_command -- it's one of the other. You can either have the mailbox_command set to use procmail, or you can set it to use sieve. I'm not aware of a way to use both. Though if you discover one, feel free to give that a try :-)


Thu, 09/12/2013 - 09:23

Sorry guys, email delivery using Dovecot and sieve isn't supported at this time...

Do you have any plans to support sieve?

... you'd lose access to some Virtualmin features, such as spam and virus scanning

Do we lose any more Virtualmin features besides spam and virus scanning? Because I'm going to use ASSP for spam and virus scanning, this wouldn't be a problem for me.

Thu, 09/12/2013 - 10:21

Well, nothing is off the table for the future, but we didn't have any immediate plans for sieve support.

Sieve not having support for running external programs would be a major issue; there's experimental plugins for making that work, but we wouldn't want to place something as important as email delivery in the hands of a tool considered experimental.

Outside of spam and virus scanning, I don't believe there's any other major features that you'd be missing out on, as of now.

Since Virtualmin expects procmail to be there though, we can't promise other things won't make use of procmail in the future, but there aren't currently any plans to do so.


Thu, 09/12/2013 - 11:48

Can you take a look at my other post? Because I dont mind using Procmail IF we can get some decent filter manager in Usermin or Roundcube. I just need some proper filtering done, using conditionals in the condition and multiple actions in action. Cant seem to do that in Usermin. So to be honest Procmail, with its lack of interface and features, is not very good! Maybe to the techies who edit the procmail files but we have non-techy users here who just want to create certain filters. So once we can get a reasonable interface or instruction I am likely to be OK with procmail.

Thu, 09/12/2013 - 12:43


I talked to Jamie about Usermin and advanced mail filtering -- he mentioned the following --

The Filter and Forward Mail module only presents a simplified version of procmail's capabilities, as full procmail is really complex. However, if they really want the full power of procmail, there is a module for this at Usermin -> Mail -> Procmail Mail Filter. This may not be granted to all mail users in a default Virtualmin install though, but can be configured in Webmin.

Thu, 09/12/2013 - 16:42

If I log into Usermin and go to Usermin -> Mail -> Filter and Forward mail, its the same interface as in Filters. It doesn't show any more settings.

What I am trying to do is have conditionals in the conditional section, so And and OR rules, and multiple actions in the action section, so mark as read then move to folder. I can't find any info on this.

It's why I wanted to use sieve, because the filters plugin for sieve in Roundcune does all this. It's as you'd expect. So using Filters in Usermin is inferior.


Thu, 09/12/2013 - 23:02

Did you enable the Procmail Mail Filter module? That should show up as a separate module within Usermin.

You can enable additional modules in Webmin -> Usermin Configuration -> Available Modules.


Fri, 09/13/2013 - 03:54

No I did not realise there was an extra module... so I now enabled this in Webmin -> Usermin Configuration -> Available Modules.

So this mew module does now allow me to add multiple conditions, but using the regular expression format you would in the procmail file and not a friendly form, but I guess they are AND conditions and not OR. Also, when I add multiple condition types, that rule then disappears from the normal Email Filters in Usermin, I assume because this cant handle multiple conditions.

So its still not ideal, but I can see that it would allow for more advanced rules for technical users.

If Email Filters is all we have in Usermin, and sieve is not supported (with spam checking) and Roundcude does not have a procmail add on like the sieve one, then I guess our only option is to live with the simpler filters that Usermin allws us to create even though we have a powerful procmail filter not being tapped into by the GUI. Shame! but I may be able to rethink my filters and still use Usermin.

For info, Gmail are recently blocking some emails from customers, I cant control it, they give little help on this subject. So I want to come back to Usermin and not use Gmail, but then the GMail filters are better. You can probably recreate Gmail filters in procmail but thats too technical, we need a friendly interface.

Perhaps something for the roadmap which is improve Usermin filters, to allow AND/OR operators for multiple conditions, and then multiple Actions.

Or allow sieve to work with spam, so we can use Roundmail filter plugins.


Fri, 09/13/2013 - 04:13

Oh, so this leads me to my other post here I would like to know more information on using the Usermin filters. For example, there must be a way to check if the To field contains multiple emails, e.g. if Header To contains OR but I cant find any help on this. Also regular expressions looks promising if I can find some help with it.


Wed, 10/07/2015 - 02:13

Hate to resurrect old threads, but I was just looking into the same thing and ran across a post dated before the OP's post (July 2013 for the post I found) that makes use of procmail and sieve so that we still get to take advantage of the Virtualmin defaults...

Post is found at:

It looks like it will work and I will be implementing it myself to see if it still works...

Wed, 10/07/2015 - 02:34 (Reply to #15)

Thanks for that link. I'm curious about your experiences.

Wed, 10/07/2015 - 20:27 (Reply to #16)

Works quite well, I can send you / post the instructions that I used with my troubleshooting hints if you like. I am going to check with Jamie and company to see if they feel like having the instructions posted permanently.

Wed, 10/07/2015 - 20:10 (Reply to #17)

Well, it has been fun. The instructions were mostly good, a little outdated. One big problem I ran into was when uncommenting the lines in /etc/dovecot/conf.d/20-managesieve.conf I did not catch the trailing bracket for the service managesieve-login section which resulted in plugin errors in other conf's.

I also had to additionally add sieve to the plugins line in /etc/dovecot/dovecot.conf in order to actually start the sieve plugin, now I can see dovecot listening on 4190 when I use netstat. My plugins line: plugins = imap sieve

Since I am using Thunderbird as my client, I grabbed the sieve plugin v0.2.2 at, but it would not connect. I ended up going to the addon home page and from there to the development builds at github ( where I grabbed 0.2.3h which attempted to connect but I am now getting "Server terminated unexpectedly the connection, click on recconect to try again."

Not too sure where to go from here. As far as I can tell, everything is running properly, dovecot is not generating any errors, and I see no connection attempts in mail.log, syslog, mail.err, procmail.log, auth.log, or thunderbirds error console.

Any ideas would be helpful if anybody can think of anything. It would be a most useful plugin if I can get it working.

[EDIT] I have found out that when I log into port 4190 with gnutls-cli, I get the following: "IMPLEMENTATION" "Dovecot (Ubuntu) Pigeonhole" "SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave" "NOTIFY" "mailto" "SASL" "" "STARTTLS" "VERSION" "1.0" OK "Dovecot (Ubuntu) ready." AUTHENTICATE "PLAIN" NO (ALERT) "Plaintext authentication disabled."

/etc/dovecot/dovecot.conf has the following setting: auth default { auth_mechanisms = plain login }

Thunderbird mail can log in to email accounts without problem, but the sieve side is obviously having problems.

[EDIT 2] I have found that I can log in from localhost successfully and managesieve reports: "SASL" "PLAIN LOGIN" but if I log in from any other host managesieve reports: "SASL" "" and the login fails with the "Plaintext authentication disabled". The good news is that everything else seems to be good although I have not tested an actual script other than to put it on the server from the telnet login.

[FINAL EDIT} Everything was solved once I opened the port in the firewall. Works flawlessly, setting up rules now through thunderbird!

Topic locked