On 11/12/2012 11:16 PM, Patrick Ben Koetter wrote:
* Simon Brereton <simon.buongio...@gmail.com>:
On 12 November 2012 10:20, Rob Sterenborg (lists) <li...@sterenborg.info> wrote:
Hello,
I'm trying to get local email scanned. Found a lot of hints to exclude local
email from being scanned, but for some reason I can't get the opposite to
work. (Yes, I actually want to do that.)
[snip]
Map your IPs to a policy bank:
#############################################################################
## POLICY BANKS: MAPPINGS
#
@client_ipaddr_policy = (
[qw( 0.0.0.0/8 127.0.0.1/32 [::] [::1] )] => 'LOCALHOST',
[qw( !172.16.1.0/24 172.16.0.0/12 192.168.0.0/16 )] => 'PRIVATENETS',
[qw( 192.0.2.0/25 192.0.2.129 192.0.2.130 )] => 'PARTNER',
[qw( 88.217.225.250/32 )] => 'CUSTOMERS',
\@mynetworks => 'MYNETS',
);
Add a policy bank to e.g. LOCALHOST _and_ tell amavis mails in this policy bank
are originating:
#############################################################################
## POLICY BANKS: LOCALHOST
#
$policy_bank{'LOCALHOST'} = {
originating => 1,
final_spam_destiny => D_BOUNCE,
final_virus_destiny => D_REJECT,
final_banned_destiny=> D_PASS,
final_bad_header_destiny => D_PASS,
banned_filename_maps => ['MYNETS-DEFAULT'],
warnbadhsender => 1,
# warnbadhrecip => 0,
};
Finally tell amavis what recipient domains you have in @local_domains_acl.
amavis will ONLY tell repicients in @local_domains_acl what a messages spam
score is.
Great! The above works perfectly after doing this.
@local_domains_acl = (
'domain1',
'domain2',
'domain3',
..etc..
);
@local_domains_maps = @local_domains_acl;
Now, I'm not much of a Perl wizard so here's the follow-up question..
I have a MySQL table containing the complete list of local domains that
I would like to use in amavis. I found out how to do so by either
exporting the table to a file or to load directly from the table, which
works.
However.. I take it that this only works once: when amavisd is started.
Is it possible to dynamically read the list directly from MySQL so that
I don't have to restart or reload amavisd when the local_domains list
changes?
(I can of course schedule a reload using cron, but it would be nice if I
don't have to do it that way.)
--
Thanks, Rob