Path to this page:
Subject: CVS commit: pkgsrc/mail/sendmail
From: Emmanuel Dreyfus
Date: 2009-03-09 22:24:00
Message id: 20090309212400.60028175D0@cvs.netbsd.org
Log Message:
This patch fixes an important reliability fix when Sendmail performs local
mail delivery with non local NSS passwd source, such as LDAP.
Stock LDAP uses getpwnam(3) to lookup recipients. As mandated by SUSv2,
getpwnam(3) does not set errno, so Sendmail has no way of distinguishing
a non existing user and an error with a remote NSS source. Therefore,
when the LDAP server goes down, Sendmail bounces mail to valid recipients.
A first workround is to remove F=w from Mlocal in sendmail.cf. This will
inhibit local recipient lookups, but it has a two drawbacks
- ~/.forward do not work anymore
- For multi-recipient mails with a single inexistent user, mail.local
cause a DSN reporting an error for all users, whereas all valid users
do get the message.
A better workaround is this patch, which calls getpwnam_r(3). This newer
API do set errno and do return an error code. Sendmail is therefore able
to detect that it had a transcient error in NSS, and it will react by
queuing the message. This is what you really want to happen when LDAP
is down.
I have not been able to get any feedback from Sendmail developers about
this patch.
Files: