Subject: Re: Zmailer accepts mail from <> (empty address) - causes problems

From: Chris Maxwell <[email-masked]>
Date: Fri, 11 Oct 2002 14:31:46 -0300

>> My standard zmailer configuration to my great surprise accepts a mail with
>> 
>> 3J1O28648r      MAIL From:<> SIZE=2495
>> 3J1O28648w      250 2.1.0 Sender syntax Ok
>> 
>> How can I disable this?
>
>Unfortunately, you may not. See http://www.rfc-ignorant.org/policy-dsn.html for full 
>explanations.

  I have a problem that is sort of related.

Running: Zmailer 2.99.55 on  Solaris 8

  This is all well and good, and I have been forced to go back to being 
compliant because I was also losing listserv responses.  However, I am getting 
many messages sent to the mailer-demon, which we have aliased to 
our support group alias.  The messages look like this:

======================================================================
To:	[email-masked]
From:	The Post Office <[email-masked]>
Sender:	[email-masked]
Subject: Invalid message envelope information

Error in "to" envelope address:

	<< > >
	 ^-expected word, illegal end of route address, missing end of address

Error in "To" header address:

	<< > >
	 ^-expected word, illegal end of route address, missing end of address

The entire original message file follows.

-----------------------------------------
rcvdfrom STDIN ("??"@waffle.cs.dal.ca)
channel error
todsn NOTIFY=NEVER ORCPT=RFC822;<>
to <<>>
env-end
To: <<>>
From: The Post Office <[email-masked]>
Sender:	[email-masked]
Subject: Errors: No such user(s)
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="S247969AbSJISYP=_/errmail/waffle.cs.dal.ca"

--S247969AbSJISYP=_/errmail/waffle.cs.dal.ca
Content-Type: text/plain

This is a collection of reports about email delivery
process concerning a message you originated:

error: nosuchuser: [email-masked]

--S247969AbSJISYP=_/errmail/waffle.cs.dal.ca
Content-Type: message/delivery-status

Reporting-MTA: dns; waffle.cs.dal.ca
Arrival-Date: Wed, 9 Oct 2002 15:24:14 -0300

Original-Recipient: rfc822;[email-masked]
Final-Recipient: RFC822; [email-masked]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-LOCAL; 500 (nosuchuser)

--S247969AbSJISYP=_/errmail/waffle.cs.dal.ca
Content-Type: message/rfc822

Date:	Thu, 10 Oct 2002 00:03:11 +0900
From:	Mail Delivery Subsystem <[email-masked]>
Message-Id: <[email-masked]>
To:	<[email-masked]>
Subject: Returned mail: see transcript for details
Auto-Submitted:	auto-generated (failure)

This is a MIME-encapsulated message

--g99F3Bj13747.1034175791/newtiis.co.kr

The original message was received at Wed, 9 Oct 2002 23:53:23 +0900
from 200-204-118-235.dsl.telesp.net.br [200.204.118.235]

   ----- The following addresses had permanent fatal errors -----
<[email-masked]>
    (reason: 550 Host unknown)
<[email-masked]>
    (reason: 550 Dialups/open relays blocked. Contact <[email-masked]>.)
<[email-masked]>
    (reason: 550 Dialups/open relays blocked. Contact <[email-masked]>.)

[.....]

======================================================================

  So, here is my take:

+random_spam.net -> newtiis.co.kr
  MAIL From: <[email-masked]>
  RCPT To: <various recipients>

   Hi!  I am a spammer!

+newtiss.co.kr -> cs.dal.ca [smtpserver]
  MAIL FROM: <> 
  RCPT To: <[email-masked]> 

   Failed to deliver to <various recipients>

+cs.dal.ca [router] -> [scheduler]
   todsn NOTIFY=NEVER ORCPT=RFC822;<>
   to: <>

        cweqx does not exist

+cs.dal.ca [router]
   rfc822.c: parse envelope.
    Parse error in envelope, before checking that NOTIFY=NEVER.
    Must tell mailer-daemon.

  I can not quite figure out if this is fixed in a newer version, or if I 
have an incorrect configuration that is leading to this making it further
in the process than it should.

  We were not getting this behavior in what I think was a 2.99.54 
configuration.

  Any comments?  Help?

-- 
  Chris Maxwell
  Unix SysAdmin, Faculty of Computer Science, 
  Dalhousie University, Halifax, Nova Scotia, Canada
  (902) 494-1369 / chris.maxwell_AT_dal.ca / FAX: (902) 492-1517
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to [email-masked]

---

From: Chris Maxwell <[email-masked]>
Date: Mon, 28 Oct 2002 15:39:24 -0400

Well, since the only possible cause for this that was suggested was 
configuration:executable mismatch and I checked for this, I went ahead and
patched the code to errormail to count <> as an empty sender also.  I 
provide it here in case anyone else has the symptoms:

----BEGIN---------------------BEGIN-------------------BEGIN---------------
*** errormail.c.~1.12.~	Wed Apr 17 10:42:23 2002
--- errormail.c	Mon Oct 28 11:14:02 2002
***************
*** 236,241 ****
--- 236,242 ----
  	Sfio_t *mfp, *efp;
  	int n;
  	struct rcpt *rp;
+ 	struct taddress *sp;
  	char boundarystr[400];
  	char lastchar;
  	int reportcnt = 0;
***************
*** 261,266 ****
--- 262,296 ----
  	    diagnostic(verboselog, rp, EX_OK, 0, "error bounce dropped");
  	  return;
  	}
+ 	else {
+ 	  char emptyness = 1; /* Boolean whether it is empty. */
+           /* Check the senders for blank-ness with "<>" */
+           for (sp=dp->senders; sp != NULL; sp = sp->link) {
+             const char *user = sp->user, 
+ 	      *host = sp->host;
+ 	    
+             if  ( ( strncmp (user, "<>", 3) == 0 ) || 
+                   (strncmp (user, "", 2) == 0) ) {
+ 	      /* emptyness = 1;  */   /* This is the default */
+             }
+             else {
+ 	      emptyness = 0;
+             }
+           }
+           if ( emptyness ) {
+ 	    /*
+ 	     * If there was no error return address
+ 	     * it might be because this message was
+ 	     * an error message being bounced back.
+ 	     * We do NOT want to bounce this, but
+ 	     * instead just drop it on the floor.
+ 	     */
+ 	    for (rp = dp->recipients; rp != NULL; rp = rp->next)
+ 	      diagnostic(rp, EX_OK, 0, "error bounce dropped");
+ 	    return;
+           }
+         }
+ 	
  
  	if ((mfp = sfmail_open(MSG_RFC822)) == NULL) {
  	  for (rp = dp->recipients; rp != NULL; rp = rp->next)

---END-----------------------END-----------------------END--------------

  diff seems to have done something sort of odd with the indentation.
It looks fine in emacs, but does not look right when I do a diff.  Oh well, 
you get the idea.

  Have a nice day all,

-- 
  Chris Maxwell
  Unix SysAdmin, Faculty of Computer Science, 
  Dalhousie University, Halifax, Nova Scotia, Canada
  (902) 494-1369 / [email-masked] / FAX: (902) 492-1517

-