Option for relay_recipient_maps
authorJamie Cameron <jcameron@webmin.com>
Tue, 5 Jul 2011 23:06:45 +0000 (16:06 -0700)
committerJamie Cameron <jcameron@webmin.com>
Tue, 5 Jul 2011 23:06:45 +0000 (16:06 -0700)
postfix/CHANGELOG
postfix/lang/en
postfix/postfix-lib.pl
postfix/smtpd.cgi

index 508bb90..c56047e 100644 (file)
@@ -79,3 +79,4 @@ 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.
+Destination email addresses that are allowed for relaying can now be configured on the SMTP Server Options page. This makes use of the Postfix relay_recipient_maps directive.
index 568ac8f..6b51784 100644 (file)
@@ -282,6 +282,7 @@ opts_smtpd_recipient_restrictions=Restrictions on recipient addresses
 opts_allow_untrusted_routing=Allow untrusted routing
 opts_maps_rbl_domains=DNS domains for blacklist lookups
 opts_relay_domains=Restrict mail relaying
+opts_relay_recipient_maps=Map for allowed addresses for relaying
 opts_access_map_reject_code=SMTP server response on access map violation
 opts_invalid_hostname_reject_code=SMTP server response on invalid hostname reject
 opts_maps_rbl_reject_code=SMTP server response on RBL domains violation
@@ -290,7 +291,7 @@ opts_relay_domains_reject_code=SMTP server response on forbidden relaying
 opts_unknown_address_reject_code=SMTP server response on unknown domain reject
 opts_unknown_client_reject_code=SMTP server response on unknown client reject
 opts_unknown_hostname_reject_code=SMTP server response on unknown hostname reject
-
+smtpd_nomap=No map for allowed addresses for relaying has been entered yet.
 
 smtp_title=SMTP Client Options
 smtp_ecannot=You are not allowed to edit the SMTP client options
index 9b868da..220d7de 100755 (executable)
@@ -614,6 +614,11 @@ sub regenerate_bcc_table
     &regenerate_any_table("sender_bcc_maps");
 }
 
+sub regenerate_relay_recipient_table
+{ 
+    &regenerate_any_table("relay_recipient_maps");
+}
+
 # regenerate_recipient_bcc_table()
 sub regenerate_recipient_bcc_table
 {
@@ -1651,6 +1656,7 @@ elsif ($map_name =~ /body/) { &redirect("body.cgi"); }
 elsif ($map_name =~ /sender_bcc/) { &redirect("bcc.cgi?mode=sender"); }
 elsif ($map_name =~ /recipient_bcc/) { &redirect("bcc.cgi?mode=recipient"); }
 elsif ($map_name =~ /^smtpd_client_restrictions:/) { &redirect("client.cgi"); }
+elsif ($map_name =~ /relay_recipient_maps/) { &redirect("smtpd.cgi"); }
 else { &redirect(""); }
 }
 
@@ -1668,6 +1674,9 @@ if ($map_name =~ /smtpd_client_restrictions:(\S+)/) {
        &regenerate_any_table("smtpd_client_restrictions",
                              undef, $1);
        }
+if ($map_name =~ /relay_recipient_maps/) {
+       &regenerate_relay_recipient_table();
+       }
 }
 
 # mailq_table(&qfiles)
index fc0e2d6..5fcedd6 100755 (executable)
@@ -46,6 +46,8 @@ print &ui_table_start($text{'smtpd_title'}, "width=100%", 4);
 
 &option_radios_freefield("relay_domains", 65, $default);
 
+&option_mapfield("relay_recipient_maps", 60);
+
 &option_freefield("access_map_reject_code", 15, $default);
 &option_freefield("invalid_hostname_reject_code", 15, $default);
 
@@ -61,5 +63,17 @@ print &ui_table_start($text{'smtpd_title'}, "width=100%", 4);
 print &ui_table_end();
 print &ui_form_end([ [ undef, $text{'opts_save'} ] ]);
 
+# Current relay map contents
+print &ui_hr();
+if (&get_real_value("relay_recipient_maps") eq "")
+{
+    print ($text{'smtpd_nomap'}."<br><br>");
+}
+else
+{
+    &generate_map_edit("relay_recipient_maps", $text{'map_click'}." ".
+              &hlink($text{'help_map_format'}, "relay_recipient_maps"));
+}
+
 &ui_print_footer("", $text{'index_return'});