reset @mynetworks and load them from file

Matus UHLAR - fantomas uhlar at
Fri Dec 7 16:54:06 CET 2018


some time ago I've had problems setting up @mynetworks so all outgoing mail
can be DKIM-signed AND amavis does not complain about
"Open relay? Nonlocal recips but not originating".

As recorded on:

I have successfully configured it using:

&read_array(\@mynetworks, '/etc/postfix/mynetworks');
$policy_bank{'MYNETS'} = {
        originating =>  1,

originating flag must be set, because it's not set by default even when mail
is received from host in mynetworks.

I have found out that I must even clean up @mynetworks, defaulting to:

@mynetworks = qw( [::1] [fe80::]/10
                  [fc00::]/7 );  # consider also RFC 6598:

because I receive mail from gateway in internal network, and all mail
received from it was tagged ALL_TRUSTED because of this.

It seems that amavis ignores Received: headers when originating flah is set:<>

Just a note, the qw(...) perl syntax (often used by perl programmers) quotes
all values in pareentheses:

qw( ) 
 is expanded to:


while simple


would be expanded to (0) least in amavisd config file as I found out solving problems.
This resulted to amavisd crash:

Dec  7 13:56:56 mail amavis[2364]: (!!)TROUBLE in pre_loop_hook: IPv4 address [0] contains fewer than 4 fields
Dec  7 13:56:56 mail amavis[2364]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: IPv4 address [0] contains fewer than 4 fields

this error was reported in the past, I believe tould have been caused by
similar issue

Matus UHLAR - fantomas, uhlar at ;
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
You have the right to remain silent. Anything you say will be misquoted,
then used against you. 

More information about the amavis-users mailing list