Duncan B. wrote: > On Thu, 8 Oct 2009, Victor Duchovni wrote: > > >>> I am setting up an SMTP backup MX server for a customer, and one of >>> their >>> specifications is that we check incoming mail for NDR/bounce mails >>> without >>> a valid "watermark". Surfcontrol adds a header similar to 'X-SEF' >>> with a UUID on outbound mail, so any mail that's a bounce without >>> this UUID >>> header will be invalid. >>> >>> I will have to use the header_checks regexp directive, but how do I >>> ONLY >>> perform this check for a bounce (ie, MAIL FROM: <>) ? >> >> You need a suitable content_filter or milter. No built-in Postfix >> feature >> checks for the absence of a header, let alone conditions such a check >> on the envelope sender address. > > Hi Viktor, > > I was trying to do something like the following in header_checks > if /^From:.*<>/ > !/^X-SEF/ REJECT > endif The above if is invalid. You cannot check two different headers at the same time. Postfix inspects headers one at a time.
In addition, the From header does not mean it will match MAIL FROM.