[Dovecot] Dovecot LDA, virtual users, multiple uids: No luck
Hi,
I'm trying to get Dovecot's deliver to create and use mailboxen with one uid per user. Reading the wiki, I decided to go with the sudo attempt, but I'm stuck because deliver fails to create the intermediate directories. The auth.log has this on the matter:
sudo: dovelda : TTY=unknown ; PWD=/var/spool/postfix ; USER=root ; COMMAND=/usr/lib/dovecot/deliver -f toni@bogus.oeko.net -d dick@example.com
Using strace on 'deliver', I get this:
# su - dovelda $ echo "blubber" |sudo strace /usr/lib/dovecot/deliver -f toni@bogus.oeko.net -d dick@example.com ... geteuid() = 0 getgid() = 0 setgid(2000) = 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ setgroups(1, [2000]) = 0 setuid(2100) = 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ setuid(0) = -1 EPERM (Operation not permitted) getgid() = 2000 getegid() = 2000 setgid(0) = -1 EPERM (Operation not permitted) close(6) = 0 geteuid() = 2100 geteuid() = 2100
and subsequently, creating the directories fails.
The values in the underlined lines above, 2100 and 2000, are from the database entry of the user I want to deliver the email to.
My /etc/sudoers has this for dovelda:
dovelda ALL=NOPASSWD:/usr/lib/dovecot/deliver dovelda ALL=NOPASSWD:/usr/bin/strace
I'm using a Debian/Lenny system with amd64 and this package for Dovecot:
# dpkg -l 'dovecot*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii dovecot-common 1:1.2.13-1~bpo secure mail server that supports mbox and ma ii dovecot-imapd 1:1.2.13-1~bpo secure IMAP server that supports mbox and ma
Kind regards, --Toni++
On Sat, 2010-09-18 at 19:59 +0200, Toni Mueller wrote:
I'm trying to get Dovecot's deliver to create and use mailboxen with one uid per user. Reading the wiki, I decided to go with the sudo attempt, but I'm stuck because deliver fails to create the intermediate directories.
Yeah, that's not even supposed to work. You need to figure out some other way to create the directories. Like maybe execute a script that first does mkdir and then calls deliver.
Hi,
On Mon, 20.09.2010 at 15:19:54 +0100, Timo Sirainen tss@iki.fi wrote:
On Sat, 2010-09-18 at 19:59 +0200, Toni Mueller wrote:
I'm trying to get Dovecot's deliver to create and use mailboxen with one uid per user. Reading the wiki, I decided to go with the sudo attempt, but I'm stuck because deliver fails to create the intermediate directories.
Yeah, that's not even supposed to work. You need to figure out some other way to create the directories. Like maybe execute a script that first does mkdir and then calls deliver.
uh... ok. For now, I have abandoned the attempt and settled for a different approach.
Thanks for the heads-up!
Kind regards, --Toni++
participants (2)
-
Timo Sirainen
-
Toni Mueller