On Fri, Jan 16, 2026 at 07:29:03PM -0800, Randy Bush via Postfix-users wrote:
> > You have failed to mention whether this is, or is not a virtual alias > > domain > > it is now :) fwiw, the MX targets have no local mailboxes. it's all > onward transport, O(dozen) in `relay_domains`. Good, and along with indexed tables instead of "regexp" or "pcre", you should be all set. > > but a real virtual alias domain already requires matching > > **envelope** addresses in the virtual alias table, and I'd NEVER > > recomment use of regular expressions in that context. > > care to explain why not? Because the syntax of email headers is far too intracate to be matched by either "regexp" or "pcre" regular expressions, and especially those naïvely slapped together by all but the most detail-oriented craftsmen are unlikely to do the job even approximately well. > > The PCREs are poorly anchored, better REs would be: > > if /@bogus\.com$/ > > /^foo@[^@]*$/ [email protected] > > /^bar@[^@]*$/ [email protected] > > /^feen@[^@]*$/ [email protected] > > fi > > wow! ok. and that's why pcre, eh? Except that I mixed up Postfix and shell syntax on the last line, it should have been (but irrelevant, since DON'T do this): if /@bogus\.com$/ /^foo@[^@]*$/ [email protected] /^bar@[^@]*$/ [email protected] /^feen@[^@]*$/ [email protected] endif as documented in either "regexp_table(5)" or "pcre_table(5)", both support "if /.../", ... "endif" blocks. And in fact the expressions above are verbatim identical between 'regexp" and "pcre", use neither to your heart's content! :-( > > And of course one should/would not use a regexp virtual(5) table: > > > > main.cf: > > indexed = ${default_database_type}:${config_directory}/ > > virtual_alias_domains = bogus.com > > virtual_alias_maps = ${indexed}virtual > > > > virtual: > > [email protected] [email protected] > > [email protected] [email protected] > > [email protected] [email protected] > > hmmm. i need to think more. See: ADDRESS_CLASS_README VIRTUAL_README virtual(5) and perhaps even first (if not too basic): BASIC_CONFIGURATION_README > there are a fair number of domains being forwarded, most to a remote > default smtp server which actually deals with all the virtuals plus > a few hundred local mailboxes. List then all in: main.cf: virtual_alias_domains = bogus.com, bogus.net, bogus.org, ... ... virtual: [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ... > just this one particular domain, bogus.com, seems to attract hundreds > of spam emails a day which rspamd classifies as /X-Spam: YES/ which i > have to review manually. Basic recipient validation is not an anti-spam measure, it is basic hygiene to reject invalid addresses on input, and even a courtesty to senders who mistype a recipient address, and would now receive a bounce. > i need to read and think more > > thanks for all sorts of clues See the referenced docs. -- Viktor. 🇺🇦 Слава Україні! _______________________________________________ Postfix-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
