1#!/usr/local/bin/perl
2#
3# postfix-module by Guillaume Cottenceau <gc@mandrakesoft.com>,
4# for webmin by Jamie Cameron
5#
6# A form for SMTP client parameters.
7#
8# << Here are all options seen in Postfix sample-smtp.cf >>
9
10require './postfix-lib.pl';
11
12
13$access{'smtp'} || &error($text{'smtp_ecannot'});
14&ui_print_header(undef, $text{'smtp_title'}, "");
15
16$default = $text{'opts_default'};
17$none = $text{'opts_none'};
18$no_ = $text{'opts_no'};
19
20# Start of form
21print &ui_form_start("save_opts.cgi");
22print &ui_hidden("_log_form", "smtp");
23print &ui_table_start($text{'smtp_title'}, "width=100%", 4);
24
25&option_radios_freefield("best_mx_transport", 25, $text{'opts_best_mx_transport_default'});
26
27&option_radios_freefield("fallback_relay", 60, $default);
28
29&option_yesno("ignore_mx_lookup_error", 'help');
30if (&compare_version_numbers($postfix_version, 2) <= 0) {
31	&option_yesno("smtp_skip_4xx_greeting", 'help');
32	}
33
34&option_yesno("smtp_skip_quit_response", 'help');
35
36&option_radios_freefield("smtp_destination_concurrency_limit", 15, $default);
37
38&option_radios_freefield("smtp_destination_recipient_limit", 15, $default);
39
40&option_freefield("smtp_connect_timeout", 15);
41&option_freefield("smtp_helo_timeout", 15);
42
43&option_freefield("smtp_mail_timeout", 15);
44&option_freefield("smtp_rcpt_timeout", 15);
45
46&option_freefield("smtp_data_init_timeout", 15);
47&option_freefield("smtp_data_xfer_timeout", 15);
48
49&option_freefield("smtp_data_done_timeout", 15);
50&option_freefield("smtp_quit_timeout", 15);
51
52&option_yesno("smtp_use_tls");
53&option_freefield("smtp_sasl_security_options", 60);
54
55# TLS enforcement options
56if (&compare_version_numbers($postfix_version, 2.3) >= 0) {
57	$level = &get_current_value("smtp_tls_security_level");
58	print &ui_table_row($text{'opts_smtp_use_tls'},
59		&ui_select("smtp_tls_security_level", $level,
60			   [ [ "", $text{'default'} ],
61			     [ "none", $text{'sasl_level_none'} ],
62			     [ "may", $text{'sasl_level_may'} ],
63			     [ "encrypt", $text{'sasl_level_encrypt'} ],
64			     [ "dane", $text{'sasl_level_dane'} ],
65			     [ "dane-only", $text{'sasl_level_dane_only'} ],
66			     [ "fingerprint", $text{'sasl_level_fingerprint'} ],
67			     [ "verify", $text{'sasl_level_verify'} ],
68			     [ "secure", $text{'sasl_level_secure'} ],
69			   ]));
70	}
71else {
72	&option_yesno("smtp_enforce_tls");
73	}
74
75print &ui_table_end();
76print &ui_form_end([ [ undef, $text{'opts_save'} ] ]);
77
78&ui_print_footer("", $text{'index_return'});
79
80