Handle hostnames with upper-case letters
[webmin.git] / postfix / general.cgi
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 controlling general parameters.
7 #
8 # << Here are all options seen in Postfix sample-misc.cf >>
9
10 require './postfix-lib.pl';
11
12
13 $access{'general'} || &error($text{'general_ecannot'});
14 &ui_print_header(undef, $text{'general_title'}, "", "general_opts");
15
16 $default = $text{'opts_default'};
17 $none = $text{'opts_none'};
18 $no_ = $text{'opts_no'};
19
20 # Form start
21 print &ui_form_start("save_opts_misc.cgi", "post");
22 print &ui_table_start($text{'general_title_sensible'}, "width=100%", 4);
23
24 &option_radios_freefield("myorigin", 30, $text{'opts_myorigin_as_myhostname'},
25                                          '$mydomain', $text{'opts_myorigin_as_mydomain'});
26
27 &option_radios_freefield("mydestination", 60, $text{'opts_mydestination_default'},
28                                               '$myhostname, localhost.$mydomain, $mydomain', $text{'opts_mydestination_domainwide'});
29
30 $v = &if_default_value("notify_classes") ? "" :
31         &get_current_value("notify_classes");
32 @v = split(/[, ]+/, $v);
33 print &ui_table_row(&hlink($text{'opts_notify_classes'},
34                            'opts_notify_classes'),
35                     &ui_radio("notify_classes_def",
36                               $v ? "__USE_FREE_FIELD__"
37                                  : "__DEFAULT_VALUE_IE_NOT_IN_CONFIG_FILE__",
38                               [ [ "__DEFAULT_VALUE_IE_NOT_IN_CONFIG_FILE__",
39                                   $text{'default'} ],
40                                 [ "__USE_FREE_FIELD__",
41                                   $text{'opts_notify_classes_sel'} ] ]).
42                     "<br>\n".
43                     &ui_select("notify_classes", \@v,
44                        [ [ "bounce", "bounce - Bounced mail" ],
45                          [ "2bounce", "2bounce - Double-bounced mail" ],
46                          [ "delay", "delay - Delayed mail" ],
47                          [ "policy", "policy - Policy rejected clients" ],
48                          [ "protocol", "protocol - Client protocol errors" ],
49                          [ "resource", "resource - Resource problems" ],
50                          [ "software", "software - Software problems" ] ],
51                        7, 1, 1));
52
53 print &ui_table_end();
54 print &ui_table_start($text{'general_title_others'}, "width=100%", 4);
55
56 &option_radios_freefield("relayhost", 45, $text{'opts_direct'});
57
58 &option_radios_freefield("always_bcc", 40, $text{'opts_always_bcc_none'});
59
60 &option_freefield("daemon_timeout", 15);
61 &option_freefield("default_database_type", 15);
62
63 &option_freefield("default_transport", 15);
64 &option_freefield("double_bounce_sender", 15);
65
66 &option_freefield("hash_queue_depth", 15);
67 &option_freefield("hash_queue_names", 15);
68
69 &option_freefield("hopcount_limit", 15);
70 &option_radios_freefield("delay_warning_time", 15, $text{'opts_delay_warning_time_default2'});
71
72 &option_radios_freefield("inet_interfaces", 40, $text{'opts_all_interfaces'});
73
74 &option_freefield("ipc_idle", 15);
75 &option_freefield("ipc_timeout", 15);
76
77 &option_freefield("mail_name", 15);
78 &option_freefield("mail_owner", 15);
79
80 &option_freefield("mail_version", 25);
81
82 &option_freefield("max_idle", 15);
83 &option_freefield("max_use", 15);
84
85 &option_radios_freefield("myhostname", 40, $text{'opts_myhostname_default'});
86
87 &option_radios_freefield("mydomain", 40, $text{'opts_mydomain_default'});
88
89 &option_radios_freefield("mynetworks", 60, $text{'opts_mynetworks_default'});
90
91 &option_select("mynetworks_style",
92                [ [ "", $text{'default'} ],
93                  [ "subnet", $text{'opts_mynetworks_subnet'} ],
94                  [ "class", $text{'opts_mynetworks_class'} ],
95                  [ "host", $text{'opts_mynetworks_host'} ] ]);
96
97 &option_radios_freefield("bounce_notice_recipient", 15, $default);
98 &option_radios_freefield("2bounce_notice_recipient", 15, $default);
99
100 &option_radios_freefield("delay_notice_recipient", 15, $default);
101 &option_radios_freefield("error_notice_recipient", 15, $default);
102
103 &option_freefield("queue_directory", 45);
104
105 &option_freefield("process_id_directory", 20);
106 &option_freefield("recipient_delimiter", 20);
107
108 if ($postfix_version < 2.1) {
109         &option_freefield("program_directory", 45);
110         }
111
112 &option_radios_freefield("relocated_maps", 60, $text{'opts_relocated_maps_default'});
113
114 &option_yesno("sun_mailtool_compatibility", 'help');
115 &option_freefield("trigger_timeout", 15);
116
117 &option_radios_freefield("content_filter", 60, $text{'opts_content_filter_default'});
118
119 print &ui_table_end();
120 print &ui_form_end([ [ undef, $text{'opts_save'} ] ]);
121
122 &ui_print_footer("", $text{'index_return'});