MIMEFILTER(1) | Debian GNU/Linux Manual | MIMEFILTER(1) |
mimefilter - filter a MIME message stripping unwanted MIME parts
mimefilter [OPTIONS]
The mimefilter script accept on STDIN a MIME conforming message, and outputs on STDOUT a MIME conforming message.
It strips every unwanted MIME part, warning by email the original author about this, and outputs a MIME compliant cleaned message, to be further processed by a mailing list software.
You may find it useful if you don't want certain attachments on your mailing lists, or if you want to allow just the text part from multipart/alternative messages, and so on. You can easily fine tune the list of allowed MIME types to suit your particular needs, using normal Perl regexps.
The mimefilter script may take just an option, in either its short or long form:
However, the mimefilter script won't bark at you if it discovers you supplied some other options as well, it'll just politely ignore them.
The mimefilter script cheerfully takes an unlimited number of command line arguments and happily discards them all.
The mimefilter script will look for a system wide configuration file in /etc/mimefilter.rc, and for a local, per working directory, configuration file in ./mimefilter.rc. The latter may be used to override any or all of the parameters defined by the former, thus allowing easily per mailing list customization.
Several configuration parameters are provided, the most important being the list of admissible MIME types (where Perl regexps may be used), along with the list of never to be allowed ones (so that you may even specify, e.g., 'text/.*' in the admissible types list and 'text/html' in the never to be allowed one, to allow every text part but html ones).
See the default configuration file for examples of use and further documentation.
The mimefilter script will look for the following environment variables:
The Smartlist mailing list software will automatically pass this variable to mimefilter.
The Smartlist mailing list software will automatically pass this variable to mimefilter.
The Smartlist mailing list software will automatically pass this variable to mimefilter.
The Smartlist mailing list software will automatically pass this variable to mimefilter.
Users of the Smartlist mailing list software may conveniently set this variable in rc.custom.
filter_mime = yes
The mimefilter script returns 0 on success and a positive integer on errors.
Put the following lines in rc.local.s[012]0 (the right one just depends on your specific needs, look at rc.submit for more info):
:0 * filter_mime ?? y { # Pass the mail trough mimefilter :0 fw | mimefilter # Executed if mimefilter died :0 e { :0 hfw | formail -A "X-Diagnostic: MIME filtering failed" HOST=continue_with_rc.request } # Trash empty messages (author's already been warned by mimefilter) :0 Bh * < 1 /dev/null }
Also remember to uncomment the appropriate line in rc.custom, to activate rc.local.s[012]0, and don't forget to customize the list of admissibile and never to be allowed MIME types in the configuration file(s).
The author believes no particular arrangements are necessary to use this script with mailing list software other than Smartlist, altough one should remember that mimefilter expects to find at least the list, listaddr, and listreq environment variables set.
The Smartlist mailing list software documentation, the mimefilter.rc(5) man page (yet to be written).
Naaa... ;-)
This program is copylefted. Refer to the GNU General Public License for conditions of use.
This program has been written and is actively maintained by Davide Giovanni Maria Salvetti, <salve@linux.it>.
This script was originally aimed for use with a bunch of Smartlist served maling lists the author administers. He believes it can be successfully used with other mailing list softwares as well.
2020-09-03 | Debian Project |