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.