[! use strict; use Proxmox::Form; use Proxmox::Utils; use Proxmox::ConfigServer; use Proxmox::Config::System; use Proxmox::License; !] [$ if (!$fdat{__validlic}) $] [- Execute("license/index.htm"); -] [$ else $] [- $fdat{relay} = Proxmox::Utils::trim ($fdat{relay}); my $frm = Proxmox::Form->new (\%fdat); my $system_cfg = $fdat{__system_config}; my $lic = $system_cfg->{license}; my $conn = Proxmox::ConfigClient::connect (); $frm->add_cfg_element('mail', 'relay', "text", '127.0.0.1', __("Default Relay")); $frm->add_cfg_element('mail', 'relayport', "port", '25', __("SMTP Port")); $frm->add_cfg_element('mail', 'relaynomx', "bool", undef, __("Disable MX lookup")); $frm->add_element("m3", "hidden"); if ($frm->submit==0) { $frm->load_cfg ($system_cfg); } else { if ($udat{AM} eq 'w') { if (my $err = Proxmox::Utils::validate_dnsname_or_ip (__("Default Relay"), $fdat{relay})) { $udat{popup_error} = $err; } else { my $maildomains = $fdat{maildomains}; $maildomains =~ s/[,;]/ /g; $maildomains =~ s/\s+/,/g; $system_cfg->set ('mail', 'domains', $maildomains); $frm->save_cfg ($system_cfg); $conn->rewrite_config_postfix (); $conn->service_cmd ('postfix', 'reload'); } } else { $udat{popup_error} = Proxmox::Utils::msg ('nowr'); } } my $domains = $system_cfg->get ('mail', 'domains'); $domains =~ s/\s*,\s*/\n/g; if ($lic->can_domains()) { $frm->add_element('maildomains', "largetextarea", $domains, __("Relayed Domains")); } else { $frm->add_element('maildomains', "rotextarea", $domains, __("Relayed Domains")); } my $out = $frm->out_form; print OUT $out; -] [$ endif $]