2 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] maildrop: sysusername...
FromSent OnAttachments
Alan SchwartzMar 4, 2006 8:25 am 
Sam VarshavchikMar 4, 2006 9:30 am 
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:Re: [maildropl] maildrop: sysusername vs. sysuserid (misfeature?)Actions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Mar 4, 2006 9:30:38 am
List:net.sourceforge.lists.courier-maildrop

Alan Schwartz writes:

I recently tried to help someone get a postfix/ldap/authlib/maildrop configuration working. They are using SuSE rpms of authlib (0.57) and installing maildrop-2.0.2 from source code, because they want to support maildirquota and ldap lookups via authlib. Postfix calls maildrop for delivery to virtual users (all users are virtual) with a command-line like this:

/usr/local/bin/maildrop -d some@virthost.com

authdaemond (correctly) returns information for the user, including the proper mailbox and the LDAP_GLOB_UID/LDAP_GLOB_GID as the sysuserid and sysgroupid of the user. That's important, because all maildirs on this system are owned by courier, so we need to wind up with courier's uid/gid.

authdaemond also returns some@virthost.com as the sysusername, because that's what it's been given. Ok, fine.

However, due to this code in maildrop/maildrop/main.C (about line 262):

uid_t u; if (auth->sysusername) { struct passwd *q=getpwnam(auth->sysusername);

if (q == NULL) { merr << "Cannot find system user " << auth->sysusername << "\n";

nochangeuidgid(); }

u=q->pw_uid; } else u=*auth->sysuserid;

the correctly returned explicit uid is ignored in favor of the sysusername, which is then subjected to getpwnam, which always fails as these are virtual mailboxes.

I suspect this code should be reordered, to give primacy to sysuserid if one is returned. But perhaps there's something I'm missing.

No, sysusername's usage is correct here.

I'm not sure why sysusername would get returned from authldap, though.