[Mimedefang]Localhost Messages Cause 'reject=451 4.7.1 Please try again later'

Michael Sims michaels at crye-leike.com
Wed Mar 17 15:17:56 EST 2004


Jason Granat wrote:
> Michael,
>
> Ok.  So as this is very deep for me, how can I quit calling
> SpamAssassin the second time, yet be able to rewrite the headers?
> Should I do the rewrite in sub defang_warning after INPUTMSG?

No, just change filter_end.  Take all of these lines:

------------------------------------------------------------------
action_change_header("Subject", "*****SPAM***** $Subject");
action_add_header("X-Orig-Rcpts", join(", ", @Recipients));
foreach $recip (@Recipients) {
  delete_recipient($recip);
}
add_recipient('spambucket at mydomain.com');
------------------------------------------------------------------

And put them inside the ($hits >= $req) block, so it looks like this:

------------------------------------------------------------------
if ($hits >= $req) {
  action_change_header("X-Spam-Score", "$hits ($score) $names");
  md_graphdefang_log('spam', $hits, $RelayAddr);

  # Change Subject: header
  action_change_header("Subject", "*****SPAM***** $Subject");

  # Add a header with original recipients, just for info
  action_add_header("X-Orig-Rcpts", join(", ", @Recipients));

  # Remove original recipients
  foreach $recip (@Recipients) {
    delete_recipient($recip);
  }

  # Send to spam address
  add_recipient('spambucket at mydomain.com');

  # If you find the SA report useful, add it, I guess...
  action_add_part($entity, "text/plain", "-suggest",
                  "$report\n", "SpamAssassinReport.txt", "inline");
} else {
  # Delete any existing X-Spam-Score header?
  action_delete_header("X-Spam-Score");
}
------------------------------------------------------------------

Then delete the two blocks you have that check spam_assassin_is_spam().  It
looks to me that it will do exactly what you were doing, except that it will
only call SpamAssassin once, and it won't call it at all on messages larger
than 100k...

___________________________________________
Michael Sims
Project Analyst - Information Technology
Crye-Leike Realtors
Office: (901)758-5648  Pager: (901)769-3722
___________________________________________



More information about the MIMEDefang mailing list