Hi, First, I am very new to using Pigeonhole/Sieve with Dovecot and I am struggling with a problem which could be easy to solve but is just a lack of understanding on my end... We use a simple system for routing emails to different email users by postfixing the addresses with the actual user: xxxJohn at domain; yyyJohn at domain etc all will be delivered to user John. (This way John can invent a new email address on-the-fly and that will be delivered to his email box.) Delivering these emails to the right mailbox is easy:? if address :contains "to" "John" ... All mail not matched will go to the general (catchall) mail box. The problem occurs when the email is sent to more addresses at the same domain.? Eg. if an email is sent to xxxJohn at domain, zzzAlex at domain and info at domain Either, all emails also end up in the catch-all, or the email is delivered to the first matching rule only. I do not understand how to use the different TO addresses in the match rules. How can I determine that there are recipients other than xxxJohn or zzzAlex? Any help in pointing me in the right direction is appreciated! Robert
* Robert via dovecot:> We use a simple system for routing emails to different email users by > postfixing the addresses with the actual user: xxxJohn at domain; > yyyJohn at domain etc all will be delivered to user John. > (This way John can invent a new email address on-the-fly and that will > be delivered to his email box.)This seems like a strange way achieve flexible email addresses. Are you aware of sub-addressing? It has been around for ages, and is supported by Dovecot (and Gmail, incidentally). Imagine an existing email account <alice at example.com>. If alice wants to use a subadress, she signs up with <alice+foo at example.com>, and Dovecot can automatically place incoming mail for that address into INBOX/foo (or just INBOX if INBOX/foo does not exist). Alice can use as many sub-adresses as she needs without anybody making config changes. Frankly, the Sieve-based approach you describe seems pretty complicated in comparison. -Ralph
On 22-11-19 22:48, Ralph Seichter via dovecot wrote:> * Robert via dovecot: > >> We use a simple system for routing emails to different email users by >> postfixing the addresses with the actual user: xxxJohn at domain; >> yyyJohn at domain etc all will be delivered to user John. >> (This way John can invent a new email address on-the-fly and that will >> be delivered to his email box.) > > This seems like a strange way achieve flexible email addresses. Are you > aware of sub-addressing? It has been around for ages, and is supported > by Dovecot (and Gmail, incidentally). > > Imagine an existing email account <alice at example.com>. If alice wants to > use a subadress, she signs up with <alice+foo at example.com>, and Dovecot > can automatically place incoming mail for that address into INBOX/foo > (or just INBOX if INBOX/foo does not exist). Alice can use as many > sub-adresses as she needs without anybody making config changes. > > Frankly, the Sieve-based approach you describe seems pretty complicated > in comparison. >From the OP it seems that they separate mail for different users not at the MTA level, but at at the user level using sieve. That seems very inefficient to me. There are nice tricks you can do with virtual alias maps and pcre within postfix to split email to specific user accounts, which could also accommodate other alias schemes than standard subaddressing (such as yours). Kind regards, Tom
On 2019-11-22, Ralph Seichter via dovecot <dovecot at dovecot.org> wrote:> * Robert via dovecot: > >> We use a simple system for routing emails to different email users by >> postfixing the addresses with the actual user: xxxJohn at domain; >> yyyJohn at domain etc all will be delivered to user John. >> (This way John can invent a new email address on-the-fly and that will >> be delivered to his email box.)But now you can't have a username like "BigJohn at domain". To avoid this problem a separator character of some sort (that isn't used in a normal email address at your site) is really wanted.> This seems like a strange way achieve flexible email addresses. Are you > aware of sub-addressing? It has been around for ages, and is supported > by Dovecot (and Gmail, incidentally). > > Imagine an existing email account <alice at example.com>. If alice wants to > use a subadress, she signs up with <alice+foo at example.com>, and Dovecot > can automatically place incoming mail for that address into INBOX/foo > (or just INBOX if INBOX/foo does not exist). Alice can use as many > sub-adresses as she needs without anybody making config changes.This method works well, but the separator character can be a problem. "+" is traditional, but is widely blocked by website validators - if you can use "-" or "." instead they're much more likely to be accepted.
On 22 Nov 2019, at 14:48, Ralph Seichter <abbot at monksofcool.net> wrote:> * Robert via dovecot: > >> We use a simple system for routing emails to different email users by >> postfixing the addresses with the actual user: xxxJohn at domain; >> yyyJohn at domain etc all will be delivered to user John. >> (This way John can invent a new email address on-the-fly and that will >> be delivered to his email box.) > > This seems like a strange way achieve flexible email addresses. Are you > aware of sub-addressing? It has been around for ages, and is supported > by Dovecot (and Gmail, incidentally).Seconded, this is the way to go.> Imagine an existing email account <alice at example.com>. If alice wants to > use a subadress, she signs up with <alice+foo at example.com>, and Dovecot > can automatically place incoming mail for that address into INBOX/foo > (or just INBOX if INBOX/foo does not exist). Alice can use as many > sub-adresses as she needs without anybody making config changes.Far too many web monkeys seem to get their email validation coede from the same inept repository somewhere, and return error that ?+? is not allowed in email addresses. The larger the company, the more likely they are to be incompetent, so I have setup my dovecot and postfix to use two legal delimiters, + and _> Frankly, the Sieve-based approach you describe seems pretty complicated > in comparison.And prone to failure. Mallory at example.com JonMallory at example.com MalloryJones at example.com Use address extensions. This is all that is required to setup two delimiters: /etc/postfix/main.cf recipient_delimiter = +_ /etc/dovecot/dovecot.conf protocol lmtp { ? recipient_delimiter = +_ } -- Yeah, and I never wanted to kick Albert Einstein in the nuts.