Authen...::SMTP(3pm)

πŸ“¦
version 0.2 Β· 2 versions
  • 0.2 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 to 25. πŸšͺ
port => 25
  • timeout β€” connection timeout. defaults to 60. ⏳
timeout => 60
  • log β€” any object that supports debug, info, error and warn. 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. 🫢


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