[CentOS] Postfix question: How to reject email with a certain subject header

Thu Jun 18 01:26:50 UTC 2009
Filipe Brandenburger <filbranden at gmail.com>

Hi,

On Wed, Jun 17, 2009 at 19:48, nate<centos at linuxpowered.net> wrote:
> header_checks = regexp:/etc/postfix/regexp_table
>
> and in /etc/postfix/regexp_table something like:
> /^Subject: This is the subject I want to reject             REJECT 554 Custom rejection message

You missed a "/" to close the regexp...

If you want to discard the message you can use DISCARD instead of
REJECT. See the ACTIONS section of "man header_checks" or the manpage
here: http://www.postfix.org/header_checks.5.html

It should be something like:

/^Subject: Rejected posting to /           DISCARD Delete returns from listserv

The "Delete returns from listserv" message will appear on your logs,
so it will be easier to see which (or how many!) messages are being
discarded.

HTH,
Filipe