[Dovecot] Sieve and ACL problem
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I've come across a problem that I can't figure out. I'm using Dovecot 1.2.6 and Sieve 0.1.13.
I'm using the following sieve script to sort my incoming mail.
require ["fileinto", "envelope"];
if envelope :all :is "from" "sopprde@newport.th.gov.bc.ca" { fileinto "Public/Weather"; } elsif envelope :all :is "from" "apache@ldmltd.ca" { fileinto "hwcr"; } elsif envelope :all :is "from" "weatherdirect@pelmorex.ca" { fileinto "Public/Weather"; } elsif envelope :all :is "from" "Drive.BC@gems2.gov.bc.ca" { fileinto "Public/Weather"; } elsif header :contains "List-Id" "Dovecot Mailing List" { fileinto "Dovecot"; } else { keep; }
It works for saving to my private email folders, but I get a permission denied error when trying to save to a public folder.
maillog - showing error
Nov 12 12:26:57 app postfix/qmgr[19314]: B36E77800088: from=weatherdirect@pelmorex.ca, size=35572, nrcpt=1 (queue active) Nov 12 12:26:57 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: msgid=3708845-2200911412202651769@pelmorex.ca: failed to store into mailbox 'Public/Weather': Permission denied Nov 12 12:26:57 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: msgid=3708845-2200911412202651769@pelmorex.ca: stored mail into mailbox 'INBOX' Nov 12 12:26:57 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: execution of script /srv/dovecot/gfinch/.dovecot.sieve failed, but implicit keep was successful Nov 12 12:26:57 app postfix/pipe[15363]: B36E77800088: to=gfinch@app.ldmltd.ca, relay=dovecot, delay=0.66, delays=0.62/0/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service) Nov 12 12:26:57 app postfix/qmgr[19314]: B36E77800088: removed Nov 12 12:26:57 app postfix/smtpd[15365]: disconnect from mail127c0.megamailservers.com[69.49.121.237]
maillog - showing working
Nov 12 09:44:42 app postfix/smtpd[13094]: connect from dovecot.org[82.118.211.50] Nov 12 09:44:42 app postfix/smtpd[13094]: E08BC7800085: client=dovecot.org[82.118.211.50] Nov 12 09:44:43 app postfix/cleanup[13097]: E08BC7800085: message-id=1258047854.3022.401.camel@timo-desktop Nov 12 09:44:43 app postfix/qmgr[19314]: E08BC7800085: from=dovecot-bounces+gfinch=app.ldmltd.ca@dovecot.org, size=2518, nrcpt=1 (queue active) Nov 12 09:44:43 app postfix/smtpd[13094]: disconnect from dovecot.org[82.118.211.50] Nov 12 09:44:43 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: msgid=1258047854.3022.401.camel@timo-desktop: stored mail into mailbox 'Dovecot' Nov 12 09:44:43 app postfix/pipe[13099]: E08BC7800085: to=gfinch@app.ldmltd.ca, relay=dovecot, delay=0.32, delays=0.27/0.01/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service) Nov 12 09:44:43 app postfix/qmgr[19314]: E08BC7800085: removed
As for the permissions, I can save messages to the public folder with no problems from my email client over IMAP, so I'm assuming the acl file is correct.
dovecot-acl for Public/Weather authenticated lrs user=gfinch lrwstipekxa
# 1.2.6: /etc/dovecot/dovecot.conf # OS: Linux 2.6.23.1-smp-LDM i686 Slackware 12.0.0 base_dir: /var/run/dovecot/ protocols: imap imaps managesieve ssl_ca_file: /etc/dovecot/ca.pem ssl_cert_file: /etc/dovecot/dovecot1.crt ssl_key_file: /etc/dovecot/dovecot1.key login_dir: /var/run/dovecot//login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(managesieve): /usr/local/libexec/dovecot/managesieve-login verbose_proctitle: yes first_valid_gid: 500 mail_uid: 500 mail_gid: 500 mail_location: maildir:~/Maildir:LAYOUT=fs fsync_disable: yes mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(managesieve): /usr/local/libexec/dovecot/managesieve mail_plugins(default): acl imap_acl mail_plugins(imap): acl imap_acl mail_plugins(managesieve): mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(managesieve): /usr/local/lib/dovecot/managesieve imap_idle_notify_interval(default): 1200 imap_idle_notify_interval(imap): 1200 imap_idle_notify_interval(managesieve): 120 namespace: type: private inbox: yes list: yes subscriptions: yes namespace: type: shared separator: / prefix: Shared/%%u/ location: maildir:%%h/Maildir:LAYOUT=fs:INDEX=~/shared/%%u list: children namespace: type: public separator: / prefix: Public/ location: maildir:/srv/dovecot/public:LAYOUT=fs:INDEX=~/public list: children lda: postmaster_address: postmaster@ldmltd.ca mail_plugins: acl sieve fsync_disable: no auth default: mechanisms: plain login digest-md5 cram-md5 passdb: driver: passwd-file args: username_format=%Ln /etc/dovecot/passwd userdb: driver: static args: uid=500 gid=500 home=/srv/dovecot/%Ln 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 plugin: acl: vfile:/etc/dovecot/acls:cache_secs=300 acl_shared_dict: file:/etc/dovecot/shared/mailboxes sieve: ~/.dovecot.sieve sieve_dir: ~/sieve
I don't know what I missed in the config, as everything else works perfectly.
Thank you,
- -Greg
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkr8jEwACgkQeflWWP27iA+UQgCgni3jztUw6PRCH9Z1tljVbv09 dQ8AnjBx+cYEmSfiZzTItbR/ZsmGcQQi =WzVp -----END PGP SIGNATURE-----
On Thu, 2009-11-12 at 14:29 -0800, Gregory Finch wrote:
Nov 12 12:26:57 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: msgid=3708845-2200911412202651769@pelmorex.ca: failed to store into mailbox 'Public/Weather': Permission denied .. dovecot-acl for Public/Weather authenticated lrs user=gfinch lrwstipekxa
deliver sees username as gfinch@app.ldmltd.ca, not gfinch. Maybe change deliver to be called as:
deliver -d gfinch -a gfinch@app.ldmltd.ca
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Timo Sirainen wrote:
On Thu, 2009-11-12 at 14:29 -0800, Gregory Finch wrote:
Nov 12 12:26:57 app dovecot: deliver(gfinch@app.ldmltd.ca): sieve: msgid=3708845-2200911412202651769@pelmorex.ca: failed to store into mailbox 'Public/Weather': Permission denied .. dovecot-acl for Public/Weather authenticated lrs user=gfinch lrwstipekxa
deliver sees username as gfinch@app.ldmltd.ca, not gfinch. Maybe change deliver to be called as:
deliver -d gfinch -a gfinch@app.ldmltd.ca
That solved my problem entirely.. changing the dovecot line in my postfix/master.cf from "-d ${recipient}" to the following makes everything work as expected, including using the right acl files when using sieve to redirect to a public folder:
dovecot unix - n n - - pipe flags=DR user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${user} -a ${recipient} -n -m ${extension}
Thank you,
- -Greg -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkr8oKYACgkQeflWWP27iA/ZHQCg1ozpUBBn0mbNetBsjv5aUjvG eX8AnRRfrg+bIS6ddcyNMbLJee92Whg1 =Rjk/ -----END PGP SIGNATURE-----
participants (2)
-
Gregory Finch
-
Timo Sirainen