Check for Authen::SASL perl module, offer to install it
authorJamie Cameron <jcameron@webmin.com>
Sat, 7 May 2011 16:55:08 +0000 (09:55 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 7 May 2011 16:55:08 +0000 (09:55 -0700)
webmin/lang/en
webmin/save_sendmail.cgi

index 81e0f9e..4d3bf9c 100644 (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
index 91e8935..0f17394 100755 (executable)
@@ -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'};
        }