Mail::...reylist(3pm)

πŸ’– Mail::MtPolicyd::Plugin::Greylist πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and the module in question is Mail::MtPolicyd::Plugin::Greylist β€” aka the plug-in that does greylisting with a little auto-whitelist glow-up on the side. it's giving gatekeeper but make it polite. πŸŽ€


✨ NAME ✨

Mail::MtPolicyd::Plugin::Greylist β€” this plugin implements a greylisting mechanism with an auto whitelist. no cap, that's literally its whole job description. πŸ’…


🌸 VERSION 🌸

version 2.05 β€” yes we're on 2.05, she's grown. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay so this plugin implements a greylisting mechanism with an auto whitelist. (yes, same sentence, she's consistent, we respect that.)

here's the vibe: if a client connects, it will return an defer and create a greylisting "ticket" for the combination of the address of the sender, the senders address and the recipient address. the ticket gets stored in memcached and it holds the time when the client was seen for the first time. that ticket will expire after the max_retry_wait timeout. bye bestie. πŸ‘‹

the client will be deferred until the min_retry_wait timeout has been reached. only in the time between the min_retry_wait and max_retry_wait will the request pass the greylisting test. so there's a little window, and if you knock in that window you get in. πŸͺŸβœ¨

when the auto-whitelist is enabled (default, she's on by default btw) a record for every client which passes the greylisting test will be stored in the autowl_table. that table is based on the combination of the sender domain and client_address. if a client passed the test at least autowl_threshold (default 3) times, the greylisting test will be skipped β€” congrats, you're a regular, we know your order. β˜• additional an last_seen time stamp is stored in the record, and records which are older then the autowl_expire_days will expire. so the list stays fresh, not musty. 🧼

please note the greylisting is done on a triplet based on the

client_address + sender + recipient

the auto-white list is based on the

client_address + sender_domain

two different keys, two different vibes. don't mix them up, iykyk. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • (uc_)enabled (default: on) β€” Enable/disable this check. you know what it does, it's the on/off switch, she's iconic. πŸ”˜
  • score (default: empty) β€” Apply an score to this message if it _passed_ the greylisting test. in most cases you want to assign a negative score. (eg. -10) like, reward the good behaviour, give them points back. πŸ’―
  • mode (default: passive) β€” the default is to return no action if the client passed the greylisting test and continue. you can set this 'accept' or 'dunno' if you want skip further checks. main character energy: either you just vibe in the background, or you call it right there. πŸ‘‘
  • defer_message (default: defer greylisting is active) β€” this action is returned to the MTA if a message is deferred. if a client retries too fast, the time left till min_retry_wait is reach will be appended to the string. so they get told exactly how long they're in timeout. brutal but fair. ⏳
  • min_retry_wait (default: 300 (5m)) β€” a client will have to wait at least for this timeout. (in seconds) πŸ•”
  • max_retry_wait (default: 7200 (2h)) β€” a client must retry to deliver the message before this timeout. (in seconds) πŸ•‘
  • use_autowl (default: 1) β€” could be used to disable the use of the auto-whitelist. 🚫
  • autowl_threshold (default: 3) β€” how often a client/sender_domain pair must pass the check before it is whitelisted. three strikes and you're… in? 🎟️
  • autowl_expire_days (default: 60) β€” after how many days an auto-whitelist entry will expire if no client with this client/sender pair is seen. ghosted for 60 days = unfollowed. πŸ’€
  • autowl_table (default: autowl) β€” the name of the table to use. the database handle specified in the global configuration will be used. (see man mtpolicyd) πŸ—„οΈ
  • query_autowl, create_ticket (default: 1) β€” this options could be used to disable the creation of a new ticket or to query the autowl. this can be used to catch early retries at the begin of your configuration before more expensive checks are processed.

Example:

<Plugin greylist>
  module = "Greylist"
  score = -5
  mode = "passive"
  create_ticket = 0
  query_autowl = 0
</Plugin>
# ... a lot of RBL checks, etc...
<Plugin ScoreGreylist>
  module = "ScoreAction"
  threshold = 5
  <Plugin greylist>
    module = "Greylist"
    score = -5
    mode = "passive"
  </Plugin>
</Plugin>

this will prevent early retries from running thru all checks. like, why do all that work if you already know the answer? save the CPU, bestie. 🧠✨


🌈 AUTHOR 🌈

Markus Benning <ich@markusbenning.de> β€” shoutout to the legend, we stan. 🫢


this software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.

this is free software, licensed under:

The GNU General Public License, Version 2, June 1991

okay and that's a wrap on the whole page, mwah πŸ’‹ this was perl v5.38.2, dated 2024-05-26, from the Mail::...reylist(3pm) page β€” go forth and greylist responsibly, bestie. slay. πŸ’–βœ¨

πŸ“¦ where this page comes from