[Mimedefang] configuring mimedefang-filter to reject during smtp

Juergen Kleff juergen.kleff at gmx.de
Thu Jan 21 06:59:55 EST 2010


Am Dienstag Januar 19 2010 09:57 schrieb Tilman Schmidt:
> Am 2010-01-18 01:44 schrieb Tony:
> > Can anyone provide a mimedefang-filter example that shows the correct
> > syntax to reject during smtp? [...] In the mimedefang-filter file I see
> > entries to change the header and do this and that but all I'm
> > intetested in is rejecting during smtp. Thanks for any advice.
>
> The key is the action_bounce method. As an example, here's a patch hunk
> for mimedefang-filter to reject messages with suspicious characters in
> headers during the SMTP dialogue instead of dropping them (beware of
> line wraps):
>
> @@ -118,7 +130,9 @@
>  	md_graphdefang_log('suspicious_chars');
>  	# action_quarantine_entire_message("Message quarantined because of
> suspicious characters in headers");
>  	# Do NOT allow message to reach recipient(s)
> -	return action_discard();
> +	# Don't discard; bounce as per #ss9.5
> +	# return action_discard();
> +	return action_bounce("Message rejected; illegal characters in message
> (per RFC 2821, 2822)");
>      }
>
>      # Copy original message into work directory as an "mbox" file for
>
>
> HTH
> T.

I do it this way:

if ($hits >= 1.5 * $req) {
  action_bounce("Reject because mail is considered SPAM");
  md_graphdefang_log('rejected_spam', $hits, $RelayAddr);
  return;
}

in mimedefang-filter just after mimedefang got the number of hits from 
spamassassin

Jürgen
-- 
Diese E-Mail wurde klimafreundlich
und atomstromfrei erzeugt:
http://www.atomausstieg-selber-machen.de/



More information about the MIMEDefang mailing list