Mailmun...Forward(3)
π NAME π
okay so welcome to the User Contributed Perl Documentation corner, bestie β this is Mailmunge::Test::SMTPForward(3), and its whole thing is: Perform an SMTP callback to see if another SMTP server would accept a recipient. that's the assignment, and it's iconic. π
π¦ ABSTRACT π¦
so the vibe is: this class runs a mini SMTP session on a back-end SMTP server to see if that server would accept a recipient. It uses $ctx->connecting_name as the HELO argument and $ctx->sender as the MAIL From: argument.
also Mailmunge::Test::SMTPForward is a subclass of Mailmunge::Test β family tree is giving inheritance realness. π
β¨ PREREQUISITES β¨
This class requires IO::Socket::SSL version 1.994 or greater. Some Linux distros such as CentOS 7 ship with an older version of IO::Socket::SSL; on those distros, you will need to install a newer version of IO::Socket::SSL from CPAN.
so like, check your SSL situation before you come crying to me, bestie. π
π SYNOPSIS π
here's the use-case in all its code-block glory β copy it exactly, no freestyling:
package MyFilter;
use Mailmunge::Test::SMTPForward;
sub filter_recipient {
my ($self, $ctx) = @_;
my $forwarder = Mailmunge::Test::SMTPForward->new($self);
my $resp = $forwarder->check_against_smtp_server($ctx,
$ctx->recipients->[0],
'backend.example.com');
return $resp unless $resp->is_success();
# ... rest of filter_recipient
}
π οΈ CLASS METHOD π οΈ
Mailmunge::Test::SMTPForward->new($filter)
Constructs a new Mailmunge::Test::SMTPForward object and stores a copy of $filter in it. that's it β constructor slay, copy secured, object born. π
πΈ INSTANCE METHODS πΈ
check_against_smtp_server($ctx, $recipient, $server [, $port]);
Run a mini-SMTP session against $server on port $port (default is port 25) to see if it would accept the recipient $recipient.
The return value is a Mailmunge::Response object whose value reflects the response of the back-end SMTP server. so yes, you get a response object back, and it's reporting what the back-end SMTP server said. no cap. π¬
log_smtp($who, $line)
This method does nothing β literally a no-op era β but it is available to be overridden in a derived class. It is called for each line in the SMTP conversation.
For lines sent from the client to the server, $who is set to "C" and for lines received from the server, $who is set to "S". The line itself is in $line, including any trailing "\r\n" characters. base version is a no-op, but derived classes can override it and get every single line of the SMTP convo. π«Ά
π AUTHOR π
Dianne Skoll <dianne@skollsoft.com> β author icon, periodt. π
π LICENSE π
This code is licensed under the terms of the GNU General Public License, version 2. slay, but make it legal. βοΈβ¨
signed, sealed, delivered by perl v5.42.2 on 2025-10-05, filed under Mailmun...Forward(3) πβ¨
π¦ 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