Mail::M...g::MIME(3)

✨ Mail::M...g::MIME(3) ✨

okay bestie, welcome to the Mail::MIMEDefang::MIME Documentation page πŸ’– this is the Mail::M...g::MIME(3) manual, and yes the name is doing that thing where it gets squished in the header, we love her anyway πŸŽ€


🌸 NAME 🌸

Mail::MIMEDefang::MIME β€” MIME objects interface methods for email filters πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

Mail::MIMEDefang::MIME is literally a whole set of methods you can call from mimedefang-filter to operate on MIME objects. that's the vibe. it's giving "let me touch your MIME parts" and honestly? iconic. πŸ‘‘


πŸ”₯ METHODS πŸ”₯

🌈 collect_parts

Method that adds parts to the array @FlatParts for flattening. no cap, that's the whole job. πŸ’«

🌈 takeStabAtFilename ( $entity )

Makes a guess at a filename for the attachment. she's guessing, but she's guessing smart β€” it calls MIME::Head's recommended_filename() method, which tries Content-Disposition.filename and if that's not found, Content-Type.name.

Returns a MIME-decoded filename, or a blank string if none found. so like, '' if she can't find anything. don't come for her. πŸ™ˆ

🌈 find_part

Method that returns the first MIME entity of type $content_type, "undef" if none exists. first match wins, periodt. ✨

🌈 append_to_part

Method that appends text to $part. simple. clean. slay. πŸ’…

🌈 remove_redundant_html_parts

Method that rebuilds the email message without redundant HTML parts. that is, if a multipart/alternative entity contains text/plain and text/html parts, the text/html part will be removed. goodbye redundant html, you will not be missed 🫢

🌈 append_to_html_part

Method that appends text to the spicified mime part, but does so by parsing HTML and adding the text before </body> or </html> tags. yes, "spicified" β€” that's the original's typo and we are keeping it, it's part of the family now 😭

🌈 append_text_boilerplate

Method that appends text to text/plain part or parts. plural. she does not discriminate. 🌸

🌈 append_html_boilerplate

Method that appends text to text/html part or parts. It tries to be clever and inserts the text before the </body> tag to be able of being seen. main character energy fr fr β€” she wants to be seen πŸ‘‘πŸ’–

🌈 anonymize_uri

Anonymize urls by removing all utm_* parameters, takes the message part as parameter and returns a boolean value if the sub succeeded or not. tracking parameters? not on her watch. 🧚✨


lowkey a warning-ish aside for you bestie: append_to_html_part needs actual HTML to parse, and append_html_boilerplate only manages that </body> trick because it's trying to be clever. and remember, takeStabAtFilename can hand you a blank string, so check before you use it πŸ’€

and that's the whole page, bestie!! this was Mail::MIMEDefang::MIME from version 3.7.1, dated 2026-07-20 β€” go forth and filter those emails, you absolute legend πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from