[Mimedefang] Re: exiting the filter before any processing

Mack roaringpenguin.com at bass-speaker.com
Tue Sep 6 09:56:46 EDT 2005


Oops, Slightly Misread your requriment's there,
Yes you will need to enter each part of the filter and perform the IP check, 

using something like

sub filter_end ($) {
	return if message_rejected();
	my($entity) = @_;
	if ($ip=~ /x.x.x.x$/i){
		append_text_boilerplate($entity,"Your Boilerplate", 0);
		append_html_boilerplate($entity,"<BR><B>Your Boilerplate</B>", 0);		    
		return('CONTINUE',"ok");
	}
	# Carry on with spam checks av checks etc here



-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com]On Behalf Of Mack
Sent: Tuesday 06 September 2005 14:36
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] Re: exiting the filter before any processing


return('ACCEPT_AND_NO_MORE_FILTERING',"ok");

That should throw you straight out and not do anymore processing




-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com [mailto:mimedefang-bounces at lists.roaringpenguin.com]On Behalf Of Rolf
Sent: Tuesday 06 September 2005 14:22
To: mimedefang at lists.roaringpenguin.com
Subject: [Mimedefang] Re: exiting the filter before any processing


hello

Yesterday I received several helpful responses to the question below. All suggested using filter_relay to avoid further processing.

I have now discovered that what I was initially trying doesn't match what the business wants. What is required is that some parts of the filter are to be avoided based on the sending mail server: 

If $RelayAddr is the address of the ISP mail server then processing continues as usual. If, however, it is the address of the LAN mail server then spam, attachments, size, and so on that the filter checks are all to be ignored, but append_text_boilerplate() is to be applied. 
I can easily apply the boilerplate routine to the right msgs, but I can't find a simple way to ignore the rest of the processing for the same msg. 

Is the only method to insert a collection of conditionals that avoid each of the checks through each of the subroutines? Of the kind "if the relay address is not from then LAN then do this virus/spam/mimetype check..."? Seems the only way, and rather clumsy. Is there a better construct?

The man page says that the boilerplate routine is only available in filter_end so it seems that any message wanting that kind of processing will at least need to "enter" the filter in the first place.

Many thanks.

r.




From: Rolf <rolf at ses.tas.gov.au>
Date: 5 September 2005 9:23:55 PM
To: mimedefang at lists.roaringpenguin.com
Subject: exiting the filter before any processing

hello

I've tried so many combinations and none work. Feeling a bit silly.

Where can I put in mimedefang-filter a statement so that the filter exits before any processing happens based on $RelayAddr ??

I've tried a simple: return if ($RelayAddr eq "ip address"); in various parts of the filter but none make any difference. Do I need such a statement in each of the subroutines?

What am I missing and/or misunderstanding?

thanks

r.


_______________________________________________
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

This Email Has Been Anti-Virus Scanned





More information about the MIMEDefang mailing list