Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure wildcard catch-all email with Postfix

I have a setup using Postfix with a MySQL database to configure domains, accounts and aliases.

I can set up a catch-all address when using a @example.com mail and forward it to [email protected].

Now I want a more advanced catch-all, like user-%@example.com to forward all to [email protected] and prod-%@example.com forward to [email protected]. % should be any alpha-numeric letter combination like [email protected] or [email protected].

Is this possible or do I need to change my setup?

like image 673
arnep Avatar asked Nov 29 '25 19:11

arnep


1 Answers

Seems feasible enough with slight effort; Postfix supports random user-created aliases via the recipient_delimiter configuration directive, so you could set recipient_delimiter = - and create [email protected] as an alias to [email protected], and user-%@example.com would resolve first via recipient_delimiter to [email protected], and from there via the alias map to [email protected]. (If you already have email addresses containing dashes in your domain, you'll need to choose a different delimiter, or those addresses will stop working.)

like image 64
Aaron Miller Avatar answered Dec 03 '25 01:12

Aaron Miller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!