[PREVIOUS CHAPTER] [NEXT CHAPTER]
4 Internals

4.1	Filtering

	$USE_DISTRIBUTE_FILTER


enables the filtering for distribute mails. This filter checks
in-coming mails based on %Envelope data. You can set up your own hook
using %Envelope. 

	$USE_DISTRIBUTE_FILTER


loads the following filter rule in default.


	* reject null body
	* reject one line English words mail
	  e.g. "help", "unsubscribe"
	* reject invalid Message-Id mails (may be SPAM mails)
	* other strange syntaxes

   [options]

	$FILTER_ATTR_REJECT_COMMAND (default 0)


	reject '#unsubscribe' like commands

	$FILTER_ATTR_REJECT_2BYTES_COMMAND (default 0)


	* reject a line begining with Japanese 2-byte English Characters
	  e.g. 2-byte "unsubscribe"


You can use a hook to write your own more complicated filtering rules.
Attention: in this hook you can refer %Envelope as %e.

	$DISTRIBUTE_FILTER_HOOK (for post)

	$COMMAND_FILTER_HOOK (for command)


In this hook, please write in the following way.


	* if reject, write the code
		return 'the reason of rejection';
	  where this reason is logged in $LOGFILE.
	* if OK, 
		return '';	 


In default fml.pl does not notify the reason of rejection to the
sender (From: address) since no more information is good for security
in one sense. If you want to notify the rejection to the sender, set

	$FILTER_NOTIFY_REJECTION


fml-support: 08182 } } } } 4.3 Reject if a field matches reject patterns

	&DEFINE_FIELD_PAT_TO_REJECT(field-name, regexp, reason)

Define regular expression for a field. Please see an examle below.
XXX "reason" is not yet implemented now.

$START_HOOK = q# if ($USE_DISTRIBUTE_FILTER) { &EnvelopeFilter(*e, 'distribute'); undef $DO_NOTHING; } #; [PREVIOUS CHAPTER] [NEXT CHAPTER]