Adrian Zaugg
2013-Dec-16 19:36 UTC
[Dovecot] configure lmtp to deliver to email addresses case insensitively
Dear List Using dovecot 2.1.7 with LMTP and exim4 I want to accept local parts regardless of their case. Exim does all virtual alias handling and delivers the messages to dovecot LMTP addressed to the right mailbox name. This works well except for addresses which do not need to be resolved by exim and which do have the "wrong" case in the local part. For example: There is a mailbox and a user on the mailsystem "example.org" called "user". Mails to "user at example.org" get delivered just as they should. If an incoming message is addressed to "USER at example.org" with upper case local part, exim passes the message to LMTP with the case unaltered (RFC 2821 conform), but LMTP fails with: LMTP error after RCPT TO:<USER at example.org>: 550 5.1.1 <USER at example.org> User doesn't exist: USER at example.org How can I tell dovecot to deliver "USER" to the mailbox "user" aswell? Thank you for your help. Best regards, Adrian. (I have tried to use %Ln and %Lu in mail_location setting with no success.)
Charles Marcus
2013-Dec-16 20:25 UTC
[Dovecot] configure lmtp to deliver to email addresses case insensitively
On 2013-12-16 2:36 PM, Adrian Zaugg <adi at ente.limmat.ch> wrote:> How can I tell dovecot to deliver "USER" to the mailbox "user" aswell?"Username LDAP lookups are case-insensitive. Unless you somehow normalize the username, it's possible that a user logging in as "user", "User" and "uSer" are treated differently. The easiest way to handle this is to tell Dovecot to change the username to the same case as it's in the LDAP database. You can do this by returning "user" field in the pass_attrs, as shown in the above example. If you can't normalize the username in LDAP, you can alternatively lowercase the username in dovecot.conf: auth_username_format = %Lu" See: http://wiki2.dovecot.org/AuthDatabase/LDAP/PasswordLookups This really should be the default... -- Best regards, */Charles/*
Adrian Zaugg
2013-Dec-17 02:04 UTC
[Dovecot] configure lmtp to deliver to email addresses case insensitively
Hi David> I believe RFC822 email addresses are case-insensitive, and (in someRFC 2821, Page 13, 1st paragraph: "The local-part of a mailbox MUST BE treated as case sensitive. Therefore, SMTP implementations MUST take care to preserve the case of mailbox local-parts. Mailbox domains are not case sensitive. In particular, for some hosts the user "smith" is different from the user "Smith". However, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged." (http://tools.ietf.org/html/rfc2821#section-2.4)> cases, especially ones where there's just a mail server) it's entirely > possible that people remember their account names with some capital > letters that aren't in user db. (System knows you as > "mrsmithy at mail.domain", while the user may remember the account as > "MrSmithy at mail.domain" or "MrsMithy at mail.domain"...). Also, people withI just want login names to be case sensitive but not email addresses, and in spite of being treated as case insensitive email addresses should retain their case, just like defined and suggested in the RFC. This reduces support calls because it's con-formant and we have a clear policy: Usernames are always lower case, non-email addresses, the same simple and short name for all our services. There is nothing easier than this. We use this since 17 years and it works without confusion. If a user now spots that suddendly any capitalization of usernames is working when logging in to the webmail, how can I explain that this doesn't work with other services like FTP?> smartphones may not notice that the phone "helpfully" uppercased the > first letter of a lowercase user name. Forcing case reduces support > calls, which is always a good thing.That's why email addresses should be allowed containing capitalizations. On smartphone people tend to use MUAs and there the username is saved and not entered each and every time, so for the username this is less true, I think. Back to dovecot: Using LDA as a transport for the dovecot store, it used to work perfectly (with dovecot 1.x). It's just LMTP that spits, because it looks up the local part in the userdb, which is PAM in our case. I won't change PAM to act case insensitive: I'm not in the position to change a common sense in the computing world as it always was. It's enough Microsoft did that and probably just because of that we're having this discussion here... However, it's maybe best to lowercase the local part in the exim lmtp-transport and leave dovecot's LMTP in peace. Best regards, Adrian.