[Dovecot] symlink() failure in 1.2 managesieve

Bruce A. Mallett bam at NightStorm.com
Tue Dec 2 15:03:30 EET 2008


I've been simultaneously learning about dovecot and experimenting with
the 1.2.alpha4.  To start I built an rpm under CentOS 5.2 from:
  dovecot-1.2.alpha4.tar.gz
  dovecot-1.2-managesieve-0.11.2.tar.gz
  dovecot-1.2.alpha4-managesieve-0.11.2.diff.gz
  dovecot-1.2.alpha4.tar.gz
  dovecot-1.2-sieve-0.1.2.tar.gz

and then setup with mysql to use virtual users.  Mail-wise, it all
works.  :)

Where I'm having trouble is with the managesieve part.  I find that when
I activate a sieve script I get a symlink() failure message in
/var/log/maillog similar to this:

Dec  2 05:12:47 hostname dovecot: MANAGESIEVE(account at hostname.com):
sieve-storage: Creating symlink() hostname.com/account//.dovecot.sieve
to /usr/local/virtual/hostname.com/account/sieve/Test.sieve failed: No
such file or directory

I began to chase this first by inserting i_info() calls into various
points of the managesieve build and later by attaching to the process
with gdb.  I can see that in sieve_storage_script_activate() the
storage->active_path member is incomplete (i.e., is not a full, absolute
path name) and the cwd is "/tmp", thus the symlink() call fails.

Based on what I've been reading in the documentation, shouldn't the
system have resolved the "home" area for the mail to be the same as what
is determined for the virtual user mail area?  Using the README in the
alpha4 package I've found that I can get it to work by adding the
following after the "protocol manageseive {}" section:

plugin {
  sieve=/usr/local/virtual/%d/%n/.dovecot.sieve
  sieve_storage=/usr/local/virtual/%d/%n/sieve
}


While that helps, I'm a little confused as to why I need to do this.   I
believe that the documentation states that the sieve defaults to
.dovecot.sieve under the MAIL_LOCATION directory.  So it is not clear to
me if I am doing something wrong, if there is an oversight in the
software and/or documentation (or perhaps my reading of it), or is it
really necessary to specify the same information multiple times?


          - Bruce


Here is some output that may be of use:

-bash-3.2# dovecot -n
# 1.2.alpha4: /etc/dovecot.conf
# OS: Linux 2.6.18-8.1.8.el5xen x86_64 CentOS release 5.2 (Final) ext3
info_log_path: /var/log/dovecot.log
protocols: imap imaps pop3 pop3s managesieve
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_executable(managesieve): /usr/libexec/dovecot/managesieve-login
max_mail_processes: 100
first_valid_uid: 150
last_valid_uid: 150
mail_location: maildir:/usr/local/virtual/%d/%n
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_executable(managesieve): /usr/libexec/dovecot/managesieve
mail_plugin_dir(default): /usr/lib64/dovecot/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
mail_plugin_dir(managesieve): /usr/lib64/dovecot/managesieve
auth default:
  mechanisms: plain digest-md5
  debug: yes
  debug_passwords: yes
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-mysql.conf
plugin:
  sieve: /usr/local/virtual/%d/%n/.dovecot.sieve
  sieve_storage: /usr/local/virtual/%d/%n/sieve
-----


-bash-3.2# grep -v '^ *\(#.*\)\?$' /etc/dovecot/dovecot-mysql.conf
driver = mysql
connect = host=/var/lib/mysql/mysql.sock dbname=postfix user=postfix
password=postfix
default_pass_scheme = MD5-CRYPT
user_query = \
  SELECT maildir as home, 150 AS uid, 12 AS gid FROM mailbox WHERE
username = '%u'
password_query = select password from mailbox where username='%u'





More information about the dovecot mailing list