[Dovecot] sieve not working with Postfix and maildir

Florin Andrei florin.andrei at gmail.com
Mon Aug 3 23:44:46 EEST 2009


I am moving away from Cyrus, I'm trying to migrate to Dovecot.

I am trying to get Sieve working with Dovecot and Postfix and it just
won't work.
Postfix is able to delived new messages to the "new" subfolder of the
inbox structure. After I run Thunderbird, the new message gets moved
to "cur" and it shows up in my inbox. So far so good.
But now I'm trying to add Sieve. I turned on managesieve, installed
Avelsieve in Squirrelmail, and did some tests. No matter what, the
message stays in the inbox, it does not move to the designated folder:
Postfix throws it in "new", it gets moved to "cur" after accessing my
email with Thunderbird, and that's it.

Detailed report:

###########################
$ dovecot -n
# 1.1.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.28-11-server x86_64 Ubuntu 9.04
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps managesieve
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
mail_privileged_group: mail
mail_location: maildir:~/Maildir
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
sieve_storage(default):
sieve_storage(imap):
sieve_storage(managesieve): ~/sieve
sieve(default):
sieve(imap):
sieve(managesieve): ~/.dovecot.sieve
auth default:
  passdb:
    driver: pam
  userdb:
    driver: passwd
###########################

Postfix is configured to deliver to Maildir:

home_mailbox = Maildir/

I am testing the delivery:

########################
$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 andrei.myip.org ESMTP Postfix (Ubuntu)
helo joblo
250 andrei.myip.org
mail from: joe at blow.com
250 2.1.0 Ok
rcpt to: florin at andrei.myip.org
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
testing
.
250 2.0.0 Ok: queued as 512FE480C8
########################

And the message is delivered:

$ ls ~/Maildir/new/
1249331187.V801Ia16012M874274.weiqi

I fire up Thunderbird, look in the inbox, and the message is there -
and it gets moved from "new" to "cur" after Thunderbird connects to
the server:

$ ls ~/Maildir/cur/1249331187.V801Ia16012M874274.weiqi*
/home/XXXX/Maildir/cur/1249331187.V801Ia16012M874274.weiqi:2,S

Okay, now I go to Squirrelmail / Avelsieve and make a rule for this
>From address:

#################################
$ ls -l sieve/
total 8
-rw------- 1 XXXX XXXX 1050 2009-08-03 13:30 phpscript.sieve
drwx------ 2 XXXX XXXX 4096 2009-08-03 13:30 tmp
florin at weiqi:~$ ls -l .dovecot.sieve
lrwxrwxrwx 1 XXXX XXXX 21 2009-08-03 13:30 .dovecot.sieve ->
sieve/phpscript.sieve
$ cat .dovecot.sieve
# I removed some commented out lines, they were too many
require ["fileinto","envelope","reject","vacation","imapflags","relational","comparator-i;ascii-numeric","regex","notify","body"];
if address :contains "From" "joe at blow.com"
{
fileinto  "personal.joeblow";
stop;
}
#################################

I do the telnet thing again, fire up Thunderbird, but this new message
is still in the Inbox (it's in the "new" subfolder before running
Thunderbird, then it gets moved to "cur") instead of the designated
folder.

Am I missing something? What is the magic I need to do to get it to
move? I googled, but nothing came up.

With Cyrus and Postfix, the filters worked like a charm, no problems
at all, but it had its own issues (too complicated to manage for a
small site). Dovecot seems more reasonable, but I can't get Sieve to
work. :-(

-- 
Florin Andrei

http://florin.myip.org/


More information about the dovecot mailing list