On Mon, 16 Feb 2004, Jim Crippen wrote:

> sub filter_relay
> {
>       my($ip,$name,$helo) = @_;
>       if ( index($ip,"192.168.12.") >= 0 ) {

That will work, but I would write it as:

        if ($ip =~ /^192\.168\.12\./) {

>               add_recipient("[EMAIL PROTECTED]");

You cannot call add_recipient from filter_relay.  And Perl will choke on
a "@" inside double quotes.

There is no way to do both ACCEPT_AND_NO_MORE_FILTERING and
add_recipient; you'll have to rewrite your filter to do the add_recipient
in filter_begin or filter_end, and simply not call SpamAssassin if the
relay host is trusted.

>               return ('ACCEPT_AND_NO_MORE_FILTERING',"$ip whitelisted");
>       }
>       return('ACCEPT_AND_NO_MORE_FILTERING',"$ip whitelisted");
> }

You always return ACCEPT_AND_NO_MORE_FILTERING, which will simply disable
MIMEDefang. :-)

Regards,

David.
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to