Page 1 of 1

How To Make Dovecot Strip Realm

Posted: Sun Nov 17, 2013 6:45 pm
by Nanook
Easily the most common mail configuration error I've seen is for users to send as their username instead of just user.

Until recently this has been resolved by the user changing their configuration, however, recently I had an ATT mobile customer whose phone automatically attached the realm and apparently provided no option to send just the username on an imap or pop-3 login.

I Googled for a solution but didn't find a reasonable one. One person went so far as to make a patch to Dovecot but it also stripped the realm off in other contexts where it wasn't desirable to do so.

I found the solution, in all places, in Dovecot docs. Simply making the following change in 10-auth.conf:

Change: auth_username_format = %Lu
To: auth_username_format = %Ln

The 'L' tells Dovecot to fold the login to lower case, the 'u' is the full username including the domain, the 'n' is just the username.

RE: How To Make Dovecot Strip Realm

Posted: Mon Jan 06, 2014 11:23 am
by Nanook
This is exactly what I did with it, replace uw-imap.

The only problem I ran into is with mailbox path mapping. Uw-imap exposes the entire users home directory whereas Dovecot only exposes
the mail directory.

For uw-imap clients had to configure a path of "/mail" into their e-mail clients. With Dovecot it was necessary to remove the path or just change it to "".

Dovecot behaves better than uw-imap in so many ways. The biggest is that it handles multiple simultaneous sessions. It also supports both pop and imap, so the Qualcomm popper we used to run is no longer necessary.

Where uw-imap makes a copy of the mailbox and works out of that, Dovecot memory maps it. For large mailboxes like we have here, this is much more efficient.