Re: [Mimedefang] action_tempfail and delete_recipient question
At 05:43 PM 2/3/2004, Xiaoyan Ma wrote: How can I only tempfail 2 of 5 recipients then? Unless I'm mistaken, you don't tempfail a recipient so much as you tempfail a message. (If anyone can correct me, please do!) Is stream_by_recipient the right approach No, stream_by_recipient won't do what you want. That would accept the message, then resend it locally. As far as the sending machine is concerned, the message will have gotten through. Kelson Vibber SpeedGate Communications www.speed.net ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] action_tempfail and delete_recipient question
On Wed, 4 Feb 2004, Kelson Vibber wrote: Unless I'm mistaken, you don't tempfail a recipient so much as you tempfail a message. (If anyone can correct me, please do!) I've seen it happen using md_check_against_smtp_server in filter_recipient(). If the downstream SMTP server is down or returns a tempfail, then filter_recipient() will too (assuming you are using the sample code from the man page). Jim McCullars ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] action_tempfail and delete_recipient question
Thanks for Kelson's help but I still have a few questions: At 04:22 PM 2/2/2004 -0800, you wrote: At 03:52 PM 2/2/2004, Xiaoyan Ma wrote: 1. Does action_tempfail affects all recipients? Yes. How can I only tempfail 2 of 5 recipients then? Is stream_by_recipient the right approach or I can hold them in @tempfail, tempfail them at the end of filter_begin. If the second approach should work, do I need to delete_recipient them all so they won't receive the message since @Recipients is global? Please bear with me if I am confused. Thanks. Xiaoyan 2. Is delete_recipient needed? If not, wouldn't tempfailed recipient receive a copy of the message? No, and no. 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); } } Remember, any time you call return, it'll stop processing the subroutine. So in this case, it will *never* call delete_recipient, and it will only run up to the first recipient that triggers should_greylist(). Kelson Vibber SpeedGate Communications www.speed.net ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
RE: [Mimedefang] action_tempfail and delete_recipient question
Mathew: Thank you for your reply. The reason I want to move it to filter_begin is that some MTAs don't handle tempfail at RCPT TO stage correctly. They bounce the message instead of requeue. A few people on the list had shared their experience and I have run into the same situation as well. Xiaoyan At 04:28 PM 2/2/2004 -0800, you wrote: 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: [EMAIL PROTECTED] RCPT CC: [EMAIL PROTECTED] RCPT TO: [EMAIL PROTECTED] 2xx [EMAIL PROTECTED] OK 4xx [EMAIL PROTECTED] tempfailed anti-spam try again 5xx [EMAIL PROTECTED] no such user ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang