[Mimedefang] set mimedefang to not scan authenticated users

maillist maillist at emailacs.com
Thu Apr 17 16:18:44 EDT 2008


>> sendmail -
>> define(`confMILTER_MACROS_ENVFROM', ``i, {auth_type}, {auth_authen})dnl
>
> The quoting is wrong, but that you'll see in the syntax checks.
Yeah, I goofed that
>
> Second, I have no macro definition in my mc file, but the cf file 
> contains all of these settings, just grep Milter.macros *.cf  .
>
I removed it from my mc file, and you are correct, it's still there in 
the cf file.

> Well, the main question is where / when is your SpamAssassin check 
> called?
> Usually the call is in filter_end(), too, but I see no signs there.
I know very little about Perl, so maybe I have something out of order 
here.  Here is what I have...

sub defang_warning {
  my($oldfname, $fname) = @_;
  return
    "An attachment named '$oldfname' was converted to '$fname'.\n" .
    "To recover the file, right-click on the attachment and Save As\n" .
    "'$oldfname'\n";
}

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

  sub filter_relay($$$) {
    my ($entity) = @_;
    if ($SendmailMacros{'auth_authen'}) {
      return('ACCEPT_AND_NO_MORE_FILTERING', "ok");
    }
  }

  sub filter_relay($$$) {
    my ($ip, $name, $helo) = @_;
    if ($ip =~ /127\.0\.0\.1/ || /10\.0\.1\./) {
      return('ACCEPT_AND_NO_MORE_FILTERING', "ok");
    }
    else {
      return ('CONTINUE', "ok");
    }
  }

  if ($Features{"SpamAssassin"}) {
    if (-s "./INPUTMSG" < 100*1024) {
      my($hits, $req, $names, $report) = spam_assassin_check();
      my($score);
      if ($hits >= $req) {
        action_add_header("X-Orig-Rcpts", join(", ", @Recipients));
        foreach $recip (@Recipients) {
        delete_recipient($recip);
      }

      add_recipient('spamdrop at my_domain.com');
    }
    if ($hits >= $req) {
      action_change_header("X-Spam-Score", "$hits ($score) $names");
      md_graphdefang_log('spam', $hits, $RelayAddr);
      action_add_part($entity, "text/plain", "-suggest",
      "$report\n", "SpamAssassinReport.txt", "inline");
    }
    else {
      action_delete_header("X-Spam-Score");
    }
  }
}

>
> You say "spamassassin filter", do you mean yet another milter besides 
> MIMEDefang?
No, I just don't really know the correct terminology I guess.  As far as 
I know, mimedefang hands the mail to spamassassin, and gets a result 
back, but from a sendmail point of view, the only milter it uses is 
mimedefang.

Thanks for your time.
-Aubrey
>
> Bye,
>
> n/li



More information about the MIMEDefang mailing list