Can someone please provide an example on how to add a
Precedence: bulk
header to all outgoing emails using postfix.
I would like to know what file(s) to create or edit and what I should put in them. And also what to do to make postfix read in the new configuration.
I have read quite a bit of documentation but it seems to expect a high level of familiarity with postfix. All I have gathered so far is that it may have something to do with /etc/postfix/main.cf
and somehow add a PREPEND statement.
Note that mucking about with postfix (and email in general) is way out of my comfort zone.
Best Answer
Unfortunately, this isn't super straightforward in postfix, but certainly doable.
/etc/postfix/main.cf, set header_checks to:
Then create /etc/postfix/my_custom_header and put this regular expression in it:
Then restart postfix - depends on your distro, but most likely you can restart it with
service postfix restart
or/etc/init.d/postfix restart
.Thats about it. What this does is that postfix will find the
Content-Transfer-Encoding:
header in the email and add yourPrecedence: bulk
line right before it, hence thePREPEND
action.Now, this assumes that the
Content-Transfer-Encoding
header actually exists in the emails. You may want to take a look at the headers on a typical outgoing email and find a good one to match upon. You can get crazy with the regex to suit your needs.