Mail::...Actions(3)

πŸŽ€ Mail::...Actions πŸŽ€

okay so hi bestie πŸ’– welcome to Mail::...Actions(3) β€” the manual page for Mail::MIMEDefang::Actions Documentation. it's giving filter-girlboss, it's giving mail-server main character, and we're gonna read the whole thing together. no skimming. let's go πŸ¦‹


✨ NAME ✨

Mail::MIMEDefang::Actions β€” actions methods for email filters 🌸


πŸ’… DESCRIPTION πŸ’…

Mail::MIMEDefang::Actions is a whole set of methods you can call from mimedefang-filter to accept or reject the email message. that's the vibe. that's the whole job. πŸ‘‘


🌈 METHODS 🌈

action_rebuild

Sets a flag telling MIMEDefang to rebuild the message even if it is unchanged. like, yes we know nothing changed, we're rebuilding anyway, deal with it ✨

action_add_entity

Makes a note to add a part to the message. and here's the tea: parts are *actually* added at the end β€” that's the whole trick, because it lets us correctly handle non-multipart messages, or multipart/foo where "foo" != "mixed". Sets the rebuild flag too. πŸŽ€

action_add_part

Makes a note to add a part to the message. same deal as above, bestie: parts are *actually* added at the end, which lets us correctly handle non-multipart messages or multipart/foo where "foo" != "mixed". Sets the rebuild flag. πŸ’–

process_added_parts

This is the one that actually adds the requested parts to the entity, fr fr. it also ensures that the entity is of type multipart/mixed. slay πŸ’…

action_insert_header

Makes a note for the milter to insert a header in the message in the specified position.

⚠️ heads up bestie β€” this may not be supported on all versions of Sendmail. on unsupported versions, the C milter falls back to action_add_header.

action_add_header

Makes a note for the milter to add a header to the message. 🫢

action_change_header

Makes a note for the milter to change a header in the message. glow-up, but for headers ✨

action_delete_header

Makes a note for the milter to delete a header in the message. gone. blocked. unfollowed πŸ’€

action_delete_all_headers

Makes a note for the milter to delete all instances of header. every last one. no survivors πŸ‘‘

action_accept

Makes a note for the milter to accept the current part. yes queen, come through 🌸

action_accept_with_warning

Makes a note for the milter to accept the current part, but add a warning to the message. accepting you, but with notes. πŸ“

message_rejected

Method that returns True if the message has been rejected (with action_bounce or action_tempfail), and false otherwise. a simple yes/no, very demure πŸŽ€

action_drop

Makes a note for the milter to drop the current part without any warning. silent treatment, but make it SMTP πŸ’€

action_drop_with_warning

Makes a note for the milter to drop the current part and add a warning to the message. at least she told you why πŸ™ˆ

action_replace_with_warning

Makes a note for the milter to drop the current part and replace it with a warning. out with the old, in with the caution tape ⚠️

action_defang

Makes a note for the milter to defang the current part by changing its name, filename and possibly its MIME type. disarming, but make it fashion πŸ’…

action_external_filter

Pipes the part through the UNIX command $cmd, and replaces the part with the result of running the filter. sending it through the pipeline, literally 🚰

action_quarantine

Makes a note for the milter to drop the current part, emails the MIMEDefang administrator a notification, and quarantines the part in the quarantine directory. it's giving timeout corner πŸͺ‘

action_sm_quarantine

Asks Sendmail to quarantine the message in mqueue using Sendmail's smfi_quarantine facility. not our timeout corner β€” Sendmail's timeout corner 🧚

get_quarantine_dir

Method that returns the configured quarantine directory. one method, one job, iconic πŸŽ€

action_greylist($dbh, $sender, $recipient, $ip, $min_retry, $max_retry)

okay this one is a whole saga so stay with me bestie 🫢

  • $dbh is a DBI handle connected to the greylist database. that $dbh object should be initialized in the filter_initialize sub.
  • $min_delay and $max_delay are the minimum and maximum retry delays respectively, and those parameters are optional β€” the default values are 300 and 14400 seconds.
  • If an SMTP client tries to deliver email faster, it will continue to be greylisted. ⏳
  • $ip, $sender and $recipient are used to identify a unique connection.
  • If it waits longer, it will begin the greylisting test from scratch. πŸ”
  • $ip is the IP address of the connecting SMTP client β€” and to greylist an entire subnet, you can pass the subnet instead.
  • In the "filter_cleanup" sub, the database connection should be closed.
ngl, the signature up top says $min_retry and $max_retry while the prose says $min_delay and $max_delay. I'm just the messenger πŸ’€

Returns "tempfail" if a new sender sends the email from a new ip address, "continue" if the email is allowed to pass, or "reject" if the email has been greylisted for too much time.

action_quarantine_entire_message

Method that puts a copy of the entire message in the quarantine directory. the whole thing. no crumbs left behind πŸ“

action_bounce

Method that causes the SMTP transaction to fail with an SMTP 554 failure code and the specified reply text. If code or DSN are omitted or invalid, use 554 and 5.7.1. bye πŸ‘‹

action_discard

Method that causes the entire message to be silently discarded without notifying anyone. not a word. not a peep. 🀫

action_notify_sender

Method that sends an email to the sender containing the $msg. sliding into their inbox with receipts βœ‰οΈ

action_notify_administrator

Method that sends an email to the MIMEDefang administrator containing the $msg. telling on them, but to the admin πŸ’Œ

action_tempfail

Method that sends a temporary failure with a 4.x.x SMTP code. If code or DSN are omitted or invalid, use 451 and 4.3.0. not a no, just a not-right-now πŸ•

add_recipient

Signals to MIMEDefang to add a recipient to the envelope. plus one on the guest list 🎟️

delete_recipient

Signals to MIMEDefang to delete a recipient from the envelope. removed from the guest list πŸ’€

change_sender

Signals to MIMEDefang to change the envelope sender. new sender, who dis 🌟

action_replace_with_url

Method that places the part in doc_root/{sha1_of_part}.ext and replaces it with a text/plain part giving the URL for pickup. link in bio, but for attachments πŸ”—


okay bestie that's the whole page, you ate that πŸ’– this was Mail::...Actions(3) from Mail::MIMEDefang::Actions Documentation, version 3.7.1, dated 2026-07-20. go forth and filter, ily, periodt πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from