IPv6 support for sendmail
authorJamie Cameron <jcameron@webmin.com>
Thu, 4 Nov 2010 07:13:27 +0000 (00:13 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 4 Nov 2010 07:13:27 +0000 (00:13 -0700)
sendmail/lang/en
sendmail/list_ports.cgi
sendmail/save_ports.cgi

index ab031ad..7315a72 100644 (file)
@@ -815,6 +815,9 @@ ports_name=Port name
 ports_addr=Listen on address
 ports_all=All
 ports_ip=IP
+ports_family=Protocol
+ports_inet=IPv4
+ports_inet6=IPv6
 ports_port=Listen on port
 ports_opts=Port options
 ports_mod_a=Require SMTP authentication
index bc29b0e..5ebca2f 100755 (executable)
@@ -29,7 +29,7 @@ print &ui_columns_start([
        ], 100);
 $i = 0;
 @tds = ( "valign=top", "valign=top", "valign=top" );
-@known_opts = ( 'Name', 'Address', 'Port', 'Modifiers' );
+@known_opts = ( 'Name', 'Address', 'Port', 'Modifiers', 'Family' );
 foreach $p (@ports, { }) {
        @cols = ( );
        foreach $k (@known_opts) {
@@ -47,7 +47,13 @@ foreach $p (@ports, { }) {
                }
        push(@cols, &ui_textbox("name_$i", $p->{'Name'}, 10));
        push(@cols, &ui_opt_textbox("addr_$i", $p->{'Address'}, 15,
-                                   $text{'ports_all'}, $text{'ports_ip'}));
+                                   $text{'ports_all'}, $text{'ports_ip'}).
+                   "<br>\n".
+                   $text{'ports_family'}." ".
+                   &ui_select("family_$i", $p->{'Family'},
+                              [ [ '', $text{'default'} ],
+                                [ 'inet', $text{'ports_inet'} ],
+                                [ 'inet6', $text{'ports_inet6'} ] ]));
        push(@cols, &ui_opt_textbox("port_$i", $p->{'Port'}, 6,
                                    $text{'default'}." (25)"));
        @mods = ( );
index 00dc354..6a1d123 100755 (executable)
@@ -21,10 +21,16 @@ if (!$in{'ports_def'}) {
                # IP address
                if (!$in{"addr_${i}_def"}) {
                        &check_ipaddress($in{"addr_$i"}) ||
+                          &check_ip6address($in{"addr_$i"}) ||
                                &error(&text('ports_eaddr', $i+1));
                        push(@opts, "Address=".$in{"addr_$i"});
                        }
 
+               # Family
+               if ($in{"family_${i}"}) {
+                       push(@opts, "Family=".$in{"family_${i}"});
+                       }
+
                # TCP port
                if (!$in{"port_${i}_def"}) {
                        $in{"port_$i"} =~ /^\d+$/ && $in{"port_$i"} > 0 &&