<html><head></head><body>Interesting. Have you looked at this?<br><br><a href="https://serverfault.com/questions/133190/host-wildcard-subdomains-using-postfix">https://serverfault.com/questions/133190/host-wildcard-subdomains-using-postfix</a><br><br>[People have too much "flair" and rep points and I can't participate in those stackexchange discussions or ask or answer like I used to.]<br><br><div class="gmail_quote">On October 27, 2021 3:15:01 PM AKDT, dovecot@ptld.com wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre dir="auto" class="k9mail"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I think your approach would work, however, if I set<br>up aliases similar to:<br><br>@barbaz.mydomain.com -> barbaz@mydomain.com.<br><br>I believe I can do that in postfix with some regex magic.<br></blockquote><br>Yes, that would work perfectly without any regex.<br>You just point the catchall alias to the "user".<br>@barbaz.mydomain.com -> barbaz@mydomain.com<br><br><br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">one stumbling block could be that we don't<br>know the various subdomains ahead of time.<br><br>The subdomain can be any value that the user<br>wants, and we don't want them to have to<br>precreate them before they can use an address<br></blockquote><br>Best to my knowledge this is not possible with postfix. But ask the <br>postfix mailing list to get a definitive answer. In postfix you have to <br>tell it the domains it accepts mail for, anything else it considers <br>relaying. Otherwise how does postfix know that email is meant to be <br>saved here or it is just passing through and you want postfix to query <br>DNS to find out where it goes (if relaying is even allowed).<br><br><br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">The purpose of the system is that users can create disposable/temporary <br>email addresses for various testing jobs.<br></blockquote><br>Are you aware of postfix recipient_delimiter? It allows for disposable / <br>wild card addresses. If enabled in postfix, you setup a mailbox user <br>like barbaz@mydomain.com and any address with that user and the <br>delimiter would still get delivered to that user.<br><br> barbaz@mydomain.com -> barbaz@mydomain.com<br> barbaz+randomtext@mydomain.com -> barbaz@mydomain.com<br> barbaz+test1@mydomain.com -> barbaz@mydomain.com<br><br>You can change the + to any symbol you want postfix to look out for.<br><br><br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I think my "creating users" was me wanting to make sure that when <br>postfix<br>passes an email for "barbaz@mydomain.com" to Dovecot, then Dovecot will <br>store it and wait for<br>someone to come along and impersonate barbaz. i.e. "barbaz" doesn't <br>have to exist as a user<br>already before Dovecot will store the mail.<br></blockquote><br>If you are using LMTP dovecot will only accept emails from postfix that <br>it can lookup the /directory/path to from one of the userdb{} or <br>passdb{} sections. If dovecot can not find a match in any of the <br>userdb{} or passdb{} it will reject the email as user unknown causing <br>postfix to send a undeliverable notice email back to the envelope sender <br>address, also known as back-scatter. I am not aware of a way to use <br>wildcard addresses in dovecot userdb{}, i don't think its possible but i <br>don't know what i don't know.<br></pre></blockquote></div><div style='white-space: pre-wrap'><div class='k9mail-signature'>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></div></body></html>