[Dovecot] mail_uid and mail_gid are not set in environment (for expire-tool and so)
Hello,
I've just subscribed to the list, as a recent user of Dovecot (1.2.4 by now).
I eventually missed a point, so I tried to find other doc or comments about my issue, but failed to. If the following has already been discussed, please simply reply with a URL to the corresponding thread or doc ;-)
Now that I have covered my ass, here is the problem I meet.
In dovecot.conf, I have the following: mail_uid = vmail mail_guid = vmail which is confirmed with 'dovecot -n'
I have a script my-expire-tool-test containing: #!/bin/sh set which basically only display environment variables.
When I run : /usr/sbin/dovecot --exec-mail ext my-expire-tool-test I do not see any variable MAIL_UID nor MAIL_GID. As a consquence, when I run /usr/sbin/dovecot --exec-mail ext my-expire-tool with my-expire-tool containing: #!/bin/sh
# This script is a workaround for Dovecot 1.2 having issue to load modules when running expire-tool. # More information: http://wiki.dovecot.org/Plugins/Expire, search Dovecot v1.2
MAIL_PLUGINS=${MAIL_PLUGINS//antispam/} MAIL_PLUGINS=${MAIL_PLUGINS//imap_acl/} MAIL_PLUGINS=${MAIL_PLUGINS//imap_quota/} MAIL_PLUGINS=${MAIL_PLUGINS//mail_log/}
exec /usr/lib/dovecot/expire-tool "$@"
It politely tells me: Error: userdb(user@domain) didn't return uid and mail_uid not set
Actually, this is this message error that lead me to check the environment variables. Then I also checked the source code, and run: grep -r env_put . | grep -i mail_
No trace of mail_uid nor mail_gid. Did I find a bug or did I miss a point ?
Regards,
-- Baptiste MALGUY - http://www.malguy.net PGP fingerprint: 49B0 4F6E 4AA8 B149 B2DF 9267 0F65 6C1C C473 6EC2
On 09/03/2009 12:35 PM Baptiste Malguy wrote:
Hello,
I've just subscribed to the list, as a recent user of Dovecot (1.2.4 by now).
I eventually missed a point, so I tried to find other doc or comments about my issue, but failed to. If the following has already been discussed, please simply reply with a URL to the corresponding thread or doc ;-)
Now that I have covered my ass, here is the problem I meet.
In dovecot.conf, I have the following: mail_uid = vmail mail_guid = vmail which is confirmed with 'dovecot -n'
I have a script my-expire-tool-test containing: #!/bin/sh set which basically only display environment variables.
When I run : /usr/sbin/dovecot --exec-mail ext my-expire-tool-test I do not see any variable MAIL_UID nor MAIL_GID. As a consquence, when I run /usr/sbin/dovecot --exec-mail ext my-expire-tool with my-expire-tool containing: #!/bin/sh
# This script is a workaround for Dovecot 1.2 having issue to load modules when running expire-tool. # More information: http://wiki.dovecot.org/Plugins/Expire, search Dovecot v1.2
MAIL_PLUGINS=${MAIL_PLUGINS//antispam/} MAIL_PLUGINS=${MAIL_PLUGINS//imap_acl/} MAIL_PLUGINS=${MAIL_PLUGINS//imap_quota/} MAIL_PLUGINS=${MAIL_PLUGINS//mail_log/}
exec /usr/lib/dovecot/expire-tool "$@"
It politely tells me: Error: userdb(user@domain) didn't return uid and mail_uid not set
Actually, this is this message error that lead me to check the environment variables. Then I also checked the source code, and run: grep -r env_put . | grep -i mail_
No trace of mail_uid nor mail_gid. Did I find a bug or did I miss a point ?
Hi,
sorry I'm not absolutely sure, but I believe http://wiki.dovecot.org/UserDatabase/Static may help you.
Regards, Pascal
The trapper recommends today: deadbeef.0924612@localdomain.org
I haven't been into details about my userdb. It's a LDAP backend.
Before mail_uid and mail_gid parameters arrive, I'd have to play the trick with the value returned by the LDAP backend, adding some uid/gid values. Now, with these new configuration parameters, I understand I'm not supposed to workaround this way, but use mail_uid and mail_gid.
By the way, in the meantime, I've added : export MAIL_UID=vmail export MAIL_GID=vmail in my my-expire-tool script, waiting for a nicer solution.
Regards,
-- Baptiste MALGUY - http://www.malguy.net PGP fingerprint: 49B0 4F6E 4AA8 B149 B2DF 9267 0F65 6C1C C473 6EC2
This should fix it: http://hg.dovecot.org/dovecot-1.2/rev/eb22a456a625
participants (3)
-
Baptiste Malguy
-
Pascal Volk
-
Timo Sirainen