> On May 14, 2015, at 7:41 AM, Barbara M. <barb...@rfx.it> wrote: > > On Thu, 14 May 2015, jason hirsh wrote: > >> I have bene using >> https://regex101.com >> for test and evaluation It has also helped on my composition > > Cool. > But I can't still find a solution. > I am not a regex expert (obiviosly). > I write simple expression when needed, but I can't find how to improve the > AND condition. > Tried solutions like: > > /.*\@.*domainsource.tld.*\@.*domaindest.tld/ REJECT > /.*\@.*domaindest.tld.*\@.*domainsource.tld/ > > without success. > Surely it is a trivial trick that I don't see :-(
In you choice of sample domains names it seems like you are trying to get mail from a location (domainsource.tld) going to a location (domaindest.tld) if domainsource.tld has no valid email I would try \/.*(.*domainsource.tld.*)/ Put this in the tester brining in information from the raw message and tweak the wildcards till you get a match but I am no expert in this > > Thanks, B. > > > > > >> On May 14, 2015, at 6:48 AM, Barbara M. <barb...@rfx.it> wrote: >> I am trying to use regexp to block mails from specific domains to >> specific users (and let other users receive it). >> I need to merge (logical AND operator), something like: >> /^From:.*\@.*domainsource.tld/ REJECT No Unrequested mail Please >> /^To:.*\@.*domaindest.tld/ REJECT No Unrequested mail Please >> For my needs I want these rules evaluated in AND. >> How can do this with a valid rules in my /etc/postfix/header_checks? >> If there is a better solution ... ;-) >> Thanks, B.