On 25/04/2014 17:33, Ricardson Williams wrote:
  I´m trying now block multiple email address how to do? I already try
like below and not working


sub filter_sender {


            my ($sender, $ip, $hostname, $helo) = @_;

             if ($sender =~ /^<?spammer\@badguy\.com>?$/i) {
                  return (’REJECT’, ’Sorry; [email protected] is 
blacklisted.’);
             }
             return (’CONTINUE’, "ok");

              if ($sender =~ /^<?xxxxx\@xxxx\.com>?$/i) {
                  return (’REJECT’, ’Sorry; [email protected] is blacklisted.’);
             }
             return (’CONTINUE’, "ok");


    }



I use this code :

%BadSender = (
        "user\@exemple.com" => 1 ,
        "user2\@exemple.com" => 1 ,
        "user3\@exemple.com" => 1
);

[...]

# I wrote this code in sub filter_recipient but I think sub filter_sender is ok too.

sub filter_recipient
{
[...]
        my $se = join '|', keys (%BadSender);

        $sender =~ tr/<>//d;
        if( $sender =~ m/($se)/ )
        {
                if( exists $BadSender{$1} )
                {
                        # Your code
                        return (’REJECT’, ’Sorry; [email protected] is 
blacklisted.’);
                }
        }
[...]
}

Eric.
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to