<div dir="ltr"><div>On Wed, 27 Oct 2021 at 18:27, <<a href="mailto:dovecot@ptld.com">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">> On 10-27-2021 12:06 pm, Felix Ingram wrote:<br>
> <br>
> <a href="mailto:user1@foobar.mydomain.com" target="_blank">user1@foobar.mydomain.com</a><br>
> <a href="mailto:user2@foobar.mydomain.com" target="_blank">user2@foobar.mydomain.com</a><br>
> <a href="mailto:user1@barbaz.mydomain.com" target="_blank">user1@barbaz.mydomain.com</a><br>
> <a href="mailto:user2@barbaz.mydomain.com" target="_blank">user2@barbaz.mydomain.com</a><br>
> <br>
> I would like all emails to the "foobar" subdomain to end up in their <br>
> own mailbox and all emails to the "barbaz" subdomain to go to their own <br>
> mailbox.<br>
<br>Your question might be more suited to the postfix mailing list. Dovecot <br>
doesn't receive mail from the internet, which i believe you understand <br>
as you said "have postfix accepting the emails before passing them to <br>
Dovecot".<br>
<br>
On the postfix side, one option would be using one mailbox and one <br>
catchall for each subdomain.<br>
<br>
    Setup a user: <a href="mailto:catchall@foobar.mydomain.com" target="_blank">catchall@foobar.mydomain.com</a><br>
    Setup an alias: @<a href="http://foobar.mydomain.com" rel="noreferrer" target="_blank">foobar.mydomain.com</a> -> <a href="mailto:catchall@foobar.mydomain.com" target="_blank">catchall@foobar.mydomain.com</a><br>
<br>
    Setup a user: <a href="mailto:catchall@barbaz.mydomain.com" target="_blank">catchall@barbaz.mydomain.com</a><br>
    Setup an alias: @<a href="http://barbaz.mydomain.com" rel="noreferrer" target="_blank">barbaz.mydomain.com</a> -> <a href="mailto:catchall@barbaz.mydomain.com" target="_blank">catchall@barbaz.mydomain.com</a><br>
<br>
On the dovecot side, you can setup each person with their own login user <br>
and all of those users access the same IMAP inbox. Or you could just <br>
give everyone the password to the same one mailbox <br>
<a href="mailto:catchall@foobar.mydomain.com" target="_blank">catchall@foobar.mydomain.com</a>.<br>
<br></blockquote><div><br></div><div>So I think this would make sense, though one stumbling block could be that we don't </div><div>know the various subdomains ahead of time. The purpose of the system is that users</div><div>can create disposable/temporary email addresses for various testing jobs. The subdomain </div><div>can be any value that the user wants, and we don't want them to have to precreate them before </div><div>they can use an address (we have an existing system that works this way, and so we want to </div><div>keep that behaviour). I think your approach would work, however, if I set up aliases similar to:</div><div><br></div><div>@<a href="http://barbaz.mydomain.com">barbaz.mydomain.com</a> -> <a href="mailto:barbaz@mydomain.com">barbaz@mydomain.com</a>.<br></div><div><br></div><div>I believe I can do that in postfix with some regex magic.</div><div>I would then want users to log in as "barbaz", and get access to all of the emails. I believe that</div><div>if I create Dovecot users for my system users, and then set them as master users, then they will </div><div>be able to log into Dovecot with something like:<br></div><div><br></div><div>barbaz*<system user account></div><div><br></div><div>as their username.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Not sure "dovecot creating users" is the right way to think about it. <br>
Dovecot simply looks for IMAP files where its told to look. In dovecot <br>
config you setup flat files or databases that tell dovecot if someone <br>
logs in with this user:pass then look in this /server/path for emails. <br>
Other than that config, which you could point to a different <br>
/server/path changing their inbox, there are no "accounts".<br></blockquote><div><br></div><div>I think my "creating users" was me wanting to make sure that when postfix passes an email for</div><div>"<a href="mailto:barbaz@mydomain.com">barbaz@mydomain.com</a>" to Dovecot, then Dovecot will store it and wait for someone to come along</div><div>and impersonate barbaz. i.e. "barbaz" doesn't have to exist as a user already before Dovecot will store the</div><div>mail.</div><div><br></div><div>Thanks again for the pointers - I shall play with postfix local delivery before trying to wire up Dovecot.</div><div><br></div><div>Regards,</div><div><br></div><div>Felix</div></div></div>