Fix lmtp_save_to_detail_mailbox to be case insensitive?
To bring this up again because i have not found a work around solution. Can dovecot make lmtp_save_to_detail_mailbox case-insensitive?
If you create a folder "foobar" then an email with recipient user+foobar@example.com will be placed in the folder.
However with the folder as "foobar" an email with recipient user+FOOBAR@example.com will report folder "FOOBAR" not found and the email will be placed in the inbox folder.
On 2022-05-21 19:17, dovecot@ptld.com wrote:
To bring this up again because i have not found a work around solution. Can dovecot make lmtp_save_to_detail_mailbox case-insensitive?
If you create a folder "foobar" then an email with recipient user+foobar@example.com will be placed in the folder.
However with the folder as "foobar" an email with recipient user+FOOBAR@example.com will report folder "FOOBAR" not found and the email will be placed in the inbox folder.
i belive if you post doveconf -n you will get more help :)
and as i sayed on postfix-millist, change %u to %Lu will solve it, if that does not solve it, we have a dokumented bug then
# /etc/dovecot/conf.d/10-auth.conf auth_username_format = %Lu
On 05-21-2022 2:29 pm, Benny Pedersen wrote: On 2022-05-21 19:17, dovecot@ptld.com wrote:
To bring this up again because i have not found a work around solution. Can dovecot make lmtp_save_to_detail_mailbox case-insensitive?
If you create a folder "foobar" then an email with recipient user+foobar@example.com will be placed in the folder.
However with the folder as "foobar" an email with recipient user+FOOBAR@example.com will report folder "FOOBAR" not found and the email will be placed in the inbox folder.
i belive if you post doveconf -n you will get more help :)
and as i sayed on postfix-millist, change %u to %Lu will solve it, if that does not solve it, we have a dokumented bug then
# /etc/dovecot/conf.d/10-auth.conf auth_username_format = %Lu
I fail to understand how the suggestion of %Lu has anything to do with what im talking about. I don't set auth_username_format in conf and let it use the default of %Lu
doveconf -a | grep auth_username_format
auth_username_format = %Lu
I do not believe that setting has anything to do with the issue. Maybe im failing to property convey the issue and i will try to get more verbose. I am setting the following:
recipient_delimiter = +-
lmtp_save_to_detail_mailbox = yes
None of that has anything to do with the lookups. Dovecot accepts the mail from postfix via LMTP. Dovecot already found the valid recipient and accepted the email.
With lmtp_save_to_detail_mailbox enabled, after accepting the email but before placing it in the inbox, dovecot will look for any folders matching the address extension detail and place the email in that folder instead of the default inbox.
This only works if the case matches between the recipient provided by the sender (which we have no control over) and the folder name. For example, i create a folder "foobar" and tell you to send an email to user+foobar@example.com. But instead you type User+FooBar@Example.com. This email will not be placed into the "foobar" folder and the logs will generate a warning of folder "FooBar" not found.
It will only work as expected if the folder "foobar" and the address "user+foobar@example.com" match case exactly. I feel this should be something built into dovecot to do case-insensitive folder matching to the user address extension detail beyond the delimiter. I can not think of a reason you wouldn't want user+FOOBAR@example.com to NOT be placed into your "foobar" folder if you have taken the steps to set the feature up.
https://doc.dovecot.org/settings/core/?highlight=lmtp_save_to_detail_mailbox#core_setting-lmtp_save_to_detail_mailbox
https://doc.dovecot.org/configuration_manual/protocols/lmtp_server/?highlight=lmtp_save_to_detail_mailbox
Here are the redacted LMTP logs:
dovecot[40891]: lmtp(user@example.com)<40889><...>: msgid=...@example.com: save failed to open mailbox FooBar: Mailbox doesn't exist: FooBar dovecot[40891]: lmtp(user@example.com)<40889><...>: msgid=...@example.com: saved mail to INBOX
Just to humor the %Lu suggestion i explicitly put "auth_username_format = %Lu" in the conf, instead of relying on the default, and it still has the same behavior. I believe this is something that has to be fixed in the dovecot code but i can't seem to get Aki's attention on this issue. Im open to more trouble shooting suggestions.
Am 21.05.22 um 23:30 schrieb dovecot@ptld.com:
Dovecot accepts the mail from postfix via LMTP. Dovecot already found the valid recipient and accepted the email.
You need to make postfix pass the extension as lowercase to Dovecot.
See https://wiki.dovecot.org/LDA/Postfix :
An example using address extensions (ie user+extension@domain.com (don't forget to define the proper recipient_delimiter in Postfix's main.cf)) to deliver to the folder 'extension' in your maildir (If you wish to preserve the case of ${extension}, remove the 'hu' flags, ...
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${user}@${nexthop} -m ${extension}
Wouldn’t it be ideal to link to a LMTP documentation page that describes how to do the same thing under LTMP, and not link to LDA?
On 22 May 2022, at 01:07, Daniel Lange DLange@debian.org wrote:
Am 21.05.22 um 23:30 schrieb dovecot@ptld.com:
Dovecot accepts the mail from postfix via LMTP. Dovecot already found the valid recipient and accepted the email.
You need to make postfix pass the extension as lowercase to Dovecot.
See https://wiki.dovecot.org/LDA/Postfix :
An example using address extensions (ie user+extension@domain.com (don't forget to define the proper recipient_delimiter in Postfix's main.cf)) to deliver to the folder 'extension' in your maildir (If you wish to preserve the case of ${extension}, remove the 'hu' flags, ...
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${user}@${nexthop} -m ${extension}
On 2022-05-22 11:33, Lucas Rolff wrote:
Wouldn’t it be ideal to link to a LMTP documentation page that describes how to do the same thing under LTMP, and not link to LDA?
typo :)
https://doc.dovecot.org/configuration_manual/protocols/lmtp_server/
https://wiki.dovecot.org/HowTo/PostfixDovecotLMTP
is google not our friends ? :=)
Neither of those two describe how to lowercase the extension part – that’s a bit the point. One puts info that they use LMTP, another decides to link LDA docs, and even quoting how to lower the extension part, despite that isn’t actually possible in LMTP in a similar manner.
I’m sure the OP had used google prior, and didn’t find any useful information, which is why the question got asked in the first place.
Since you’ve linked the LTMP docs, can you point out where in those docs, it explains anything with lowering the extension part? I can’t find it in the two links.
From: dovecot dovecot-bounces@dovecot.org on behalf of Benny Pedersen me@junc.eu Date: Sunday, 22 May 2022 at 12:26 To: dovecot@dovecot.org dovecot@dovecot.org Subject: Re: Fix lmtp_save_to_detail_mailbox to be case insensitive? On 2022-05-22 11:33, Lucas Rolff wrote:
Wouldn’t it be ideal to link to a LMTP documentation page that describes how to do the same thing under LTMP, and not link to LDA?
typo :)
https://doc.dovecot.org/configuration_manual/protocols/lmtp_server/
https://wiki.dovecot.org/HowTo/PostfixDovecotLMTP
is google not our friends ? :=)
On 2022-05-22 12:35, Lucas Rolff wrote:
Neither of those two describe how to lowercase the extension part –
oh
lmtp is single delivering so multirecipient is not supported, details matter
postfix side of it knows this detail in lmtp
expand extension part in postfix would possible solve it if dovecot side miss it on lmtp server side
that’s a bit the point. One puts info that they use LMTP, another decides to link LDA docs, and even quoting how to lower the extension part, despite that isn’t actually possible in LMTP in a similar manner.
I’m sure the OP had used google prior, and didn’t find any useful information, which is why the question got asked in the first place.
Since you’ve linked the LTMP docs, can you point out where in those docs, it explains anything with lowering the extension part? I can’t find it in the two links.
if its not dokumented its not supported, just like its sayed on postfix maillist if docs does not describe it :)
now you made a typo again
I find it funny you point out typos, considering you do plenty of them yourself in the various mailing lists where you’re present 😉 Before you point fingers at others, maybe consider ensuring your emails are typo-free yourself.
Have a good one Benny.
From: dovecot dovecot-bounces@dovecot.org on behalf of Benny Pedersen me@junc.eu Date: Sunday, 22 May 2022 at 12:55 To: dovecot@dovecot.org dovecot@dovecot.org Subject: Re: Fix lmtp_save_to_detail_mailbox to be case insensitive? On 2022-05-22 12:35, Lucas Rolff wrote:
Neither of those two describe how to lowercase the extension part –
oh
lmtp is single delivering so multirecipient is not supported, details matter
postfix side of it knows this detail in lmtp
expand extension part in postfix would possible solve it if dovecot side miss it on lmtp server side
that’s a bit the point. One puts info that they use LMTP, another decides to link LDA docs, and even quoting how to lower the extension part, despite that isn’t actually possible in LMTP in a similar manner.
I’m sure the OP had used google prior, and didn’t find any useful information, which is why the question got asked in the first place.
Since you’ve linked the LTMP docs, can you point out where in those docs, it explains anything with lowering the extension part? I can’t find it in the two links.
if its not dokumented its not supported, just like its sayed on postfix maillist if docs does not describe it :)
now you made a typo again
Am 22.05.22 um 11:33 schrieb Lucas Rolff:
Wouldn’t it be ideal to link to a LMTP documentation page that describes how to do the same thing under LTMP, and not link to LDA?
No, because that's not (easily) possible as others have pointed out already. FTR: It is possible but on the postfix side of things with multiple options. https://groups.google.com/g/mailing.postfix.users/c/1p0ubY726N8/m/D3s9V5PXHc... for the oldest solution I could find.
There is no need to use LMTP if people want to use +extension addressing in their small setups.
On 05-22-2022 10:53 am, Daniel Lange wrote: No, because that's not (easily) possible as others have pointed out already. FTR: It is possible but on the postfix side of things with multiple options. https://groups.google.com/g/mailing.postfix.users/c/1p0ubY726N8/m/D3s9V5PXHc... for the oldest solution I could find.
Viktor said yesterday on the postfix list that option is no longer valid in current versions, which is why i brought this issue back to the dovecot list to see if a solution was possible.
I think anything postfix side is just a workaround and the issue should be fixed on the dovecot side.
participants (4)
-
Benny Pedersen
-
Daniel Lange
-
dovecot@ptld.com
-
Lucas Rolff