How to prevent mail to non-existent accounts

Greg Couch gregc at cgl.ucsf.edu
Wed Jul 12 08:09:36 AEST 1989


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 at cgl.ucsf.edu
	postmaster at 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);



More information about the Comp.bugs.4bsd.ucb-fixes mailing list