Can I use alternation in the negation pattern to match multiple addresses to exclude?
if !/^(nobody|noreply|noone)@/ On Mon, Feb 21, 2022 at 11:15 PM billy noah <billyn...@gmail.com> wrote: > Thank you so much Viktor. > > Yes this instance only sends mail for a small handful of domains in our > organization and does not accept or relay any mail. That said, your > suggestions about the regex are well advised and I will make some > adjustments. > > I had no idea that the regex table could take conditional arguments! That > will work perfectly. By any chance are you a member on serverfault.com? > I've posted this question there - if you'd like to answer it before the > bounty expires you're more than welcome: > https://serverfault.com/questions/1093289/postfix-sender-bcc-maps-ignore-a-specific-user > > On Mon, Feb 21, 2022 at 10:52 PM Viktor Dukhovni < > postfix-us...@dukhovni.org> wrote: > >> On Mon, Feb 21, 2022 at 08:17:17PM -0500, billy noah wrote: >> >> > /^([^@]+)@[a-zA-Z0-9_]+\.[a-zA-Z0-9_]+$/ $1...@example.com >> > >> > This works great, however I have an email address nob...@example.com >> that >> > I'd like to *exclude* from this configuration. How can I configure >> > sender_bcc_maps to *completely ignore* a specific sender's address. >> >> I hope the rather non-specific domain match is never applied to incoming >> mail from outside, and this is an exclusively "outbound" MTA... >> >> Note that valid email domain names don't contain "_" characters, you can >> leave these out of the "domain part" of the address. Also matching is >> case insensitive by default. Domain names can contain "-" characters, >> but perhaps yours don't, in which case: >> >> if !/^nobody@/ >> /^([^@]+)@[a-z0-9]+\.[a-z0-9]+$/ $1...@example.com >> endif >> >> -- >> Viktor. >> >