[Mimedefang] Bloclking mail to a mailing list if mail is fromoutside of our network
Mathew Thomas
mathew.thomas at rmit.edu.au
Tue Sep 23 23:37:00 EDT 2003
Thanks James. I have got about 500 mailinglist. A sendmail macro would have been better, but I don't know how to write one.
Cheers
Mathew
>>> sysadmin at aims.gov.au 23/09/03 15:55:22 >>>
> -----Original Message-----
> From: Mathew Thomas [mailto:mathew.thomas at rmit.edu.au]
>
> I am managing a mail gateway for a Uni which is running on
> Sendmail. All mail from inside and
> outside our network are routed via the gateway.
>
> There are more five hundred of mailing list in our GroupWise.
> The GroupWise server has got user at ems.uni.edu.au as well as
> mailinglist at ems.uni.edu.au. I would like to block mail only
> to these mailing lists (mailinglist at ems.uni.edu.au) , if the
> mail is from outside, but allow all mail from inside the
> network to the mailing list. (ie allow mail to the list if a
> mail is from an IP in the
> /etc/mail/relay-domains.). How can I do it. Please help
Hi Mathew,
The following code is untested so may need some work, but should set you in
the right direction. You will also need to install Net::IP::Match, grab it
here:
http://search.cpan.org/~marcel/Net-IP-Match-0.01/
Use Net::IP::Match;
foreach $RcptAddr (@Recipients){
# Change the 192.168.0.0/16 to your internal subnet.
if(! __MATCH_IP($RelayAddr, '192.168.0.0/16') && ($RcptAddr =~
/^<?mailinglist\@ems\.uni\.edu\.au>?$/i)) {
# Relay IP was not internal, bouncing.
action_bounce("External posting to this address denied");
}
}
Regards
James
><> ><> ><> ><> ><> ~~~~~ <>< <>< <>< <>< <><
Systems Administrator
Australian Insitute of Marine Science
Townsville, FNQ, Australia
Phone +61 7 4753 4400 Fax +61 7 4772 5852
Email: sysadmin at aims.gov.au
><> ><> ><> ><> ><> ~~~~~ <>< <>< <>< <>< <><
_______________________________________________
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
More information about the MIMEDefang
mailing list