<html><body><div style="font-family: courier new,courier,monaco,monospace,sans-serif; font-size: 10pt; color: #000000">Hmmm, this is a little confusing then.  Postfix is set to forward via LMTP on tcp/10024 and in amavisd.conf I have:<br><div><br></div>$interface_policy{'10024'} = 'POLICY-IN';<br><div><br></div>$policy_bank{'POLICY-IN'} = {<br>  originating => 0,<br>  bounce_killer_score => 1,<br>  penpals_bonus_score => 1,<br>};<br><div><br></div>and from the internal network when it sends out it should hit:<br><div><br></div>$policy_bank{'MYNETS'} = {   # mail originating from @mynetworks<br>  originating => 1,  # is true in MYNETS by default, but let's make it explicit<br>  os_fingerprint_method => undef,  # don't query p0f for internal clients<br>  allow_disclaimers => 0,<br>  log_level => 1,<br>  penpals_bonus_score => undef,<br>  bounce_killer_score => 0,<br>};<br><div><br></div>as I have specified the correct mynetworks variable.  When email comes in from external it does look okay:<br><div><br></div>amavis[19518]: (19518-01) Passed CLEAN {RelayedInbound}, POLICY-IN [216.207.245.17]:33321 [198.245.16.142] <asterisk-users-bounces@lists.digium.com><br><div><br></div>but what is odd is when I send out:<br><div><br></div>amavis[19517]: (19517-01) Checking: IQESxMhvS-Ec POLICY-IN/MYNETS [172.30.10.11]<br><div><br></div>is one policy map overriding the other or is it treating the internal networks as external as-well ?  Should add that I am also using MySQL storage so is this valid ?<br><div><br></div>@storage_sql_dsn = @lookup_sql_dsn;<br><div><br></div>@storage_redis_dsn = (<br>    { server => '172.30.10.20:6379', db_id => 1 },<br>);<br><div><br></div>As when I check the Redis database there are no keys :(<br><div><br></div>172.30.10.20:6379> keys *<br>(empty list or set)<br><div><br></div>Thanks, Phil<br>----- Original Message -----<br>From: "Mark Martinec" <Mark.Martinec+amavis@ijs.si><br>To: amavis-users@amavis.org<br>Sent: Wednesday, 15 October, 2014 5:31:48 PM<br>Subject: Re: Penpal configuration help<br><div><br></div>Phil,<br><div><br></div>> am very new to Amavisd-new and struggling with how to get penpals<br>> working. I have two MX which are sharing a common redis database. At<br>> present in amavisd.conf the following is set:<br>> <br>> $policy_bank{'MYNETS'} = { # mail originating from @mynetworks<br>> originating => 1, # is true in MYNETS by default, but let's make it <br>> explicit<br>> os_fingerprint_method => undef, # don't query p0f for internal clients<br>> allow_disclaimers => 0,<br>> log_level => 1,<br>> penpals_bonus_score => undef,<br>> bounce_killer_score => 0,<br>> };<br>> <br>> and in postfix/main.cf and postfix/master.cf I have:<br>> <br>> content_filter = lmtp-amavis:[127.0.0.1]:10024<br>> <br>> lmtp-amavis unix - - n - 3 lmtp<br>> -o lmtp_data_done_timeout=1200<br>> -o lmtp_send_xforward_command=yes<br>> -o disable_dns_lookups=yes<br>> -o max_use=20<br>> <br>> but when I check the database no keys are being written. I presume<br>> that I need to create a second policy bank and associate that with<br>> another interface ?<br>> <br>> Any help would be appreciated.<br><div><br></div>Assuming your redis settings are fine ( @storage_redis_dsn ),<br>for pen-pals to work the penpals_bonus_score must be defined<br>and nonzero. From release notes:<br><div><br></div>* configuration variable $penpals_bonus_score must be set to a positive<br>   value (such as 1.0, increase to perhaps 5 or 8 after seeing that it <br>works),<br>   zero disables the feature and is a default;<br><div><br></div>Other important pre-requisites for penpals:<br><div><br></div>* @mynetworks and @local_domains_maps must reflect reality, allowing <br>amavisd<br>   to distinguish between outgoing, incoming and internal-to-internal <br>mail;<br><div><br></div>* the information about client IP address must be available to amavisd,<br>   i.e. Postfix XFORWARD protocol extension must be enabled, or <br>AM.PDP+milter;<br><div><br></div>(references to SQL in that part of release notes can be ignored<br>if you are using a Redis server).<br><div><br></div>   Mark<br></div></body></html>