Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

Unfortunately, this isn't super straightforward in postfix, but certainly doable.

/etc/postfix/main.cf, set header_checks to:

header_checks = regexp:/etc/postfix/my_custom_header

Then create /etc/postfix/my_custom_header and put this regular expression in it:

/^Content-Transfer-Encoding:/i PREPEND Precedence: bulk 

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 your Precedence: bulk line right before it, hence the PREPEND 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.