<div dir="ltr"><div dir="ltr">On Thu, 28 Oct 2021 at 08:29, Felix Ingram <<a href="mailto:f.ingram@gmail.com">f.ingram@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Thu, 28 Oct 2021 at 00:15, <<a href="mailto:dovecot@ptld.com" target="_blank">dovecot@ptld.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[...]</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> I think my "creating users" was me wanting to make sure that when <br>
> postfix<br>
> passes an email for "<a href="mailto:barbaz@mydomain.com" target="_blank">barbaz@mydomain.com</a>" 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>
<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></blockquote><div><br></div><div>So I think this will be the main issue now - there's no way of knowing the </div><div>addresses ahead of time, so it sounds like I'll need to add them to userdb{} when they</div><div>hit postfix and before they get passed to dovecot.</div></div></div></blockquote><div><br></div><div>Just to close the loop on this - I managed to get this working using postfix's virtual aliases. I use </div><div>a postgresql function in the alias lookup that transforms '<a href="mailto:tester@foobar.mydomain.com">tester@foobar.mydomain.com</a>' into </div><div>'<a href="mailto:foobar@mydomain.com">foobar@mydomain.com</a>' and at the same time inserts '<a href="mailto:foobar@mydomain.com">foobar@mydomain.com</a>' into the </div><div>Dovecot users table. I then have a separate passdb for master users that can log in and </div><div>impersonate the foobar user.</div><div><br></div><div>So far this seems to work.</div><div><br></div><div>Thanks again to everyone for the help.</div><div><br></div><div>Felix</div></div></div>