9 messages in net.sourceforge.lists.courier-maildrop[maildropl] per-user uid & ldap
FromSent OnAttachments
Adam DivakApr 9, 2007 2:58 pm 
Petri RiihikallioApr 10, 2007 3:12 am 
Adam DivakApr 10, 2007 7:21 am 
Petri RiihikallioApr 10, 2007 9:43 am 
Divák ÁdámMay 5, 2007 4:35 am 
Petri RiihikallioMay 5, 2007 10:29 am 
Divák ÁdámMay 5, 2007 11:44 am 
Petri RiihikallioMay 7, 2007 9:14 am 
Divák ÁdámMay 7, 2007 3:40 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] per-user uid & ldapActions...
From:Adam Divak (epe@near.hu)
Date:Apr 9, 2007 2:58:52 pm
List:net.sourceforge.lists.courier-maildrop

Hello,

I have a postfix-maildrop setup which just works fine using an LDAP backend. The whole /mail directory containing all the messages is currently owned by the mail user, the same which maildrop runs as. I would like to modify this so that every users email is stored under his own UID/GID (every user has and it is working fine as all the files are stored under these uids) so that i can enforce filesystem quotas to the mails as well.

The maildrop line in postfix originally looked like this:

maildrop unix - n n - - pipe flags=DRhu user=mail argv=/usr/bin/maildrop -d ${recipient}

and the authldaprc: ... LDAP_MAIL mail LDAP_HOMEDIR mailMessageStore LDAP_MAILDIR mailMessageStore LDAP_GLOBAL_UID mail LDAP_GLOBAL_GID mail LDAP_DEREF never ...

Now I changed the authldaprc file by setting the LDAP_UID to uidNumber and the LDAP_GID accordingly and removed the '-d' switch from the postfix master.cf file and i hoped maildrop will change to the user receiving the mail and deliver under that uid. Well, it didn't instead it gave the following strange error: Unable to open filter file, errno=2 I didn't really understand how the mailfilter file has to do anything with the user permissions (of course it was world readable) but I specified it by hand so master.cf now looks like:

maildrop unix - n n - - pipe flags=DRhu user=mail argv=/usr/bin/maildrop /etc/courier/maildroprc ${recipient}

So maildrop again reads the filter file, but adding some debug output to the filter file (whoami, echo $HOME) it was easy to find out that maildrop can't deliver to the user maildir because it runs as user mail and thinks home directory is /var/mail meaning that maildrop didn't get anything from LDAP which i don't really understand. Of course maildrop is installed setuid (I even added setgid..) so that should not be a problem.

Could anyone please give a hint what i am missing?

Oh and I have one more question: when maildrop receives the message and gets that the recipient is xx@yy.com, does it look up the mail address xx@yy.com in LDAP, retrieve the UID/GID and change to that UID/GID or does it directly change to user xx@yy.com? I'm only asking because the first one would obviously work while the second one would fail when a user gets a message to one of his aliases.. (Courier searches for the attribute "mail" and there can be several mail attributes but libnss-ldap is set up to search for the attribute "uid" which is a unique one and i'm quite happy with this so I'd rather not change it).

Thanks in advance, Adam