Mailmun...Response(3)
π 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 a2xxstatus code.TEMPFAILβ tempfail the SMTP command with a4xxstatus code.REJECTβ reject the SMTP command with a5xxstatus 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β a3-digitSMTP reply code. If not supplied, an appropriate code is picked based on the value ofstatus.dsnβ a 3-numbered SMTP DSN of the formX.Y.Z. If not supplied, an appropriate DSN is picked based on the value ofstatus.messageβ a text message to include in the SMTP reply. If not supplied, an appropriate message is picked based on the value ofstatus.delayβ a delay in seconds; if non-zero,mailmungewill 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::FilterMailmunge::Contextmailmungemailmunge-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
- alpine 3.24: mailmunge-doc 3.20-r0 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms