[Mimedefang] configuring mimedefang-filter to reject during smtp

Tilman Schmidt t.schmidt at phoenixsoftware.de
Tue Jan 19 03:57:55 EST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

- -- 
Tilman Schmidt
Phoenix Software GmbH
Adolf-Hombitzer-Str. 12
53227 Bonn, Germany
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktVdBMACgkQ780oymN0g8MllQCgzrDAtTBLkNaYVICDoP9B8ta/
6dYAnA/IzSfOqTydZevZsrZ6ff+VAN7i
=OvgS
-----END PGP SIGNATURE-----



More information about the MIMEDefang mailing list