I've been having the same discussion here for a different reason, and
today I wrote a patch for sendmail to reject messages that don't have
at least one valid destination. These messages violate RFC 822, the patch
quotes chapter and verse.
To use, apply the patch and in sendmail.cf set:
O NoRecipientAction=reject
--Jered
jered@mit.edu
Common subdirectories: sendmail-8.8.5.old/src/Makefiles and sendmail-8.8.5/src/Makefiles
diff -c sendmail-8.8.5.old/src/collect.c sendmail-8.8.5/src/collect.c
*** sendmail-8.8.5.old/src/collect.c Sat Feb 8 17:23:49 1997
--- sendmail-8.8.5/src/collect.c Sat Feb 8 17:32:17 1997
***************
*** 553,558 ****
--- 553,562 ----
case NRA_ADD_TO_UNDISCLOSED:
addheader("To", "undisclosed-recipients:;", &e->e_header);
break;
+
+ case NRA_REJECT:
+ usrerr("554 No destination address fields specified (see RFC822 C.3.4)");
+ return;
}
if (hdr != NULL)
diff -c sendmail-8.8.5.old/src/readcf.c sendmail-8.8.5/src/readcf.c
*** sendmail-8.8.5.old/src/readcf.c Sat Feb 8 17:23:49 1997
--- sendmail-8.8.5/src/readcf.c Sat Feb 8 17:31:02 1997
***************
*** 2148,2153 ****
--- 2148,2155 ----
NoRecipientAction = NRA_ADD_BCC;
else if (strcasecmp(val, "add-to-undisclosed") == 0)
NoRecipientAction = NRA_ADD_TO_UNDISCLOSED;
+ else if (strcasecmp(val, "reject") == 0)
+ NoRecipientAction = NRA_REJECT;
else
syserr("Invalid NoRecipientAction: %s", val);
break;
diff -c sendmail-8.8.5.old/src/sendmail.h sendmail-8.8.5/src/sendmail.h
*** sendmail-8.8.5.old/src/sendmail.h Sat Feb 8 17:23:49 1997
--- sendmail-8.8.5/src/sendmail.h Sat Feb 8 17:30:20 1997
***************
*** 892,897 ****
--- 892,898 ----
#define NRA_ADD_APPARENTLY_TO 2 /* add Apparently-To: header */
#define NRA_ADD_BCC 3 /* add empty Bcc: header */
#define NRA_ADD_TO_UNDISCLOSED 4 /* add To: undisclosed:; header */
+ #define NRA_REJECT 5 /* don't accept message */
/* flags to putxline */
|
|