2

I want to use managesieve in my dovecot server which uses virtual users and a ldap for the users. This is in my dovecot.conf:

 plugin {
 sieve_dir=/var/mail/sievescript/%u_scripts
 sieve_extensions = +imapflags
 }
 protocol managesieve {
 login_executable = /usr/lib/dovecot/managesieve-login

 mail_executable = /usr/lib/dovecot/managesieve

 managesieve_max_line_length = 65536

 managesieve_logout_format = bytes=%i/%o

 listen = *:2000
 }

If I try to talk to managesieve with telnet this happens:

 Trying ::1...
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 "IMPLEMENTATION" "dovecot"
 "SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-    i;ascii-numeric relational regex imap4flags copy include variables body enotify environment    mailbox date imapflags"
 "SASL" "PLAIN LOGIN"
 "STARTTLS"
 "NOTIFY" "mailto"
 "VERSION" "1.0"
 OK "Dovecot ready."
 AUTHENTICATE "PLAIN" "xxxxxxxxxxxxx"

 BYE "Internal error occured. Refer to server log for more information. [2011-10-02 00:48:09]"
 Connection closed by foreign host.

The Dovecot Log says:

 2011-10-02 00:48:09 MANAGESIEVE(user): Fatal: Failed to create sieve storage with data: /var/mail/sievescript/user_scripts

The sievescirpt folder is owned by dovecot:dovecot. Can someone help please?

Thank you.

plaetzchen
  • 173
  • 1
  • 3
  • 9

2 Answers2

1

If you ask yourself what this was: It was a wrong path in the configuration, because I used %u but I should used %m

plaetzchen
  • 173
  • 1
  • 3
  • 9
0

Dovecot doesn't access mail or sieve scripts as the dovecot user which is explained in the VirtualUsers documentation so most likely you need to figure out what UserID Dovecot is using for that virtual user as assigned from your user database.

AFresh1
  • 166
  • 3
  • I already tried to set the folder to 777 (which didn't help) and I used stat /var/mail/sievescript/ to find it out and it says dovecot was the user who was the last one using this folder. – plaetzchen Oct 02 '11 at 01:19
  • Then I am not sure, because it shouldn't be running as dovecot, but I don't know your userdatabase configuration so it is hard to say. With the directory set to 777 obviously it shouldn't be a permissions issue. Is there anything different in the log when the permissions are set 777? Perhaps it disallows writing to an other writable directory? – AFresh1 Oct 02 '11 at 03:01
  • Noe its the exactly same error message if an error occured (Yes with that typo ;) ) – plaetzchen Oct 02 '11 at 08:17
  • Running as the UID your userdatabase sets for the virtual user are you able to `mkdir /var/mail/sievescript/user_scripts` successfully? – AFresh1 Oct 02 '11 at 19:57
  • Yes I can make the directory but even when I create the directory manually I get an error and managesieve kicks me. This is the last debug line: `2011-10-03 13:49:31 MANAGESIEVE(user): Info: Effective uid=5000, gid=5000, home=(none)` – plaetzchen Oct 03 '11 at 11:48
  • @plaetzchen Maybe try `chgrp 5000 /var/mail/sievescript/` and set the permissions to 775? What UID is your dovecot user? My next suggestion though is to ask on the [Dovecot mailing list](http://dovecot.org/mailinglists.html) – AFresh1 Oct 03 '11 at 15:04
  • The Permissions are 777 right now so it doesn't seem to be a permissions issue, I'll ask there. Thanks. – plaetzchen Oct 04 '11 at 10:32
  • My permissions thought is still that there may be something in Dovecot that doesn't allow you to use a directory that is other writable. I think you will get a definitive answer from the list though. – AFresh1 Oct 04 '11 at 17:57
  • Unfortunately that didn't help. – plaetzchen Oct 04 '11 at 22:11
  • Then I await your thread on the dovecot mailing list. – AFresh1 Oct 04 '11 at 22:31