[Mimedefang] SMTP AUTH

Joseph Brennan brennan at columbia.edu
Thu Oct 27 09:24:51 EDT 2005



--On Wednesday, October 26, 2005 22:42 -0600 Jon Fullmer 
<jon at jonfullmer.com> wrote:

> John Rudd asked this question two months ago, but I didn?t get to see the
> final answer.
>
> The question is, how can I have SpamAssassin NOT check messages that have
> been properly authenticated using SMTP AUTH?


You can identify smtp-auth'd mail by whether you have a value for
the variable $SendmailMacros{"auth_type"}.  It does not matter for
this purpose what the value is.  We do this near the top of
filter_begin:

  undef($good);
  if (defined($SendmailMacros{"auth_type"})) {
        $good = 1;
  }
  if ($RelayAddr eq "127.0.0.1") {
        $good = 1;
  }

Mail from localhost is as good as smtp auth.  And then for certain
routines including the Spamassassin check, we can say:

unless ($good) {
	# do something
}

You need to undef($good), or localize it with my(), because remember
the same perl process will filter many messages, and you want to
define $good per message.

Joseph Brennan
Columbia University Information Technology





More information about the MIMEDefang mailing list