Re: Maildrop problem

2010-09-08 Thread Johannes Bunte
I found the problem. maildrop seems to not like it when it is called 
with the user it becomes to deliver the mail. When I call it from my 
normal user account, the mail is delivered correctly. And if I change 
the user=vmail (which owns the mails and maildrop does setuid() to) to 
user=mail, then everything's alright.



I'm pretty sure maildrop should not be setuid root, since postfix is
supposed to change to the user of the recipient before calling maildrop.


I would totally agree, but unfortunately this doesn't seem to be 
possible for the reasons stated above. I will fill a bug report.



Also, getuid() returns the real user ID, geteuid() returns the effective
user ID.


Ah, nice to know, maildrop only uses getuid(), maybe that's part of the 
problem.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4c876679.5070...@blackmole.de



Maildrop problem

2010-09-07 Thread Johannes Bunte

Hey guys,
I'm quite desperate getting maildrop to work.
I use postfix and courier with a mysql backend (virtual mailboxes). 
maildrop connects to authlib and gets the proper information, but only 
as root, it delivers it to the right mailbox. When i call maildrop from 
sudo -u vmail -i, it creates/appends the mail to ~/Maildir. Here is some 
output:

# maildrop -V5 -d m...@my-domain.de  mail.eml
maildrop: authlib: groupid=2000
maildrop: authlib: userid=2000
maildrop: authlib: logname...@my-domain.de, home=/var/kunden/mail/, 
mail=johannes/m...@my-domain.de/

maildrop: Changing to /var/kunden/mail/
Message start at 0 bytes, envelope sender...@my-domain.de
maildrop: Attempting .mailfilter
maildrop: Delivery complete.
# sudo -u vmail -i
$ maildrop -V5 -d m...@my-domain.de  mail.eml
maildrop: authlib: groupid=2000
maildrop: authlib: userid=2000
maildrop: authlib: logname...@my-domain.de, home=/var/kunden/mail/, 
mail=johannes/m...@my-domain.de/

maildrop: Changing to /var/kunden/mail
Message start at 0 bytes, envelope sender=vmail
maildrop: Attempting .mailfilter
maildrop: Delivering to ./Maildir
maildrop: Flock()ing ./Maildir.
maildrop: Appending to ./Maildir.
maildrop: Delivery complete.

So the only difference before delivery is the envelope sender, which I 
can set manually, but which does not give a different result in terms of 
delivery.


Has anybody got an idea what is wrong there?
I use Lenny with standard repos, so a quite common setup. It's running 
in VirtualBox from Lenny-Backports.


Btw: What can go wrong with a setuid? I straced the above command, but 
as vmail I was not allowed to connect to the authdaemon socket, the 
first getuid() returned 2000 before any setuid. After chowning the 
socket, the connection to the authdaemon seems to be fine, but I don't 
understand why getuid() does not return a 0, because maildrop has 
-rwsr-sr-x. Maybe that's the problem? Any ideas?


Thanks for any hints!
Johannes


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4c86cbf1.4010...@blackmole.de