[Mimedefang] VERY Newbie Question

Yang Xiao yxiao2004 at gmail.com
Thu Oct 28 13:28:37 EDT 2004


Hi all,
I'm a little confused as to how to insert a custom function into the
filter. Can someone please give me a pointer or two?

Ok, for something like this, a sample function on the FAQ site that
filters HELO line

sub filter_sender {
  my($sender, $ip, $name, $helo) = @_;
  return(1, "OK") if ($ip eq "127.0.0.1");   # no further checking if localhost
  if ($helo =~ /(^|.)abc.com$/i) {
    if ($ip !~ /^123.123.123./) {
          return(0, "Connect rejected - $ip is not abc.com");
    }
  }
  return(1, "OK");
}

How do I integrate this into the filter file ?

Many thanks, flames ok too.

Yang



More information about the MIMEDefang mailing list