[SOLVED] amavisd-new not loading MYNETS policy

Hello,
I have postfix mail server with amavisd-new filter for incoming messages which works great.
I am using amavis for adding DKIM signature and disclaimer footer in emails and this works great when users send messages by authenticating.

so i guess it is unable to see the email coming from localhost.
Because there is no IP address in this Received header it shows in log: ip_from_received: no IP address in: Received: by domain.com (Postfix, from userid 0)
In postfix config i added header checks to replace header if it contains "Postfix, from userid ":

I found the solution.
I created new listening port in amavis and connected it to new policy bank called LOCALHOST. I enabled originating and disclaimer for LOCALHOST, then changed master.cf to add content filter for pickup:

Although the issue is resolved, I would be interested in why the original solution does not work and emails from the local PHP mail() are not signed - they are sent from the local network, so the condition

In php.ini check the config parameter sendmail_path. If it is like the default config:
sendmail_path = /usr/sbin/sendmail -t -i
the sendmail program does not use SMTP but local pickup. http://www.postfix.org/pickup.8.html
The setting smtpd_sender_restrictions you posted is related to smpt protocol (sender connects to the smtp service on port 25 and drops message the postifx is determining and processing it).

If you need to apply filtering on such local pickup messages it must be described in master.cf as i mentioned it above: