[Dovecot] Dovecot Sieve Vacation Messages
I'm using a Postfix, Dovecot, MySQL setup with virtual domains. I have mail being delivered through Dovecot LDA working 100%. I'm trying to use sieve to handle vacation messages but dovecot is not reading the .dovecot.sieve file in the users maildir. I have a hunch it has to do with my dovecot-sql query but have had no success with what I found in the forums from Googling.
Any help would be greatly appreciated. I've included my configs below:
# 1.2.4: /etc/dovecot/dovecot.conf # OS: Linux 2.6.29-gentoo-r5 x86_64 Gentoo Base System release 1.12.11.1 ext3 protocols: imap imaps pop3 pop3s listen: *, [::] ssl_cert_file: /etc/ssl/dovecot/server.pem ssl_key_file: /etc/ssl/dovecot/server.key disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_user: postfix mail_privileged_group: vmail mail_location: maildir:/home/vmail/%d/%n/.maildir mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh lda: postmaster_address: postmaster@example.com mail_plugins: quota sieve auth default: mechanisms: plain login user: vmail 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: 384 user: vmail group: vmail plugin: quota: maildir sieve: /home/vmail/%d/%n/.dovecot.sieve
################################################## #dovecot-sql.conf
driver = mysql connect = host=localhost dbname=mail user=mailuser password=[password] default_pass_scheme = PLAIN-MD5 user_query = SELECT homedir AS home, sieve, CONCAT('*:storage=', quota) AS quota_rule FROM users WHERE username = '%u' password_query = SELECT crypt AS password, CONCAT('*:storage=', quota) AS userdb_quota_rule FROM users WHERE username = '%u'
On 09/19/2009 10:45 PM Steven Murphy wrote:
I'm using a Postfix, Dovecot, MySQL setup with virtual domains. I have mail being delivered through Dovecot LDA working 100%. I'm trying to use sieve to handle vacation messages but dovecot is not reading the .dovecot.sieve file in the users maildir. I have a hunch it has to do with my dovecot-sql query but have had no success with what I found in the forums from Googling.
The .dovecot.sieve script should be located in the users home directory, not in the Maildir.
Any help would be greatly appreciated. I've included my configs below:
Add 'mail_debug = yes' to the protocol lda {…} section and see what will be logged.
# 1.2.4: /etc/dovecot/dovecot.conf # OS: Linux 2.6.29-gentoo-r5 x86_64 Gentoo Base System release 1.12.11.1 ext3 protocols: imap imaps pop3 pop3s listen: *, [::] ssl_cert_file: /etc/ssl/dovecot/server.pem ssl_key_file: /etc/ssl/dovecot/server.key disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_user: postfix mail_privileged_group: vmail mail_location: maildir:/home/vmail/%d/%n/.maildir
Replaces this with: mail_location: maildir:~/.maildir Because your user_query seems to return a home.
- mail_debug = yes
auth default: mechanisms: plain login user: vmail 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: 384 user: vmail group: vmail plugin: quota: maildir sieve: /home/vmail/%d/%n/.dovecot.sieve
mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh lda: postmaster_address: postmaster@example.com mail_plugins: quota sieve
replace it with: sieve = ~/.dovecot.sieve
################################################## #dovecot-sql.conf
driver = mysql connect = host=localhost dbname=mail user=mailuser password=[password] default_pass_scheme = PLAIN-MD5 user_query = SELECT homedir AS home, sieve, CONCAT('*:storage=', quota) AS quota_rule FROM users WHERE username = '%u' password_query = SELECT crypt AS password, CONCAT('*:storage=', quota) AS userdb_quota_rule FROM users WHERE username = '%u'
Regards, Pascal
The trapper recommends today: decade.0926222@localdomain.org
I do have the dovecot.sieve in the users homedir.
Made the changes mentioned. Mail gets delivered OK but dovecot is not reading the sieve file. Rather dovecot.sievec is not being created.
Also no additional logging is happening with debug on.
Also the homdir sql lookup returns the following path: /home/vmail/$domain/$user
Just to provide as much info as possible, here is my Postfix master.conf entry for dovecot:
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${recipient}
On Sat, Sep 19, 2009 at 4:58 PM, Pascal Volk < user+dovecot@localhost.localdomain.orguser%2Bdovecot@localhost.localdomain.org
wrote:
On 09/19/2009 10:45 PM Steven Murphy wrote:
I'm using a Postfix, Dovecot, MySQL setup with virtual domains. I have mail being delivered through Dovecot LDA working 100%. I'm trying to use sieve to handle vacation messages but dovecot is not reading the .dovecot.sieve file in the users maildir. I have a hunch it has to do with my dovecot-sql query but have had no success with what I found in the forums from Googling.
The .dovecot.sieve script should be located in the users home directory, not in the Maildir.
Any help would be greatly appreciated. I've included my configs below:
Add 'mail_debug = yes' to the protocol lda {…} section and see what will be logged.
# 1.2.4: /etc/dovecot/dovecot.conf # OS: Linux 2.6.29-gentoo-r5 x86_64 Gentoo Base System release 1.12.11.1 ext3 protocols: imap imaps pop3 pop3s listen: *, [::] ssl_cert_file: /etc/ssl/dovecot/server.pem ssl_key_file: /etc/ssl/dovecot/server.key disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_user: postfix mail_privileged_group: vmail mail_location: maildir:/home/vmail/%d/%n/.maildir
Replaces this with: mail_location: maildir:~/.maildir Because your user_query seems to return a home.
- mail_debug = yes
auth default: mechanisms: plain login user: vmail 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: 384 user: vmail group: vmail plugin: quota: maildir sieve: /home/vmail/%d/%n/.dovecot.sieve
mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh lda: postmaster_address: postmaster@example.com mail_plugins: quota sieve
replace it with: sieve = ~/.dovecot.sieve
################################################## #dovecot-sql.conf
driver = mysql connect = host=localhost dbname=mail user=mailuser password=[password] default_pass_scheme = PLAIN-MD5 user_query = SELECT homedir AS home, sieve, CONCAT('*:storage=', quota) AS quota_rule FROM users WHERE username = '%u' password_query = SELECT crypt AS password, CONCAT('*:storage=', quota) AS userdb_quota_rule FROM users WHERE username = '%u'
Regards, Pascal
The trapper recommends today: decade.0926222@localdomain.org
Please stop top-posting.
On 09/19/2009 11:23 PM Steven Murphy wrote:
I do have the dovecot.sieve in the users homedir.
Rename it to .dovecot.sieve
Made the changes mentioned. Mail gets delivered OK but dovecot is not reading the sieve file. Rather dovecot.sievec is not being created.
The new Sieve implementation create files named: .dovecot.svbin
Also no additional logging is happening with debug on.
There should be something logged, similar to the following lines: Loading modules from directory: /usr/lib/dovecot/modules/lda Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so auth input: home=/path/to/users/home auth input: uid=1234 auth input: gid=5678 auth input: mail=maildir:~/.maildir maildir: data=~/.maildir maildir++: root=/path/to/users/home/.maildir, index=, control=, inbox=/path/to/users/home/.maildir sieve: local script path /path/to/users/home/.dovecot.sieve doesn't exist (using global script path in stead) sieve: user has no valid personal script sieve: no scripts to execute: reverting to default delivery.
Also the homdir sql lookup returns the following path: /home/vmail/$domain/$user OK
Just to provide as much info as possible, here is my Postfix master.conf entry for dovecot:
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${recipient}
Looks also fine.
if you could load the sieve plugin, write a minimal sieve script with this lines: require "fileinto"; fileinto "NonExistentBox";
Then deliver should log something like: failed to store into mailbox 'NonExistentBox': Mailbox doesn't exist: NonExistentBox
Regards, Pascal
The trapper recommends today: cafefeed.0926223@localdomain.org
There should be something logged, similar to the following lines: Loading modules from directory: /usr/lib/dovecot/modules/lda Module loaded: /usr/lib/dovecot/modules/lda/lib90_sieve_plugin.so auth input: home=/path/to/users/home auth input: uid=1234 auth input: gid=5678 auth input: mail=maildir:~/.maildir maildir: data=~/.maildir maildir++: root=/path/to/users/home/.maildir, index=, control=, inbox=/path/to/users/home/.maildir sieve: local script path /path/to/users/home/.dovecot.sieve doesn't exist (using global script path in stead) sieve: user has no valid personal script sieve: no scripts to execute: reverting to default delivery.
It is not loading the module, here is what I get:
ILoading modules from directory: /usr/lib64/dovecot/imap IModule loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so IModule loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so IEffective uid=65534, gid=65534, home=/tmp IQuota root: name= backend=maildir args=
On 09/20/2009 07:15 AM Steven Murphy wrote:
It is not loading the module, here is what I get:
ILoading modules from directory: /usr/lib64/dovecot/imap IModule loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so IModule loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so IEffective uid=65534, gid=65534, home=/tmp IQuota root: name= backend=maildir args=
Yes sure. imap is not using sieve. Check your logs after delivering mail trough Dovecots LDA deliver. Are you really using the transport dovecot: for your virtual users? Show: postconf virtual_transport Are there additional transport_maps configured in your main.cf?
Does sour USE flags contain managesieve or at least sieve?
Regards, Pascal
The trapper recommends today: cafefeed.0926307@localdomain.org
participants (2)
-
Pascal Volk
-
Steven Murphy