Check for Authen::SASL perl module, offer to install it

This commit is contained in:
Jamie Cameron
2011-05-07 09:55:08 -07:00
parent bc2aaba5ac
commit b2e66ad2eb
2 changed files with 10 additions and 0 deletions

View File

@@ -928,6 +928,7 @@ sendmail_fromaddr=Address
sendmail_err=Failed to save mail sending options
sendmail_esmtp=Missing or un-resolvable SMTP server hostname
sendmail_elogin=Missing SMTP server login
sendmail_esasl=SMTP authentication cannot be enabled unless the <a href=$1>$2</a> Perl module is installed.
sendmail_efrom=Missing or incorrectly formatted from address
web_title=Web Server Options

View File

@@ -28,6 +28,15 @@ if ($in{'login_def'}) {
}
else {
$in{'login_user'} =~ /^\S+$/ || &error($text{'sendmail_elogin'});
eval "use Authen::SASL";
if ($@) {
# Perl module missing
&error(&text('sendmail_esasl',
"/cpan/download.cgi?source=3&cpan=Authen::SASL&".
"mode=2&return=/$module_name/&returndesc=".
&urlize($text{'index_return'}),
"Authen::SASL"));
}
$mconfig{'smtp_user'} = $in{'login_user'};
$mconfig{'smtp_pass'} = $in{'login_pass'};
}