On Mon, Dec 24, 2018 at 09:02:53AM -0500, Wietse Venema wrote: > > Is it possible to combine header/body checks in such a way: > > > > If /^(From|Return-Path):.*\b(user@testdomain\.org)\b/ > > ! /^Message-ID:.*@(testdomain\.org)/ > > Reject ... > > That is documented as NOT POSSIBLE. > > if /pattern/flags > > endif If the input string matches /pattern/, then match that input > string against the patterns between if and endif. The if..endif > can nest.
Thank you for your reply, Wietse, about this not being possible. However, I am slightly confused about the documentation saying that if..endif is allowed to nest. Does this mean that I could write something like the following: if /pattern/flags if !/pattern/flags endif endif If so, I would think I could write a nested if..endif that did what I wanted. The first if..endif could check to see if the From/Return Path matched our domain. If it did, wouldn't it then step into the internal if..endif, where I could check to see if the message ID was ours? If not, I could tell Postfix to then reject the message. Or am I misunderstanding what is meant by "the if..endif can nest"? Thanks, Bryan