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 πŸ’…

  • -f filter β€” 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