Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Postfix ignores -o always_bcc and -o recipient_bcc_maps

244 views
Skip to first unread message

Vladimir V Kutyavin

unread,
May 12, 2012, 7:28:08 AM5/12/12
to
I need to set bcc for messages from specified sender to specified recipient.


smtpd_sender_restrictions = <...>
                            check_sender_access mysql:/etc/postfix/mysql/mysql-sender.cf
                            <...>


For my sender adress vl...@AAAAAAA.org it resolves 'FILTER smtp:[127.0.0.1]:10027', logging says that trigger is turning:

<vl...@AAAAAAA.org>: Sender address triggers FILTER smtp:[127.0.0.1]:10027;

I have set this trigger for the specification of non-default options with key -o, I need to override always_bcc option:

127.0.0.1:10027 inet n - n - 10  smtpd
    -o content_filter=
    -o smtpd_sender_restrictions=
    -o always_bcc=co...@AAAAAAA.org

But instead of co...@AAAAAAA.org the message copy sended to bac...@AAAAAAA.org, which globaly set in my configuration file main.cf (always_bcc=bac...@AAAAAAA.org)

Actually, I need to override recipient_bcc_maps option, but their override not work as so as always_bcc. In this message I use always_bcc option because that don't require to use any additional map.

How to make it work?

postconf -n: http://pastebin.com/EZn8T4m9
log with smtpd -v for my 127.0.0.1:10027 instance: http://pastebin.com/nLkcPecj

Wietse Venema

unread,
May 12, 2012, 9:07:23 AM5/12/12
to
> with key -o, I need to override always_bcc option:
>
> 127.0.0.1:10027 inet n - n - 10 smtpd
> -o content_filter=
> -o smtpd_sender_restrictions=
> -o always_bcc=co...@AAAAAAA.org

As documented in the smtpd(8) manpage, always_bcc is not an smtpd(8)
feature. I put a great deal of effort to provide accurate
documentation. I would appreciate it if you would take the effort
to read it.

Wietse

/dev/rob0

unread,
May 12, 2012, 9:53:57 AM5/12/12
to
On Sat, May 12, 2012 at 03:28:08PM +0400, Vladimir V Kutyavin wrote:
> I have set this trigger for the specification of non-default options
> with key -o, I need to override always_bcc option:
>
> 127.0.0.1:10027 inet n - n - 10 smtpd
> -o content_filter=
> -o smtpd_sender_restrictions=
> -o always_bcc=co...@AAAAAAA.org

Options given to smtpd(8) must be valid options for smtpd; neither
always_bcc nor recipient_bcc_maps are among those options.

> How to make it work?

This is one way:

http://www.postfix.org/postconf.5.html#receive_override_options

" -o receive_override_options=no_address_mappings"

Be aware that this disables ALL address mappings there, so it will
eliminate your BCC, not change it.

Another possibility might be an alternate cleanup(8) service:

http://www.postfix.org/postconf.5.html#cleanup_service_name

Give that cleanup service the necessary -o options to do the BCC.
--
http://rob0.nodns4.us/ -- system administration and consulting
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Владимир Кутявин

unread,
May 12, 2012, 1:04:27 PM5/12/12
to
On 12.05.2012 17:07, Wietse Venema wrote:
> As documented in the smtpd(8) manpage, always_bcc is not an smtpd(8)
> feature. I put a great deal of effort to provide accurate
> documentation. I would appreciate it if you would take the effort to
> read it. Wietse

As documented in the master(5)

-o name=value
Override the named main.cf configuration
parameter. The parameter value can refer to other parameters as $name
etc., just like in main.cf. See postconf(5) for syntax.

And there is no links to the smtpd(8) document. It confuses. I was
think, that I was read all that is necessary to make my own master.cf.


Ok there. Any way to make postfix do bcc for themessages from specified
sender to specified recipient?

Peter

unread,
May 12, 2012, 4:51:20 PM5/12/12
to
On 13/05/12 05:04, Владимир Кутявин wrote:
> Ok there. Any way to make postfix do bcc for themessages from specified
> sender to specified recipient?

sender_bcc_maps


Peter

Vladimir V Kutyavin

unread,
May 12, 2012, 6:07:32 PM5/12/12
to
I want to copy (all messages from a...@domain.org to a2.anotherdomain.org)
to a...@domain.org

sender_bcc_maps unuseful here

Vladimir V Kutyavin

unread,
May 12, 2012, 6:13:39 PM5/12/12
to
On 12.05.2012 23:48, Wietse Venema wrote:
> Override the option FOR THE COMMAND CONFIGURED IN THAT LINE. Wietse

Now I understand it, but it was not clear from the manual. Inaccurate
documentation.

Wietse Venema

unread,
May 12, 2012, 7:40:00 PM5/12/12
to
Vladimir V Kutyavin:
If you are so smart, then you can post a diff.

Wietse

Vladimir V Kutyavin

unread,
May 14, 2012, 1:32:19 AM5/14/12
to
On 12.05.2012 17:53, /dev/rob0 wrote:
> Another possibility might be an alternate cleanup(8) service:
> http://www.postfix.org/postconf.5.html#cleanup_service_name Give that
> cleanup service the necessary -o options to do the BCC.

But I can't find any way to define non-default cleanup service name only
for the specified correspondence. Is it possible?

/dev/rob0

unread,
May 14, 2012, 1:02:13 PM5/14/12
to
Normally, trimming of excess quotes is a Good Thing. This time some
of the quotes were not excess, however. Here's the parent post:

On Sat, May 12, 2012 at 08:53:57AM -0500, /dev/rob0 wrote:
> On Sat, May 12, 2012 at 03:28:08PM +0400, Vladimir V Kutyavin wrote:
> > I have set this trigger for the specification of non-default options
> > with key -o, I need to override always_bcc option:
> >
> > 127.0.0.1:10027 inet n - n - 10 smtpd
> > -o content_filter=
> > -o smtpd_sender_restrictions=
> > -o always_bcc=co...@AAAAAAA.org
>
> Options given to smtpd(8) must be valid options for smtpd; neither
> always_bcc nor recipient_bcc_maps are among those options.
>
> > How to make it work?
>
> This is one way:
>
> http://www.postfix.org/postconf.5.html#receive_override_options
>
> " -o receive_override_options=no_address_mappings"
>
> Be aware that this disables ALL address mappings there, so it will
> eliminate your BCC, not change it.
>
> Another possibility might be an alternate cleanup(8) service:
>
> http://www.postfix.org/postconf.5.html#cleanup_service_name
>
> Give that cleanup service the necessary -o options to do the BCC.

What you will want is something like this in master.cf:

127.0.0.1:10027 inet n - n - 10 smtpd
-o content_filter=
-o smtpd_sender_restrictions=
-o cleanup_service_name=altbcc
-o syslog_name=postfix/altbcc
altbcc unix n - n - 0 cleanup
-o recipient_bcc_maps=$hash:$config_directory/alt_rcpt_bcc

$config_directory/alt_rcpt_bcc contains your BCC mappings, and a
transport(5) mapping directs the appropriate mail to this special
smtpd.

Vladimir V Kutyavin

unread,
May 14, 2012, 1:33:08 PM5/14/12
to
Big thanks! I would use -o cleanup_service_name=altbcc and would be happy.

I would never have guessed, because the smtpd(8) has not any reference
to cleanup_service_name option.

Wietse Venema

unread,
May 14, 2012, 2:13:30 PM5/14/12
to
Vladimir V Kutyavin:
Looks like service-name parameters were not added to the manpages
of individual programs, when those parameters were introduced in
Postfix 2.0.

Wietse

0 new messages