MIMEDEFANG.PL(8)
π MIMEDEFANG.PL(8) π
okay bestie, welcome to the System Manager's Manual entry for mimedefang.pl, and trust me when I say this little Perl script is doing the absolute most π
β¨ NAME β¨
mimedefang.pl β a Perl script whose whole job is scanning MIME messages. that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
mimedefang.pl [-f filter] dir
π DESCRIPTION π
so mimedefang.pl is a Perl script built to run alongside mimedefang(8) β they're a duo, a package deal, the main characters fr fr π
it takes exactly one argument, and that argument is a directory. and not just any directory β it needs to be laid out the way mimedefang(8) describes. the layout matters, no cap. π
π OPTIONS π
-ffilter β tells it the name of the file that holds your filter. skip this option entirely and it just uses the default filter,/etc/mail/mimedefang-filter, like it's not even stressed about it β¨
π₯ OPERATION π₯
here's the tea: mimedefang.pl evaluates the file /etc/mail/mimedefang-filter as a Perl fragment. that file is supposed to define the filter procedure β that's its whole purpose in life, its moment π«Ά
then, for each and every part of a MIME message, mimedefang.pl calls filter and disposes of that part exactly the way the filter tells it to. no improvising, no freelancing, it just does what it's told π
all the different modes of disposition are described over in mimedefang-filter(5) if you wanna go deep. iykyk π
π§ TESTING FILTERS π§
bestie, listen. you are strongly recommended to test your filter before you install it into /etc/mail/mimedefang-filter. do not skip this step, i am begging π
to test it, save your filter in a file (something like test-filter, cute and simple), then run this:
mimedefang.pl -f test-filter -test
this checks the filter for syntactic correctness β just syntax, that's the whole check β
if it passes, congrats, you can install it as a production filter and live your truth π
β οΈ but real talk: this test only tests for correct Perl syntax. it does not make sure your filter actually does something sensible. syntax-correct and sensible are two completely different things, and only one of them is being verified here π
π MISCELLANEOUS OPTIONS π
there are a few other ways to invoke mimedefang.pl, and they're all lowkey iconic in their own way:
mimedefang.pl -features
this one prints a list of the detected optional Perl modules. the output looks something like this:
SpamAssassin: yes
mimedefang.pl -validate
this one calls the function filter_validate, if it's defined in your filter. filter_validate should return an integer, and that integer becomes the exit code β it's giving "your return value is your destiny" π«
and if filter_validate does not exist? an error message gets printed and mimedefang.pl exits with an exit code of 1. rude, but fair π
π AUTHOR π
mimedefang.pl was written by Dianne Skoll <dfs@roaringpenguin.com> β an absolute legend, we stan π
the mimedefang home page is https://www.mimedefang.org/
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this one came from the 4th Berkeley Distribution, dated 8 February 2005 β vintage, nostalgic, still slaying β¨π mwah, go test your filters π
π¦ where this page comes from
- epel 10: mimedefang 3.7.1-1.el10_3 Β· GPL-2.0-only AND GPL-2.0-or-later
- epel 9: mimedefang 3.7.1-1.el9 Β· GPL-2.0-only AND GPL-2.0-or-later
- fedora 43: mimedefang 3.6-3.fc43 Β· GPL-2.0-only AND GPL-2.0-or-later
- fedora 43: mimedefang 3.7.1-1.fc43 Β· GPL-2.0-only AND GPL-2.0-or-later
- fedora 44: mimedefang 3.6-4.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later
- fedora 44: mimedefang 3.7.1-1.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms