Work on new mail sending config page
authorJamie Cameron <jcameron@webmin.com>
Fri, 8 Apr 2011 22:12:51 +0000 (15:12 -0700)
committerJamie Cameron <jcameron@webmin.com>
Fri, 8 Apr 2011 22:12:51 +0000 (15:12 -0700)
blue-theme/webmin/images/sendmail.gif [new file with mode: 0644]
webmin/edit_sendmail.cgi [new file with mode: 0755]
webmin/images/sendmail.gif [new file with mode: 0644]
webmin/index.cgi
webmin/lang/en

diff --git a/blue-theme/webmin/images/sendmail.gif b/blue-theme/webmin/images/sendmail.gif
new file mode 100644 (file)
index 0000000..f3ff6dc
Binary files /dev/null and b/blue-theme/webmin/images/sendmail.gif differ
diff --git a/webmin/edit_sendmail.cgi b/webmin/edit_sendmail.cgi
new file mode 100755 (executable)
index 0000000..44f0b23
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/local/bin/perl
+# Show mail sending options
+
+require './webmin-lib.pl';
+&ui_print_header(undef, $text{'sendmail_title'}, "");
+&foreign_require("mailboxes");
+%mconfig = &foreign_config("mailboxes");
+
+print $text{'sendmail_desc'},"<p>\n";
+
+print &ui_form_start("save_sendmail.cgi", "post");
+print &ui_table_start($text{'sendmail_header'}, undef, 2);
+
+# Mail server type
+$ms = $mconfig{'mail_system'};
+print &ui_table_row($text{'sendmail_system'},
+       $mailboxes::text{'index_system'.$ms});
+
+# SMTP server
+$smtp = $mconfig{'send_mode'};
+$mode = $smtp eq "" ? 0 :
+       $smtp eq "localhost" || $smtp eq "127.0.0.1" ? 1 : 2;
+print &ui_table_row($text{'sendmail_smtp'},
+       &ui_radio("mode", $mode, [ [ 0, $text{'sendmail_smtp0'}."<br>" ],
+                                  [ 1, $text{'sendmail_smtp1'}."<br>" ],
+                                  [ 2, $text{'sendmail_smtp2'} ] ]).
+       " ".&ui_textbox("smtp", $mode == 2 ? $smtp : "", 40));
+
+# SMTP login and password
+$user = $mconfig{'smtp_user'};
+$pass = $mconfig{'smtp_pass'};
+print &ui_table_row($text{'sendmail_login'},
+       &ui_radio("login_def", $user ? 0 : 1,
+                 [ [ 1, $text{'sendmail_login1'}."<br>" ],
+                   [ 0, $text{'sendmail_login0'} ] ])." ".
+       &ui_textbox("login_user", $user, 20)." ".
+       $text{'sendmail_pass'}." ".
+       &ui_textbox("login_pass", $pass, 20));
+
+# Authentication method
+$auth = $mconfig{'smtp_auth'};
+print &ui_table_row($text{'sendmail_auth'},
+       &ui_select("auth", $auth,
+                  [ [ undef, $text{'default'} ],
+                    "Cram-MD5", "Digest-MD5", "Plain", "Login" ]));
+
+# From address
+$from = $mconfig{'webmin_addr'};
+$fromdef = "webmin\@".&get_system_hostname();
+print &ui_table_row($text{'sendmail_from'},
+       &ui_opt_textbox("from", $from, 40,
+                       &text('sendmail_fromdef', $fromdef)."<br>",
+                       $text{'sendmail_fromaddr'}));
+
+print &ui_table_end();
+print &ui_form_end([ [ "", $text{'save'} ] ]);
+
+&ui_print_footer("", $text{'index_return'});
+
diff --git a/webmin/images/sendmail.gif b/webmin/images/sendmail.gif
new file mode 100644 (file)
index 0000000..84b41c1
Binary files /dev/null and b/webmin/images/sendmail.gif differ
index 310df47..8e11c24 100755 (executable)
@@ -43,6 +43,11 @@ if ($gconfig{'eazel'}) {
        push(@wtitles, $text{'syslet_title'});
        push(@wicons, "images/syslet.gif");
        }
+if (&foreign_check("mailboxes")) {
+       push(@wlinks, "edit_sendmail.cgi");
+       push(@wtitles, $text{'sendmail_title'});
+       push(@wicons, "images/sendmail.gif");
+       }
 push(@wlinks, "edit_ssl.cgi", "edit_ca.cgi");
 push(@wtitles, $text{'ssl_title'}, $text{'ca_title'});
 push(@wicons, "images/ssl.gif", "images/ca.gif");
index 17b107d..24f0b80 100644 (file)
@@ -903,4 +903,22 @@ status_interval1=Never
 status_interval0=Every
 status_mins=minutes
 status_pkgs=Collect available package updates?
+
+sendmail_title=Sending Email
+sendmail_desc=This page controls how Webmin sends email, such as from scheduled backups or background monitoring. It also effects email sent using the Read User Mail module.
+sendmail_header=Mail sending options
+sendmail_system=Local mail server
+sendmail_smtp=Send email using
+sendmail_smtp0=Local mail server command
+sendmail_smtp1=Via SMTP to local mail server
+sendmail_smtp2=Via SMTP to remote mail server
+sendmail_login=SMTP server authentication
+sendmail_login1=Don't authenticate
+sendmail_login0=Login as
+sendmail_pass=with password
+sendmail_auth=SMTP authentication method
+sendmail_from=From address for email from Webmin
+sendmail_fromdef=Default ($1)
+sendmail_fromaddr=Address
+
 __norefs=1