Mailmun...Response(3)

πŸ“¦ version 3.20, in alpine 3.24

πŸ’Œ NAME πŸ’Œ

okay bestie, this is the Mailmunge::Response(3) page β€” User Contributed Perl Documentation, and it's the whole vibe of Mailmunge::Response: it encapsulates the response you send back to Milter. πŸ’…

🫧 ABSTRACT 🫧

Mailmunge::Response holds all of the information needed to reply to an SMTP connection request or an SMTP command such as HELO, MAIL From: and RCPT To:. It's giving "final answer, but make it SMTP" energy. ✨

✨ SYNOPSIS ✨

           use Mailmunge::Response;

           sub filter_sender {
               my ($self, $ctx) = @_;
               # Everything's OK
               return Mailmunge::Response->new(status => 'CONTINUE');

               # Reject
               return Mailmunge::Response->new(status => 'REJECT',
                                               message => $ctx->sender . ' is unwelcome');

🌟 CLASS METHODS 🌟

Mailmunge::Response->new($key1 => $val1 [, $key2 => $val2...])

Creates a new Mailmunge::Response object. The arguments are a series of "key => val" pairs. Possible keys are:

  • status β€” the status to return. This is one of the following strings:
    • CONTINUE β€” accept the SMTP command with a 2xx status code.
    • TEMPFAIL β€” tempfail the SMTP command with a 4xx status code.
    • REJECT β€” reject the SMTP command with a 5xx status code.
    • DISCARD β€” accept the SMTP command, but discard the message rather than delivering it.
    • ACCEPT_AND_NO_MORE_FILTERING β€” accept the SMTP command, and do no further filtering of the message.
  • code β€” a 3-digit SMTP reply code. If not supplied, an appropriate code is picked based on the value of status.
  • dsn β€” a 3-numbered SMTP DSN of the form X.Y.Z. If not supplied, an appropriate DSN is picked based on the value of status.
  • message β€” a text message to include in the SMTP reply. If not supplied, an appropriate message is picked based on the value of status.
  • delay β€” a delay in seconds; if non-zero, mailmunge will pause for this many seconds before replying to the MTA.
⚠️ okay so about delay: this parameter should be used with caution; if used at all, the delay should be at most a few seconds. fr fr, do not turn this into a nap break. 😭

Mailmunge::Response->CONTINUE(...)

Equivalent to Mailmunge::Response->new(status => 'CONTINUE', ...).

Mailmunge::Response->ACCEPT_AND_NO_MORE_FILTERING(...)

Equivalent to Mailmunge::Response->new(status => 'ACCEPT_AND_NO_MORE_FILTERING', ...).

Mailmunge::Response->DISCARD(...)

Equivalent to Mailmunge::Response->new(status => 'DISCARD', ...).

Mailmunge::Response->TEMPFAIL(...)

Equivalent to Mailmunge::Response->new(status => 'TEMPFAIL', ...).

Mailmunge::Response->REJECT(...)

Equivalent to Mailmunge::Response->new(status => 'REJECT', ...).

πŸ‘‘ INSTANCE METHODS πŸ‘‘

code([$val])

Returns the code value. If an argument is supplied, the code is set to that value.

dsn([$val])

Returns the dsn value. If an argument is supplied, the dsn is set to that value.

delay([$val])

Returns the delay value. If an argument is supplied, the delay is set to that value.

message([$val])

Returns the message value. If an argument is supplied, the message is set to that value.

status([$val])

Returns the status value. If an argument is supplied, the status is set to that value. If you supply an invalid status, then this method croaks. πŸ’€

fix_code_dsn()

Fix up the code and dsn members so they make sense for the given status. For example, if status is TEMPFAIL, then code must be 4xx and dsn must be 4.m.n.

is_tempfail()

Returns true if status is TEMPFAIL; false otherwise.

is_discard()

Returns true if status is DISCARD; false otherwise.

is_reject()

Returns true if status is REJECT; false otherwise.

is_success()

Returns true if status is CONTINUE or ACCEPT_AND_NO_MORE_FILTERING; false otherwise.

is_success_or_discard()

Returns true if status is CONTINUE, DISCARD or ACCEPT_AND_NO_MORE_FILTERING; false otherwise.

πŸ’– AUTHOR πŸ’–

Dianne Skoll <dianne@skollsoft.com> β€” iconic, honestly. πŸŽ€

πŸ“œ LICENSE πŸ“œ

This code is licensed under the terms of the GNU General Public License, version 2.

πŸ”— SEE ALSO πŸ”—

  • Mailmunge::Filter
  • Mailmunge::Context
  • mailmunge
  • mailmunge-multiplexor

source/version vibes: perl v5.42.2, dated 2025-10-05, and the page footer name is Mailmun...Response(3). bye bestie, go slay those SMTP replies πŸ’–βœ¨

πŸ“¦ where this page comes from