description => "Whitelist legitimate bounce relays.",
type => 'string',
},
- safe_browsing_score => {
- description => "Score for mails listed in Google Safe Browsing database.",
+ clamav_heuristic_score => {
+ description => "Score for ClamaAV heuristics (Google Safe Browsing database, PhishingScanURLs, ...).",
type => 'integer',
minimum => 0,
maximum => 1000,
description => "Maximum size of spam messages in bytes.",
type => 'integer',
minimum => 64,
- default => 200*1024,
+ default => 256*1024,
},
};
}
wl_bounce_relays => { optional => 1 },
languages => { optional => 1 },
use_bayes => { optional => 1 },
- safe_browsing_score => { optional => 1 },
+ clamav_heuristic_score => { optional => 1 },
bounce_score => { optional => 1 },
rbl_checks => { optional => 1 },
maxspamsize => { optional => 1 },
type => 'integer',
minimum => 1,
maximum => 65535,
- default => 25,
+ default => 26,
},
ext_port => {
description => "SMTP port number for incoming mail (untrusted). This must be a different number than 'int_port'.",
type => 'integer',
minimum => 1,
maximum => 65535,
- default => 26,
+ default => 25,
},
relay => {
description => "The default mail delivery transport (incoming mails).",
my $mynetworks_filename = "/etc/pmg/mynetworks";
-sub postmap_pmg_mynetworks {
- PMG::Utils::run_postmap($mynetworks_filename);
-}
-
sub read_pmg_mynetworks {
my ($filename, $fh) = @_;
$vars->{postfix}->{transportnets} = join(' ', @$transportnets);
my $mynetworks = [ '127.0.0.0/8', '[::1]/128' ];
- push @$mynetworks, @$transportnets;
push @$mynetworks, $int_net_cidr;
- push @$mynetworks, 'hash:/etc/pmg/mynetworks';
my $netlist = PVE::INotify::read_file('mynetworks');
+ push @$mynetworks, keys %$netlist;
+
+ push @$mynetworks, @$transportnets;
+
# add default relay to mynetworks
if (my $relay = $self->get('mail', 'relay')) {
if ($relay =~ m/^$IPV4RE$/) {
my $resolv = PVE::INotify::read_file('resolvconf');
$vars->{dns}->{hostname} = $nodename;
- $vars->{dns}->{domain} = $resolv->{search};
- my $wlbr = "$nodename.$resolv->{search}";
+ my $domain = $resolv->{search} // 'localdomain';
+ $vars->{dns}->{domain} = $domain;
+
+ my $wlbr = "$nodename.$domain";
foreach my $r (PVE::Tools::split_list($vars->{pmg}->{spam}->{wl_bounce_relays})) {
$wlbr .= " $r"
}
my ($self, $rulecache) = @_;
# make sure we have required files (else postfix start fails)
- postmap_pmg_domains();
- postmap_pmg_transport();
- postmap_pmg_mynetworks();
- postmap_tls_policy();
-
IO::File->new($transport_map_filename, 'a', 0644);
my $changes = 0;
$changes = 1 if $self->rewrite_config_file(
'master.cf.in', '/etc/postfix/master.cf');
+ # make sure we have required files (else postfix start fails)
+ # Note: postmap need a valid /etc/postfix/main.cf configuration
+ postmap_pmg_domains();
+ postmap_pmg_transport();
+ postmap_tls_policy();
+
rewrite_postfix_whitelist($rulecache) if $rulecache;
# make sure aliases.db is up to date