[Mimedefang] Filter_relay, global variable help

Paul Heinlein heinlein at cse.ogi.edu
Mon Nov 3 14:49:47 EST 2003

On Mon, 3 Nov 2003, Jim McCullars wrote:

>    So in short, do your relay check (using the global variable
> $RelayAddr) in filter_begin() and you should be OK.

Unless, of course, you want to run all messages -- regardless of where
they originate -- through your virus scanner. In that case, you'll
want to wait until filter_end() to do your check using $RelayAddr as
Jim suggested, e.g.,

sub filter_end ($) {
  my($entity) = @_;

  # No sense doing any extra work
  return if message_rejected();

  # don't spam-check mail originating locally
  return if $RelayAddr =~ /$local_net_regex/;

  # on with spamassassin ...

--Paul Heinlein <heinlein at cse.ogi.edu>

More information about the MIMEDefang mailing list