[Dovecot] configure lmtp to deliver to email addresses case insensitively

Adrian Zaugg adi at ente.limmat.ch
Wed Dec 18 03:01:03 EET 2013


Hi again

Thanks for helping me on this, especially to Steffen. If you do not need
case sensitivity on user names the use of a redirect router in exim to
lowercase the local part of the address to deliver works well.

If one wants for whatever reasons to have support for user names, that
just differ in its case, you could put more logic in that router to make
that work. Since I did not need that, I can't post it here...

So the solution to the problem is:

A) Either:
---------
Configure dovecot auth to lower case user names, which LMTP inherits, by
setting
	auth_username_format = "%Lu"

Co-Effect: authenticating logins with wrongly cased user names do also
succeed.

B) Or:
-----
Configure your MTA to do the Job. With exim, add a new router just
before local delivery takes place, like this:

lowercase_local:
  debug_print = "R: lower case local_part for local delivery"
  driver = redirect
  redirect_router = local_user
  data = ${lc:${local_part}}

and proceed with the local_user router:

local_user:
  debug_print = "R: local_user for $local_part@$domain"
  driver = accept
  domains = +local_domains
  check_local_user
  local_parts = ! root
  transport = dovecot_lmtp
  cannot_route_message = Unknown user

then add your LMTP transport:

dovecot_lmtp:
  driver = lmtp
  socket = /var/run/dovecot/lmtp
  batch_max = 256
  timeout = 2m
  delivery_date_add


Has just the effect that login names stay case sensitive (if nothing
else is set in dovecot by auth_username_format) but not email addresses,
and in spite of being treated as case insensitive, email addresses
retain their case.

Maybe some one can add this to the wiki under
http://wiki2.dovecot.org/LMTP/Exim?highlight=%28LMTP%29#Using_LMTP_over_UNIX_Socket
The code there is anyway not very nice by using the manualroute router with:
   route_data = whatmeworry # required but not useful


Thanks again to everyone for helping.

Regards, Adrian.



Am 17.12.13 09:38 schrieb Steffen Kaiser:
> On Tue, 17 Dec 2013, Steffen Kaiser wrote:
> 
>>> However, it's maybe best to lowercase the local part in the exim
>>> lmtp-transport and leave dovecot's LMTP in peace.
> 
>> that's what I wanted to suggest :)
> 
>> More or less, it is the duty of the MTA, IMHO.
> 
> Um, sorry, forgot the link:
> http://www.gossamer-threads.com/lists/exim/users/4551
> 
> that looks promising.
> 
> -- Steffen Kaiser


More information about the dovecot mailing list