Authen...::SMTP(3pm)
π Authen::Simple::SMTP(3pm) π
okay bestie, so this is Authen::Simple::SMTP, a lil Perl module from the User Contributed Perl Documentation pile, and it does exactly one thing but it does it flawlessly: it checks a username and password against an SMTP service. that's it. that's the whole vibe. simple SMTP authentication, no cap. β¨
πΈ SYNOPSIS πΈ
use it like a normal lil object, or slot it into mod_perl as an Authen handler β both are iconic:
use Authen::Simple::SMTP;
my $smtp = Authen::Simple::FTP->new(
host => 'smtp.company.com'
);
if ( $smtp->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::SMTP
PerlSetVar AuthenSimpleSMTP_host "smtp.company.com"
<Location /protected>
PerlAuthenHandler Authen::Simple::SMTP
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
(yeah the comment says successfull, and yeah that's a typo, but it's the original's typo so we're keeping it, respectfully π
β code gets copied verbatim in this house.)
π¦ DESCRIPTION π¦
Authenticate against a SMTP service. that's the whole deal. she connects, she asks, she tells you yes or no. main character energy. π
π METHODS π
newβ builds the thing. she takes a hash of parameters, and these are the options that are actually valid:hostβ the connection host, and it can be a hostname or an IP number, she doesn't discriminate. defaults to"localhost". π
host => 'ftp.company.com'
host => '10.0.0.1'
portβ the connection port. defaults to25. πͺ
port => 25
timeoutβ connection timeout. defaults to60. β³
timeout => 60
logβ any object that supportsdebug,info,errorandwarn. that's the whole requirements list, she's not picky. π
log => Log::Log4perl->get_logger('Authen::Simple::SMTP')
authenticate( $username, $password )β the moment we've all been waiting for. returns true on success and false on failure. that's it, that's the tea. π
π SEE ALSO π
Authen::Simple.Net::SMTP.
iykyk, go read those next. π
π AUTHOR π
Christian Hansen ch@ngmedia.com β legend behavior, honestly. π«Ά
β COPYRIGHT β
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, and legally so. βοΈβ¨
perl v5.34.0 Β· 2022-06-08 Β· User Contributed Perl Documentation β and that's the whole page bestie, Authen::Simple::SMTP(3pm), out. go authenticate something. ππ¦π
π¦ where this page comes from
- debian bookworm: libauthen-simple-net-perl 0.2-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libauthen-simple-net-perl 0.2-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libauthen-simple-net-perl 0.2-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libauthen-simple-net-perl 0.2-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libauthen-simple-net-perl 0.2-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms