<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Phil,</p>
<div class="moz-cite-prefix">Am 03.01.21 um 23:41 schrieb Philip:<br>
</div>
<blockquote type="cite"
cite="mid:14a86afc-1e61-8f9f-fa15-c0b8e5328d59@treads.nz">Morning,
<br>
<br>
Does anyone have any good tutorials on creating different policy
banks. The documentation I find isn't very forth coming.
<br>
</blockquote>
<p>a policy bank needs something that triggers it. This can be a TCP
or UNIX socket, an IP (range) or a DKIM verified sender (domain).<br>
</p>
<pre># TCP/UNIX Sockets
@listen_sockets = (
# Release
'[::1]:9998',
# Post-Queue, Submission
'[::1]:10024',
# Pre-Queue, MTA zu MTA
"$MYHOME/amavisd.sock"
);
# DKIM and Client IPs are given
</pre>
<p>Once you've created your 'triggers', you need to map them to a
policy bank:</p>
<pre>
#############################################################################
## POLICY MAPPING
##
# - TCP/UNIX-socket
# - Client IP-address/IP-range
# - DKIM-authenticated sender/senderdomain
# Where to we map @listen_sockets to?
$interface_policy{'10024'} = 'SUBMISSION';
$interface_policy{'SOCK'} = 'AM.PDP-SOCK';
$interface_policy{'9998'} = 'AM.PDP-INET';</pre>
<p> </p>
<pre># Where do we map IP-addresses/-ranges to?
@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( 212.7.160.0/19 )] => 'SUBMISSION',
\@mynetworks => 'MYNETS'
);</pre>
<p> </p>
<pre># Where to we map DKIM verified sender/senderdomains to?
@author_to_policy_bank_maps = ( {
'state-of-mind.de' => 'WHITELIST,NOBANNEDCHECK',
'.paypal.de' => 'WHITELIST',
'amazon.de' => 'WHITELIST',
} );</pre>
<p><br>
</p>
<p>Finally you define the policy banks and what their policies are:</p>
<p><br>
</p>
<pre>#############################################################################
## POLICY BANKS: WHITELIST
#
$policy_bank{'WHITELIST'} = {
bypass_spam_checks_maps => [1],
spam_lovers_maps => [1],
};
#############################################################################
## POLICY BANKS: NOVIRUSCHECK
#
$policy_bank{'NOVIRUSCHECK'} = {
bypass_decode_parts => 1,
bypass_virus_checks_maps => [1],
virus_lovers_maps => [1],
};
#############################################################################
## POLICY BANKS: NOBANNEDCHECK
#
$policy_bank{'NOBANNEDCHECK'} = {
bypass_banned_checks_maps => [1],
banned_files_lovers_maps => [1],
};
#############################################################################
## POLICY BANKS: SUBMISSION
#
$policy_bank{'SUBMISSION'} = {
originating => 1,
bypass_spam_checks_maps => [1],
final_virus_destiny => D_BOUNCE,
final_banned_destiny=> D_PASS,
final_bad_header_destiny => D_PASS,
banned_filename_maps => ['MYNETS-DEFAULT'],
warnbadhsender => 0,
forward_method => '<a class="moz-txt-link-freetext" href="smtp:127.0.0.1:10025">smtp:127.0.0.1:10025</a>',
notify_method => '<a class="moz-txt-link-freetext" href="smtp:127.0.0.1:10025">smtp:127.0.0.1:10025</a>',
undecipherable_subject_tag => undef,
};
#############################################################################
## POLICY BANKS: MYNETS
#
$policy_bank{'MYNETS'} = {
originating => 1,
bypass_spam_checks_maps => [1],
final_virus_destiny => D_BOUNCE,
final_banned_destiny=> D_PASS,
final_bad_header_destiny => D_PASS,
banned_filename_maps => ['MYNETS-DEFAULT'],
warnbadhsender => 0,
forward_method => 'smtp:*:*',
notify_method => 'smtp:*:*',
undecipherable_subject_tag => undef,
};
#############################################################################
## POLICY BANKS: AM.PDP
#
$policy_bank{'AM.PDP-INET'} = {
protocol => 'AM.PDP',
inet_acl => [qw( 127.0.0.1 )],
auth_required_release => 0,
};
$policy_bank{'AM.PDP-SOCK'} = {
protocol => 'AM.PDP',
notify_method => '<a class="moz-txt-link-freetext" href="smtp:127.0.0.1:10025">smtp:127.0.0.1:10025</a>',
auth_required_release => 0,
};</pre>
<p><br>
</p>
<p>Please do not copy the policies over without reviewing them
first. They need to fit your local policy.<br>
</p>
<p>HTH</p>
<p>p@rick</p>
<br>
<pre class="moz-signature" cols="72">--
[*] sys4 AG
<a class="moz-txt-link-freetext" href="https://sys4.de">https://sys4.de</a>, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG,80333 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief
Aufsichtsratsvorsitzender: Florian Kirstein
</pre>
</body>
</html>