Added spam checking to the autoreply script, if spamassassin is installed.
---- Changes since 1.550 ----
Fixed a bug that prevented editing of server processes with the same name but different types, and add detection of clashes for servers with the same name and type.
+Added an option to the SMTP Authentication page for setting the login and password for Postfix to use when sending email via another mail server.
sasl_level_none=Never
sasl_level_may=If requested by client
sasl_level_encrypt=Always
+sasl_login=SMTP login to outgoing mail host
+sasl_nologin=None needed
+sasl_userpass=Login as $1 with password $2
+sasl_elogin=Missing or invalid SMTP login
+sasl_epass=Invalid SMTP password
client_title=SMTP Client Restrictions
client_ecannot=You are not allowed to edit SMTP client restrictions
&option_radios_freefield("smtpd_tls_CAfile", 60, $none);
+print &ui_table_hr();
+
+# Outgoing authentication options
+&option_radios_freefield("relayhost", 45, $text{'opts_direct'});
+
+# Get the current map value for the relayhost
+$rh = &get_current_value("relayhost");
+if ($rh) {
+ $pmap = &get_maps("smtp_sasl_password_maps");
+ foreach my $o (@$pmap) {
+ if ($o->{'name'} eq $rh) {
+ ($ruser, $rpass) = split(/:/, $o->{'value'});
+ }
+ }
+ }
+print &ui_table_row($text{'sasl_login'},
+ &ui_radio("login_none", $ruser ? 0 : 1,
+ [ [ 1, $text{'sasl_nologin'}."<br>" ],
+ [ 0, &text('sasl_userpass',
+ &ui_textbox("login_user", $ruser, 20),
+ &ui_textbox("login_pass", $rpass, 20)) ] ]), 3);
+
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'opts_save'} ] ]);
-r $in{'smtpd_tls_CAfile'} || &error($text{'sasl_eca'});
}
+# Validate remote mail server login
+if (!$in{'login_none'}) {
+ $in{'login_user'} =~ /^[^: ]+$/ || &error($text{'sasl_elogin'});
+ $in{'login_pass'} =~ /^[^: ]*$/ || &error($text{'sasl_epass'});
+ }
+
&lock_postfix_files();
&save_options(\%in);
$in{'smtpd_tls_security_level'});
}
+# Save SMTP relay options
+$rh = &get_current_value("relayhost");
+if ($rh) {
+ if ($in{'login_none'} == 0 &&
+ !&get_current_value("smtp_sasl_password_maps")) {
+ # Setup initial map
+ &set_current_value("smtp_sasl_password_maps",
+ "hash:".&guess_config_dir()."/smtp_sasl_password_map");
+ }
+ $pmap = &get_maps("smtp_sasl_password_maps");
+ foreach my $o (@$pmap) {
+ if ($o->{'name'} eq $rh) {
+ $old = $o;
+ }
+ }
+ $newmap = { 'name' => $rh,
+ 'value' => $in{'login_user'}.":".$in{'login_pass'} };
+ if ($old && $in{'login_def'}) {
+ # Delete entry
+ &delete_mapping("smtp_sasl_password_maps", $old);
+ }
+ elsif ($old && !$in{'login_def'}) {
+ # Update entry
+ &modify_mapping("smtp_sasl_password_maps", $old, $newmap);
+ }
+ elsif (!$old && !$in{'login_def'}) {
+ # Add entry
+ &create_mapping("smtp_sasl_password_maps", $newmap);
+ }
+ ®enerate_any_table("smtp_sasl_password_maps");
+ }
+
&unlock_postfix_files();
&reload_postfix();