[Mimedefang] Stupid question? - subnet

Richard Cooper ric at digital-animations.com
Mon Feb 10 12:34:01 EST 2003

Can I put a subnet mask for RelayAddr or do I have to enter them individually?
As in - 
$RelayAddr =~ /62\.253\.177\.96\\27/

To put it in context and to get some checking done before I break my filter, I'm trying to check the recipient against my final mail server as I get a lot of dictionary spam attacks on my relay from fake addresses so I end up with hundreds of postmaster - Undeliverable: Delivery Status Notification (Failure) mails every day. md_check_against_stmp_server looks like it will solve my problem but I need to potentially relay mail from anywhere in my server domain for various reasons.

This is what I have, but I would like to change the ...xxx\.100/ to the above. I'm not really bothered about checking outgoing mail, as I don't think the extra load would justify it.

#Check for local sender
sub is_local_sender {
        if ($RelayAddr =~ /127\.0\.0\.1/
                || $RelayAddr =~ /62\.253\.177\.100/) {
                return 1;
        } else {
                return 0;

#Check for valid recipient on mailgate
sub filter_recipient
        if(is_local_sender()) {
        } else {
           my($recip, $sender, $ip, $host, $first, $helo) = @_;
           return md_check_against_smtp_server($sender, $recip,"relay.machine","final.machine");

Thanks for any help.

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Digital Animations Group.

More information about the MIMEDefang mailing list