rocsca,

> I have a number of networks from which it is possible to use my mail
> gateway system (Postfix+Amavisd-new+MySQL) to relay email messages
> (directly through a mail client or through another MTA that uses my mail
> gateway system as smart host). The mail gateway system moreover is used
> as MX record for the email domains that I maintain.
>
> I apply a policy service to messages as follow:
> smtpd_recipient_restrictions =
>     check_policy_service inet:127.0.0.1:10031
> smtpd_end_of_data_restrictions =
>     check_policy_service inet:127.0.0.1:10031
>
> Moreover, my Amavisd-new setup uses a policy bank for "mark" message
> generated inside one of my network:
> $interface_policy{'10026'} = 'SENDERBYPASS';
> $policy_bank{'SENDERBYPASS'} = {
>         originating => 1,
> };
> Having setup the following restriction in postfix:
> smtpd_client_restrictions =
>     check_client_access
>   proxy:mysql:/etc/postfix/mysql-check-client-filter-access.cf
>
> Where:
> query = select IF(STRCMP(action,'OK'),action,'FILTER
> smtp-amavis:[127.0.0.1]:10026') from access where inet_aton(ip) &
> inet_aton(mask) = inet_aton('%s') & inet_aton(mask) order by mask DESC
> limit 0,1;
>
> I would like to know if there is a way so that the policy server is
> applied only inside the policy bank.

Postfix policy service comes into play during original SMTP session,
or during mail reentry to Postfix (but it doesn't make much sense
to apply a policy service there). Amavisd is normally invoked
after-queue, which is too late to influence a Postfix policy service,
which already did its job. So, there is no way for amavisd policy bank
to have any effect on a Postfix policy service, if I understand your
setup correctly.

So the Postfix policy service will need to make its own decisions
based on data available to it. I don't think it is possible for a
Postfix policy service to obtain information on current FILTER tag
as applied by restrictions (which would be neat), so you will
probably need to make and extra SQL query from a policy service
to find out if a client's IP address belongs to your networks.

A clean way out of this would be to provide separate Postfix
instances, one just for mail submission from your own networks or
roaming authenticated users, the other (MX) for your inbound mail.

  Mark

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
AMaViS-user mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to