[PREVIOUS CHAPTER]
[NEXT CHAPTER]
5 ContentHandler
5.1 Filtering Rule Examples
* delete the html part of text/plain and text/html
&ADD_CONTENT_HANDLER('multipart/.*', 'text/html', 'strip+notice');
* through text/plain
delete the html part of text/plain + text/html
delete other all
&ADD_CONTENT_HANDLER('multipart/.*', 'text/plain', 'allow');
&ADD_CONTENT_HANDLER('multipart/.*', 'text/html', 'strip+notice');
&ADD_CONTENT_HANDLER('multipart/.*', '.*/.*', 'strip');
5.2 description by the original author
Author: t-nakano@marimo.org
# [Example]
# add them at the last of config.ph (but before the last "1;").
#
&ADD_CONTENT_HANDLER('multipart/.*', 'text/plain', 'allow');
&ADD_CONTENT_HANDLER('multipart/.*', '.*/.*', 'reject');
&ADD_CONTENT_HANDLER('text/plain', '.*/.*', 'allow');
&ADD_CONTENT_HANDLER('!MIME', '.*/.*', 'allow');
&ADD_CONTENT_HANDLER(type, subtype, action);
type MIME type of whole mail
subtype content type of each block
action action if the type matches
&ADD_CONTENT_HANDLER('multipart/.*', 'text/plain', 'allow');
pass only text/plain block in MIME multipart mail
&ADD_CONTENT_HANDLER('multipart/.*', '.*/.*', 'reject');
reject any mail with MIME multipart format
Filtering based on each MIME entity block, Content-Type: field
in the mail
allow permit distribution of this post
allow+multipart permit the mail and leave the entity as it is
allow+multipart pass through the block but allow disassembles
the multipart
strip strip this type entity block and distribute it
strip+notice strip this type entity block (same as "strip")
and also tell the sender "we strip the entity off".
reject reject this whole mail if only one block matches
the type
Filtering FAQ is
http://www.ii.com/internet/faqs/launchers/mail/filtering-faq/
The plain text version is
ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq
[procmail faq]
Html and text version of pm-tips
http://www.procmail.org/jari/pm-tips.html
http://www.procmail.org/jari/pm-tips.txt
Other procmail docuemts
Era's exellent procmail pages (including procmail faq) are at:
http://www.iki.fi/~era/procmail/links.html
http://www.iki.fi/~era/procmail/mini-faq.html
6.2 MH slocal Interface
MH slocal is used like
"|/usr/local/lib/mh/slocal -user username || exit 75"
in ~/.forward
"|/usr/local/lib/mh/slocal -user username || exit 75"
Example:
Mail with "To: username@domain (uja)" is injected to fml.pl.
All others are saved in /var/mail/fukachan.
#field pattern action result string
To uja | R "/fml-DIR/fml.pl /fml-DIR /fml-DIR"
# drop to the personal mail-spool
default - > ? /var/mail/fukachan
[PREVIOUS CHAPTER]
[NEXT CHAPTER]