How To Make Dovecot Strip Realm

Technical discussions, how to do geeky things more efficiently.

Moderators: Nanook, carl

User avatar
Nanook
Senior Member
Posts: 92
Joined: Tue Jun 25, 2013 10:08 pm
Location: Shoreline
Contact:

How To Make Dovecot Strip Realm

Postby Nanook » Sun Nov 17, 2013 6:45 pm

Easily the most common mail configuration error I've seen is for users to send user@eskimo.com 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.

User avatar
Nanook
Senior Member
Posts: 92
Joined: Tue Jun 25, 2013 10:08 pm
Location: Shoreline
Contact:

RE: How To Make Dovecot Strip Realm

Postby Nanook » Mon Jan 06, 2014 11:23 am

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.


Who is online

Users browsing this forum: No registered users and 2 guests