On 2011-09-12 06:21, Alex wrote:
Hi,

I'm trying to configure a disclaimer footer using altermime with
postfix-2.7.5, amavisd-new-2.6.4. I've tried to follow the examples
for creating a new filter, but the messages appear to be being
reinjected at the wrong spot and are being delivered multiple times to
the always_bcc recipient.

I thought I could outline my current config, and someone could help me
to find what I'm missing. I have about twenty virtual domains, but it
would be okay to use the same disclaimer footer text for each domain.
I'd also like to be sure SASL authenticated clients are permitted as
well.

I'm not sure this configuration will only work with my domains, and
only on outbound mail. How is this controlled?

By limiting the scope of the setting to one or more individual daemons.
Settings in main.cf affect all instances of any particular daemon.

If you need this controlled per domain, either use a recipient access map with a FILTER action to select among multiple filters, or take care of the domain in the content_filter.
For 20 domains, adding 20 filters is probably not the easiest solution.
Just parse the domain part in your content_filter and act appropriately.

smtp      inet  n       -       n       -       -       smtpd
        -o receive_override_options=no_address_mappings
        -o content_filter=filter:dummy


I would suggest not naming an actual filter something as generic as "filter" - use "footer" instead, in this case. Also, smtP(8) does not receive mail, so this is not the correct place to apply these settings - they achieve nothing.


submission inet n       -       n       -       -       smtpd
   -o smtpd_tls_security_level=encrypt
   -o smtpd_sasl_auth_enable=yes
   -o smtpd_client_restrictions=permit_sasl_authenticated,reject
   -o receive_override_options=no_address_mappings
   -o content_filter=filter:dummy


They do here, since submission is an smtpD(8) listener.


The intended recipient receives a copy of the message, but the
always_bcc user receives the message multiple times.

Yes; always_bcc is invoked on receiving mail.
If you re-inject mail (as you must after it is passed off to a content_filter), it is received for the second time.
Everything in main.cf is applied anew, including always_bcc.

The re-injection listener (which should NOT be the same daemon as your normal smtpd(8) listener!) should not apply always_bcc, so set your receive_override_options there.

You should also be very, very careful about bouncing mail to your always_bcc address - consider what the result is.

In practical terms, the recipient in always_bcc should never bounce, or you will have problems.


--
J.

Reply via email to