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
* Tom Hendrikx via dovecot:> 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).Postfix supports sub-addressing out of the box, simply by setting the "recipient_delimiter" configuration parameter[1]. -Ralph [1] http://www.postfix.org/postconf.5.html#recipient_delimiter
I do know that sub-addressing with a special character is nowadays a normal, better, way to do it. Unfortunately we have used this system for a very long time, starting around 2005... So there are a lot of existing email addresses. I am considering changing to a new hosting company, that's why I started looking for a solution.? The current company has very limited functionality for filtering using a simple webinterface, but the system I described works. The new hosting company uses all the nice features that brought me to this mailing list and I just want to find a solution for the existing email addresses. (We will switch to proper sub-addressing for new emailaddresses if I switch to the new hosting) From what I understand there is no easy solution for solving this at the MTA level, and at the user level it is not easy to differentiate between multiple recipients? I have been trying different approaches (like regexes using (?!john), which I couldn't get to work) and belo is hat I came up with so far. The problem with this is that all emails to multiple recipients still end up in the general mailbox, but emails send only to one recipient works ok. Any suggestions on improving? Or a completely different approach? --Robert if address :contains ["to","cc"] "john@<domain>" { ??? # only one recipient ??? if address :count "eq" :comparator "i;ascii-numeric" ["to","cc"] "1" ??? { ??????? #redirect or fileinto ??? ??? redirect "joh at example.com"; ? ?? ?? stop; ??? } ??? else{ ? ? ? ? #redirect or fileinto and continue with next filter ??? ?? ?redirect :copy "john at example.com"; ??? } } Ralph Seichter schreef op 23-11-2019 om 18:40:> * Tom Hendrikx via dovecot: > >> 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). > Postfix supports sub-addressing out of the box, simply by setting the > "recipient_delimiter" configuration parameter[1]. > > -Ralph > > [1] http://www.postfix.org/postconf.5.html#recipient_delimiter
On 23-11-19 18:40, Ralph Seichter via dovecot wrote:> * Tom Hendrikx via dovecot: > >> 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). > > Postfix supports sub-addressing out of the box, simply by setting the > "recipient_delimiter" configuration parameter[1]. > > -Ralph > > [1] http://www.postfix.org/postconf.5.html#recipient_delimiter >Standard subaddressing is not able to support the addressing scheme the OP has in place. But there are other ways, such as pcre alias maps, that will solve his problem a lot easier than Sieve address parsing, without discarding the existing (albeit peculiar) subaddressing scheme. I just wanted to make sure that the OP was aware of this. Kind regards, Tom