[Mimedefang] action_tempfail and delete_recipient question

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Mon Feb 2 19:28:35 EST 2004


You probably want to put the code in filter_recipient rather than
filter_begin.  I believe the SMTP conversation goes

HELO
...

RCPT TO: ...
(response - 2xx [OK] or 4xx [tempfail] or 5xx [permfail])

RCPT CC: ...
(response - 2xx [OK] or 4xx [tempfail] or 5xx [permfail])

RCPT TO: ...
(response - 2xx [OK] or 4xx [tempfail] or 5xx [permfail])

You probably need to tempfail each recipient at the time of the RCPT
command, rather than gathering all the recipients as you do below.  In other
words, SMTP does not allow a

RCPT TO: a at example.com
RCPT CC: b at example.com
RCPT TO: c at example.com
2xx a at example.com OK
4xx b at example.com tempfailed anti-spam try again
5xx c at example.com no such user

> -----Original Message-----
> From: Xiaoyan Ma [mailto:xma at haas.berkeley.edu]
> Sent: Monday, February 02, 2004 3:53 PM
> To: mimedefang at lists.roaringpenguin.com
> Subject: [Mimedefang] action_tempfail and delete_recipient question
> 
> 
> Have been running MD using example filter for awhile.  First 
> time trying to 
> add some code.  I would like to move David's greylist code from 
> filter_recipient to filter_begin.  Searched list archive, 
> read and reread 
> man page.  This is what I came up with:
> 
> sub filter_begin () {
>      my $sender = canonicalize_email ($Sender);
>      my $ip =  $RelayAddr;
> 
>      foreach $recip (@Recipients) {
>            if (should_greylist($sender, $recip)) {
>            md_syslog('warning', "Filter Recipient:$sender:$recip");
>                   #delete_recipient($recip);
>                   return action_tempfail("Tempfailed as anti-spam 
> measure.  Please try again.");
>                   delete_recipient($recip);
>            }
>      }
> 
> .....
> 
> 
> It works when there is one recipient and broke when there are more -- 
> tempfailed all recipients.  I have 2 questions:
> 
> 1. Does action_tempfail affects all recipients?
> 
> 2. Is delete_recipient needed? If not, wouldn't tempfailed recipient 
> receive a copy of the message?
> 
> or maybe my logic does not flow at all ?
> 
> Thanks.
> Xiaoyan
> 
> _______________________________________________
> Visit http://www.mimedefang.org and http://www.canit.ca
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> 



More information about the MIMEDefang mailing list