[Dovecot] dovecot-sieve and LMT
Dear list,
My mail server is working perfectly. So I am trying to add feature after feature, until I have all the features I need. This has worked fine until now. I am trying to get dovecot-sieve to work. So I activated dovecot-lda and the sieve plugin and told postfix to use deliver instead of procmail. After restarting all services I then created a test sieve file. Obviously I have not yet understood the whole process completely because, it simply does not work.
I suspect some permission problems or misconfiguration of the sieve file, but I am not sure where to look for solutions.
-rw-r--r-- 1 2001 2001 116 2012-06-16 21:25 /var/mail/vmail/domain.com/user/dovecot.sieve
dovecot.sieve require "fileinto"; if header :contains ["subject"] ["Test"] { fileinto ".Folder1"; } else { fileinto ".Folder2"; }
Of course Folder1 and Folder2 do exist. (/var/mail/vmail/domain.com/user/mail/.Folder1 and Folder2)
As far as I can tell there are no errors reported anywhere, I checked mail.log and syslog. 2001 is the virtual uid/gid of this particular user.
If anyone can help me with this it would be great. The Mailserver works very well apart from this.
There was one odd thing apart from this. In the docs I read that auth-master has to be running for deliver to work correctly. I did not know this before, but mails were delivered correctly after I started using deliver. So is there a need for auth-master to be running or not?
Thanks a lot Martin
dovecot -n output: # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.18-028stab091.2 i686 Ubuntu 10.04.4 LTS reiserfs log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap imaps lda ssl: required ssl_cert_file: /home/mweil/CA/cert.pem ssl_key_file: /home/mweil/CA/key.pem login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_max_userip_connections: 25 mail_privileged_group: mail mail_uid: 10000 mail_gid: 10000 mail_location: maildir:/var/mail/vmail/%d/%n/mail mbox_write_locks: fcntl dotlock lda: postmaster_address: postmaster@domain.com mail_plugins: sieve mail_plugin_dir: /usr/lib/dovecot/modules/lda auth default: user: nobody passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: prefetch userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 432 plugin: sieve: /var/mail/vmail/%d/%u/dovecot.sieve
postconf -n: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_interfaces = all mailbox_command = /usr/lib/dovecot/deliver mailbox_size_limit = 0 message_size_limit = 102400000 mydestination = host.domain.net, localhost, mydomain = domain.com myhostname = host.domain.com mynetworks = 127.0.0.1 myorigin = $mydomain readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_client_restrictions = smtpd_error_sleep_time = 1s smtpd_hard_error_limit = 20 smtpd_helo_restrictions = smtpd_recipient_restrictions = permit_mynetworks reject_sender_login_mismatch permit_sasl_authenticated reject_unauth_destination reject_unverified_recipient smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_sender_login_maps = pgsql:/etc/postfix/lookup/pgsql_sasl_senders.cf smtpd_sender_restrictions = smtpd_soft_error_limit = 10 smtpd_tls_auth_only = yes smtpd_tls_cert_file = /home/mweil/CA/cert.pem smtpd_tls_key_file = /home/mweil/CA/key.pem smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = pgsql:/etc/postfix/lookup/pgsql_virtual_alias.cf virtual_gid_maps = pgsql:/etc/postfix/lookup/pgsql_virtual_gid.cf virtual_mailbox_base = /var/mail/vmail/ virtual_mailbox_domains = domain.com virtual_mailbox_limit = 0 virtual_mailbox_maps = pgsql:/etc/postfix/lookup/pgsql_virtual_accounts.cf virtual_uid_maps = pgsql:/etc/postfix/lookup/pgsql_virtual_uid.cf
On 06/18/2012 07:44 PM, Martin Weil wrote:
require "fileinto"; if header :contains ["subject"] ["Test"] { fileinto ".Folder1"; } else { fileinto ".Folder2"; }
Of course Folder1 and Folder2 do exist. (/var/mail/vmail/domain.com/user/mail/.Folder1 and Folder2)
Don't add a dot on the beggining of the folder name in sieve scripts. Use fileinto :create "folder" or lda_mailbox_autocreate option to create non-existing folders. -- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net] --------------------------------------------------- PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
Hi. Thanks for your hints, I altered the file but sadly, there is no change in behavior. It's like sieve is not doing anything at all. if header :contains ["subject"] ["Test"] { fileinto :create "Folder1"; } else { fileinto :create "Folder2"; } The lda_mailbox_autocreate option seems to be a version 2.0 feature. I am using 1.2.9. Thanks Martin Am 19.06.2012 um 09:51 schrieb A.L.E.C:
On 06/18/2012 07:44 PM, Martin Weil wrote:
require "fileinto"; if header :contains ["subject"] ["Test"] { fileinto ".Folder1"; } else { fileinto ".Folder2"; }
Of course Folder1 and Folder2 do exist. (/var/mail/vmail/domain.com/user/mail/.Folder1 and Folder2)
Don't add a dot on the beggining of the folder name in sieve scripts. Use fileinto :create "folder" or lda_mailbox_autocreate option to create non-existing folders.
-- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net] --------------------------------------------------- PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
Op 6/19/2012 10:17 AM, Martin Weil schreef:
Hi.
Thanks for your hints, I altered the file but sadly, there is no change in behavior. It's like sieve is not doing anything at all.
if header :contains ["subject"] ["Test"] { fileinto :create "Folder1"; } else { fileinto :create "Folder2"; }
The lda_mailbox_autocreate option seems to be a version 2.0 feature. I am using 1.2.9.
Do your logs mention anything about LDA and Sieve being invoked? This wiki page shows a few hints on what this should look like and steps to be taken when LDA and Sieve are not being invoked:
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
Regards,
Stephan.
Am 19.06.2012 um 10:29 schrieb Stephan Bosch:
Op 6/19/2012 10:17 AM, Martin Weil schreef:
Hi.
Thanks for your hints, I altered the file but sadly, there is no change in behavior. It's like sieve is not doing anything at all.
if header :contains ["subject"] ["Test"] { fileinto :create "Folder1"; } else { fileinto :create "Folder2"; }
The lda_mailbox_autocreate option seems to be a version 2.0 feature. I am using 1.2.9.
Do your logs mention anything about LDA and Sieve being invoked? This wiki page shows a few hints on what this should look like and steps to be taken when LDA and Sieve are not being invoked:
http://wiki2.dovecot.org/Pigeonhole/Sieve/Troubleshooting
Regards,
Stephan.
Indeed they did not. I incorrectly thought that a line in postfix's main.cf would change the delivery to deliver. That would have been true if I used local delivery. For virtual users postfix is using "virtual" by default. So I had to add deliver to postfix's master.cf and change the virtual_transport in main.cf.
After configuring logging for deliver I can now confirm that it is used. I was mistaken by thinking local delivery is the same as virtual delivery. I could have avoided this by reading the wiki more carefully. Sorry about that.
But I am afraid sieve is still not working. Mails are still delivered to INBOX.
Martin
Op 6/19/2012 11:20 AM, Martin Weil schreef:
Indeed they did not. I incorrectly thought that a line in postfix's main.cf would change the delivery to deliver. That would have been true if I used local delivery. For virtual users postfix is using "virtual" by default. So I had to add deliver to postfix's master.cf and change the virtual_transport in main.cf.
After configuring logging for deliver I can now confirm that it is used. I was mistaken by thinking local delivery is the same as virtual delivery. I could have avoided this by reading the wiki more carefully. Sorry about that.
But I am afraid sieve is still not working. Mails are still delivered to INBOX.
Do the logs say anything about Sieve? You can enable mail_debug in your configuration to obtain more verbose log messages about what Sieve is doing.
Regards,
Stephan.
Am 19.06.2012 um 12:44 schrieb Stephan Bosch:
Op 6/19/2012 11:20 AM, Martin Weil schreef:
Indeed they did not. I incorrectly thought that a line in postfix's main.cf would change the delivery to deliver. That would have been true if I used local delivery. For virtual users postfix is using "virtual" by default. So I had to add deliver to postfix's master.cf and change the virtual_transport in main.cf.
After configuring logging for deliver I can now confirm that it is used. I was mistaken by thinking local delivery is the same as virtual delivery. I could have avoided this by reading the wiki more carefully. Sorry about that.
But I am afraid sieve is still not working. Mails are still delivered to INBOX.
Do the logs say anything about Sieve? You can enable mail_debug in your configuration to obtain more verbose log messages about what Sieve is doing.
Regards,
Stephan.
Thanks a lot for this tip. It turned out I used the %u variable instead of %n in the path of the sieve script, so sieve was looking in a non existing directory. After correcting sieve complained about the :create statement. But after I removed it, it worked flawlessly.
Thanks a lot again. Martin
Op 6/19/2012 3:13 PM, Martin Weil schreef:
Am 19.06.2012 um 12:44 schrieb Stephan Bosch:
Op 6/19/2012 11:20 AM, Martin Weil schreef:
Indeed they did not. I incorrectly thought that a line in postfix's main.cf would change the delivery to deliver. That would have been true if I used local delivery. For virtual users postfix is using "virtual" by default. So I had to add deliver to postfix's master.cf and change the virtual_transport in main.cf.
After configuring logging for deliver I can now confirm that it is used. I was mistaken by thinking local delivery is the same as virtual delivery. I could have avoided this by reading the wiki more carefully. Sorry about that.
But I am afraid sieve is still not working. Mails are still delivered to INBOX. Do the logs say anything about Sieve? You can enable mail_debug in your configuration to obtain more verbose log messages about what Sieve is doing.
Regards,
Stephan.
Thanks a lot for this tip. It turned out I used the %u variable instead of %n in the path of the sieve script, so sieve was looking in a non existing directory. After correcting sieve complained about the :create statement. But after I removed it, it worked flawlessly.
The :create tag doesn't work unless the mailbox extension is active; you need to add the following to the top of your Sieve script to use it:
require "mailbox";
Regards,
Stephan.
participants (3)
-
A.L.E.C
-
Martin Weil
-
Stephan Bosch