Hello all, I'm building a mail system and would like to check whether my design is feasible. I'm fairly certain that it is but I think I don't have the right words and concepts lined up properly in my head. The end system will provide temporary/disposable email addresses that can be accessed by multiple people. People would be able to send email to addresses that match the following format: user1 at foobar.mydomain.com user2 at foobar.mydomain.com user1 at barbaz.mydomain.com user2 at barbaz.mydomain.com I would like all emails to the "foobar" subdomain to end up in their own mailbox and all emails to the "barbaz" subdomain to go to their own mailbox. (I think that means I need a foobar and barbaz user on Dovecot). Users of the system should be able to see all of the emails, including the original addresses they were sent to. e.g. user1 at foobar.mydomain.com and user2 at foobar.mydomain.com both get delivered to the "foobar" mailbox, and users can see all emails, including that they were sent to "user1" and "user2" The users of the system would be able to access any of the foobar, barbaz, etc mailboxes - I believe that means that they would need to be set as master users. I will be creating a web interface for users to get/set their credentials, so can add those users on an adhoc basis, but I will need to have the "foobar", "barbaz", etc users created whenever an email arrives (we won't know ahead of time). The plan is to have postfix accepting the emails before passing them to Dovecot. I don't believe postfix needs to do much processing but that this would be the place to transform the address into the correct user/mailbox name. So my questions are: 1. Does the above sound reasonable? 2. Can Dovecot auto-create users as needed? 3. Will I be able to preserve the original email? 4. Are master users the right approach? There is no strong requirement for privacy between mailboxes - there is no issue with one user being able to read all email. There is also no requirement to be able to send email but that is a feature request for the future - we would want people to be able to send as the original address when that's implemented. Any pointers gratefully received. Thanks in advance, Felix -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20211027/9dd4221d/attachment.html>
> On 10-27-2021 12:06 pm, Felix Ingram wrote: > > user1 at foobar.mydomain.com > user2 at foobar.mydomain.com > user1 at barbaz.mydomain.com > user2 at barbaz.mydomain.com > > I would like all emails to the "foobar" subdomain to end up in their > own mailbox and all emails to the "barbaz" subdomain to go to their own > mailbox.Your question might be more suited to the postfix mailing list. Dovecot doesn't receive mail from the internet, which i believe you understand as you said "have postfix accepting the emails before passing them to Dovecot". On the postfix side, one option would be using one mailbox and one catchall for each subdomain. Setup a user: catchall at foobar.mydomain.com Setup an alias: @foobar.mydomain.com -> catchall at foobar.mydomain.com Setup a user: catchall at barbaz.mydomain.com Setup an alias: @barbaz.mydomain.com -> catchall at barbaz.mydomain.com On the dovecot side, you can setup each person with their own login user and all of those users access the same IMAP inbox. Or you could just give everyone the password to the same one mailbox catchall at foobar.mydomain.com. Not sure "dovecot creating users" is the right way to think about it. Dovecot simply looks for IMAP files where its told to look. In dovecot config you setup flat files or databases that tell dovecot if someone logs in with this user:pass then look in this /server/path for emails. Other than that config, which you could point to a different /server/path changing their inbox, there are no "accounts".
On Wed, 27 Oct 2021, Felix Ingram wrote:> [...] > > People would be able to send email to addresses that match the following > format: > > user1 at foobar.mydomain.com > user2 at foobar.mydomain.com > > user1 at barbaz.mydomain.com > user2 at barbaz.mydomain.com > > [...] > > I will be creating a web interface for users to get/set their credentials, > so can add those users on an adhoc basis, but I will need to have the > "foobar", "barbaz", etc users created whenever an email arrives (we won't > know ahead of time). > > [...]Further to the responses you have received already, I'd like to note that if you want to receive mail at {alias}@{user}.mydomain.com then, at the time of *sending* the e-mail there needs to be an MX record for user, as otherwise the sender won't be able to connect to your (postfix) server. That means that the users will have to exist *before* postfix receives the message, and thus clearly before dovecot receives it.. so you may have to reconsider your requirement of adding users of on-the-fly. Of course, you could use a wildcard MX, but my understanding is that this can cause problems (but I'd have to check in RFC1912 and RFC4592). Cheers.