Portál AbcLinuxu, 12. května 2025 07:57
@mynetworks
.
@mynetworks is an IP access list which determines if the original SMTP client IP address belongs to our internal networks, i.e. mail is coming from inside. It is much like the Postfix parameter 'mynetworks' in semantics and similar in syntax, and its value should normally match the Postfix counterpart. It only affects the value of a macro %l (=sender-is-local), and the loading of policy 'MYNETS' if present (see below). Note that '-o smtp_send_xforward_command=yes' (or its lmtp counterpart) must be enabled in the Postfix service that feeds amavisd, otherwise client IP address is not available to amavisd-new.
@mynetworks
" nekontroluj. Pokud vylozenene chces whitelist pomoci domeny odesilatele, muzes pouzit parametr @whitelist_sender_maps
. Ale opet: s tim omezenim, ze adresa muze byt fake.
Ja používám:
@local_domains_maps = ( read_hash("$MYHOME/local_domains") );
A v local_domains
mám:
.domena1.cz .domena2.cz ...
Možná bude potřeba použít následující patch:
--- ../amavisd-new-2.1.2.orig/amavisd 2004-09-06 20:30:58.000000000 +0200 +++ ./amavisd 2005-01-06 00:14:25.000000000 +0100 @@ -8808,10 +8808,15 @@ sub check_amcl_policy($$$$) { $smtp_resp = '450 4.5.0 Incomplete request'; $exit_code = EX_TEMPFAIL; } else { my($cl_ip) = $msginfo->client_addr; + my($sender) = $msginfo->sender; if ($cl_ip ne '' && defined $policy_bank{'MYNETS'} && lookup_ip_acl($cl_ip,@{ca('mynetworks_maps')}) ) { Amavis::load_policy_bank('MYNETS'); $policy_changed = 1; } + if ($sender ne '' && defined $policy_bank{'MYUSERS'} + && lookup(0,$sender,@{ca('local_domains_maps')})) { + Amavis::load_policy_bank('MYUSERS'); $policy_changed = 1; + } debug_oneshot(1) if lookup(0,$msginfo->sender,@{ca('debug_sender_maps')}); # check_mail() expects open file on $fh, need not be rewound my($fh) = $msginfo->mail_text; my($tempdir) = $msginfo->mail_tempdir; @@ -9373,6 +9378,10 @@ sub process_smtp_request($$$$) { # $submitter = "<$addr>" if !defined($submitter); # rfc2554: MAY $submitter = '<>' if !defined($msginfo->auth_user); $msginfo->auth_submitter($submitter); + if ($sender ne '' && defined $policy_bank{'MYUSERS'} + && lookup(0,$sender,@{ca('local_domains_maps')})) { + Amavis::load_policy_bank('MYUSERS'); $policy_changed = 1; + } }; last; };
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.