Mail::...tispam(3)

πŸ’– Mail::MIMEDefang::Antispam πŸ’–

okay bestie, welcome to Mail::MIMEDefang::Antispam(3) β€” the antispam corner of the MIMEDefang docs, and honestly? it's giving tiny but powerful. πŸ¦‹


✨ NAME ✨

Mail::MIMEDefang::Antispam β€” the antispam-related methods for your email filters, no cap. πŸ’…


🌸 DESCRIPTION 🌸

so basically, Mail::MIMEDefang::Antispam is a little collection of methods you can call from mimedefang-filter to run your email messages through antispam software and see what's up. that's the whole vibe. πŸŽ€


πŸ‘‘ METHODS πŸ‘‘

spam_assassin_is_spam πŸ”₯

scans a message with SpamAssassin and returns True if the email got flagged as spam. simple. iconic. one job, does it. ✨

spam_assassin_check πŸ’œ

scans a message with SpamAssassin and hands you back an array of four elements, in this exact order:

  • the weight of the message ('hits')
  • the number of hits required before SA considers a message spam
  • a comma separated list of symbolic test names that were triggered
  • a 'report' string, detailing the tests that failed and their weights

spam_assassin_status 🫢

scans a message with SpamAssassin and returns a Mail::SpamAssassin:PerMsgStatus object.

heads up bestie β€” you, the caller, are responsible for calling the finish method. that's on you, not on this sub. don't leave it hanging. 😭

spam_assassin_init ⭐

initializes Apache SpamAssassin and returns a Mail::SpamAssassin object. that's it, that's the sub. 🌈

spam_assassin_mail 🧚

calls SpamAssassin and returns a Mail::SpamAssassin::Message object. cute little message object for you. πŸ’–

md_spamc_init πŸ“

initializes Apache SpamAssassin and returns a Mail::SpamAssassin::Client object.

real talk: md_spamc_init and md_spamc_check should be used only with Apache SpamAssassin starting from version 4.0.1. don't come for me, that's just the rule. πŸ’€

the sub returns a Mail::SpamAssassin::Client object.

optional parameters, in case you wanna get fancy:

  • the SpamAssassin host
  • the SpamAssassin port
  • the username to pass to the SpamAssassin server
  • the maximum size of the email message

md_spamc_check πŸ’…

scans the message using the SpamAssassin Perl client and returns an array of four elements:

  • the weight of the message ('score')
  • the number of hits required before Apache SpamAssassin considers a message spam
  • a 'report' string, detailing the tests that failed and their weights
  • a flag explaining if the email is a spam message or not (true/false)

required parameter: a Mail::SpamAssassin::Client object initialized by calling the md_spamc_init sub. gotta have it, no shortcuts. πŸŽ€

rspamd_check 🌈

scans the message using Rspamd and returns an array of six elements:

  • the weight of the message ('hits')
  • the number of hits required before Rspamd considers a message spam
  • a comma separated list of symbolic test names that were triggered
  • a 'report' string, detailing the tests that failed and their weights β€” or a Json report if the JSON and LWP modules are present
  • an action that should be applied to the email
  • a flag explaining if the email is a spam message or not (true/false)

you can also pass an optional rspamd url to the method, and its default value is:

http://127.0.0.1:11333

and that's the whole page, bestie!! go forth and filter those spams, you absolute main character. πŸ‘‘

this was version 3.7.1, dated 2026-07-20, straight out of the Mail::MIMEDefang::Antispam documentation β€” mwah, bye!! πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from