Xref: utzoo comp.mail.sendmail:888 comp.bugs.4bsd:1331 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!ucsfcgl!cgl.ucsf.edu!gregc From: gregc@cgl.ucsf.edu (Greg Couch) Newsgroups: comp.mail.sendmail,comp.bugs.4bsd Subject: How to prevent mail to non-existent accounts Message-ID: <11680@cgl.ucsf.EDU> Date: 11 Jul 89 22:09:36 GMT Sender: daemon@cgl.ucsf.edu Reply-To: gregc@cgl.ucsf.edu (Greg Couch) Organization: UCSF Computer Graphics Lab Lines: 42 A bit of background: we share a password file amoung several 4.3 systems and restrict access to a particular system by having login fail if the user doesn't have a home directory on that system. Thus we don't want users to get mail on machines they can't access. Enclosed is a small enhancement to reject mail to users that don't have home directories. Depending on how your site manages accounts, you might want to disable mail to users with non-standard shells or to users whose password entry is "*" or somesuch. This patch works for sendmail versions 5.59 and 5.61. - Greg Couch gregc@cgl.ucsf.edu postmaster@cgl.ucsf.edu ------ sendmail/src/recipient.c: ------ RCS file: RCS/recipient.c,v retrieving revision 1.1 diff -c -r1.1 recipient.c *** /tmp/,RCSt1024920 Tue Jul 11 15:09:13 1989 --- recipient.c Tue Jul 11 14:52:40 1989 *************** *** 303,309 /* warning -- finduser may trash buf */ pw = finduser(buf); ! if (pw == NULL) { a->q_flags |= QBADADDR; giveresponse(EX_NOUSER, m, CurEnv); --- 303,309 ----- /* warning -- finduser may trash buf */ pw = finduser(buf); ! if (pw == NULL || !safefile(pw->pw_dir, pw->pw_uid, S_IEXEC)) { a->q_flags |= QBADADDR; giveresponse(EX_NOUSER, m, CurEnv);