On 5/17/2018 3:20 PM, Wietse Venema wrote:
Wietse Venema:
deoren:
/etc/postfix/sender-access.cf:
# First, a rule that matches health-check mail.
[email protected] DUNNO
# Add a BCC recipient to other email.
* BCC [email protected]
For the last entry that BCC's "everything else", is the * character a
valid source?
The access map syntax is documented. http://www.postfix.org/access.5.html
There is no '*' in there.
If you must filter on sender address, you can use a regexp: or pcre:
table.
smtpd_xxx_restrictions =
...
check_sender_access pcre:/etc/postfix/sender-access.pcre
...
/etc/postfix/sender-access.pcre:
# First, a rule that matches health-check mail.
/^smtp-health-checks@example\.com$/ DUNNO
# Add a BCC recipient to other email.
. BCC [email protected]
The ^, $, \, and . are special only when you use regexp: or pcre:.
They are not part of the access map syntax.
Instead of the above pair of rules you could use if..endif, but
again, those are not part of the access map syntax, but of the
specific lookup table.
Wietse
Thank you for your help. Re the '*' syntax, I wasn't sure how to
accomplish the goal of matching everything, so thanks for clearing that
up. I ended up going with this setup based off of your feedback and the
original example I found from Victor Duchovni:
/etc/postfix/main.cf
# BCC mail flowing through this relay EXCEPT for
# health check emails for future troubleshooting
pcre:/etc/postfix/auto_bcc.pcre
# Other checks/actions
proxy:mysql:/etc/postfix/mysql-sender_access.cf,
/etc/postfix/auto_bcc.pcre
# though this content is indented to stand out
# there is no indention in the file itself
if !/^haproxy-smtp-check@example\.com$/
/@/ BCC [email protected]
endif
So far it appears to be working just fine. Thanks again for your help.