[Mimedefang] set mimedefang to not scan authenticated users

maillist maillist at emailacs.com
Fri Apr 18 10:16:39 EDT 2008


>
> Because you re-route the mail to a spamdrop and no native user gets the
> message, I'd NOT add the SPAM report. Will the (human?) SPAM processor
> read this report for other reasons than simple curiosity? If you release
> the message to a native user, this report will bother him/her, I guess.
I manually do this, but you're right, I don't care about that report.

Using your advice and instructions, I came up with this configuration, 
and it seems to be working as planned:

sub filter_end {
  my($entity) = @_;
  return if message_rejected();
  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");
    }
  }
}

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

sub filter_sender{
  my($sender, $ip, $hostname, $helo) = @_;
  read_commands_file();    # Get %SendmailMacros hash
  ### notice: This assumes authentication without realm!
  if($SendmailMacros{'auth_authen'}) {    # authentificated
    return('ACCEPT_AND_NO_MORE_FILTERING', "ok");
  }
}

I am in process of learning Perl, but so far, a 15-month-old, and a 
pregnant wife keep my time for learning new languages to a minimum.  But 
you sir, have helped more than you know.

-Aubrey



More information about the MIMEDefang mailing list