[Dovecot] Getting default uid/gid of users via socket for virtual user support for sendmail
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I'm trying to make my life easier with sendmail and virtual users. For that I'd like to pass sendmail the home directory and uid/gid for each user. The user data is storred in a LDAP,& I retrieve it from the auth-userdb socket fine.
If I add uid / gid to each user, I get them via that socket as well, but is there a way I get the default uid/gid? I mean, without calling an external program, such as doveadm. There is an "initialize" phase, so the default information is retrieved just once per lifetime of the demon, but each time the sendmail binary is invoked.
Kind regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUfp2JF3r2wJMiz2NAQL61Af+MuF1BTwaX+Tm+rOWe+smcVUzRmMYZdtL J08wDGNB2EyQ9a0zXwZleO/X3Jvaqr8HSHaC6oTzliS25yqPT4AYG0VVswZoyDTg hggyS9kVse2R1koLZKPAM1EatTmpTsKfUKDjsB3cxbYsBU5NYMJY+u4YATPTl7ui 46K4YmeL4xkKirRXc7j0fIMxdXttuD9zPq20qJ0p41HK2W0ECVHeQpUahozWY45h DREbwdZBZe9PeZNbfOYTLWnxPi1/FK/AX20QH3y3uxEhgMDfYAUHNwAleSCpack5 JEuVYwTPchxsH6uibk62qIsK/uWO3vZM0Zj18S0BBWDNvPhg0Nz92w== =abqh -----END PGP SIGNATURE-----
On 1.8.2013, at 17.52, Steffen Kaiser skdovecot@smail.inf.fh-brs.de wrote:
I'm trying to make my life easier with sendmail and virtual users. For that I'd like to pass sendmail the home directory and uid/gid for each user. The user data is storred in a LDAP,& I retrieve it from the auth-userdb socket fine.
If I add uid / gid to each user, I get them via that socket as well, but is there a way I get the default uid/gid? I mean, without calling an external program, such as doveadm. There is an "initialize" phase, so the default information is retrieved just once per lifetime of the demon, but each time the sendmail binary is invoked.
You can't get the mail_uid/gid/home, because they really don't belong to auth process.. But what you could do with v2.2 is:
userdb { driver = ldap args = .. default_fields = uid=1234 gid=1234 home=/home/user/%u }
But anyway, what is sendmail going to be doing with these fields? For Postfix I've been trying to remove its need to know anything at all about users (only domains and aliases).
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 1 Aug 2013, Timo Sirainen wrote:
You can't get the mail_uid/gid/home, because they really don't belong to auth process.. But what you could do with v2.2 is:
userdb { driver = ldap args = .. default_fields = uid=1234 gid=1234 home=/home/user/%u }
I'll try that.
But anyway, what is sendmail going to be doing with these fields? For Postfix I've been trying to remove its need to know anything at all about users (only domains and aliases).
sendmail's forward feature is tied to plain text files. I'm relucant to drop the feature and replace it by, say, aliases, because some forwards deliver to files, programs or rather large lists. But sendmail's logic get the user with a MailboxDatabase, that returns user, home, uid, gid and shell, well the passwd entries; without them the user forward feature deactivated. This is by design, I have been told, when I tried to submit a patch to fetch user forwards from LDAP.
By default, sendmail uses this database, too, to verify local users before accepting a message. But unlike for user forwards, one can achieve this check through other means.
I have a few systems users, too, and it would be easier if I could use Dovecot to merge all sources together.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUfu4Wl3r2wJMiz2NAQJMvgf/V/UZJRunTVfot0z2M4Y7x3RsVEluUPXv AscAWueU9YodizyO2gb/bB0shsN7xQ61hZ0Z817fZSYrFzyO8zGxxVVdNiLqRBjP NyxATsCzrkDyskzocOnvOJNfu2GXXPgnnsca+oifousHkWjuQ07JdVVmd/vAUsX1 dJXTlZ/70rgkGUwZFO1J8uaYQMmj/PC64y9Bdq5Soh8LX/CVlZWfu0vWCwqKRdy6 KYnwUIv8kupI5PqJqJr/0vNfA/RlY9pXFcsCZ2EGUJEsZv1vzoWKFoz7BiH8JclP Km/yNUBIKW9sQOmRBu3eLgrPO5xQCfRIhCFRaRVWFkv1V1OEIjU4sw== =ZsLf -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 1 Aug 2013, Timo Sirainen wrote:
You can't get the mail_uid/gid/home, because they really don't belong to auth process.. But what you could do with v2.2 is:
userdb { driver = ldap args = .. default_fields = uid=1234 gid=1234 home=/home/user/%u }
works like charm, thanks!
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUgTqMF3r2wJMiz2NAQK1PwgAh77/ZC1PTh1qReOQ7yNr0uGswzEmw2aM dNJTdbAXnWvxUPXGl9nmmYs/GahbyyJbD42/MM2Hpl+w95vIgWOhQxkPp2QyzJFt T+MfHvLKcg6vDvmeSBUGTL08m9tGyb4EXMROh1ONLW4bAhPHtN8qJrgR4vKTTOqe Ri75cATI3LbiWPS53ub+9s+DAvCFvoakSdl08BIOJmzzVClEF0iis9AnRpOY9a4p 7y2P6DG0nGY/MvFSXnpu0wP0E3IGqQm9jFD1d7aXgznkPr5lyHFkLXe3xkSmHV0M nGBRf3WV4WPHyWVPsjZNr1h3Xcl+CzXIQImadZt/WZF41UGUz2GJbQ== =suGe -----END PGP SIGNATURE-----
participants (2)
-
Steffen Kaiser
-
Timo Sirainen