

Dovecot LDA with Exim
=====================




System users
============


Change the localuser router to use dovecot_delivery transport: 

---%<-------------------------------------------------------------------------
localuser:
  driver = accept
  check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
  transport = dovecot_delivery
---%<-------------------------------------------------------------------------

'check_local_user' is required. It makes Exim execute the transport with the user's UID and GID and it also sets HOME environment. 
Next create a new transport for Dovecot deliver: 

---%<-------------------------------------------------------------------------
dovecot_delivery:
  driver = pipe
  command = /usr/local/libexec/dovecot/deliver
  message_prefix =
  message_suffix =
  log_output
  delivery_date_add
  envelope_to_add
  return_path_add
  #group = mail
  #mode = 0660
---%<-------------------------------------------------------------------------

Deliver is now run using the local user's UID and GID. The mail is delivered to the location specified by >>mail_location<< setting. Note that the above configuration doesn't do any >>userdb<< lookups, so you can't have any per-user configuration. If you want that, see the virtual user setup below. 


Virtual users
=============


Make sure that 'check_local_user' isn't set in the router. 


Single UID
==========


Configure the transport to run as the user you want, for example vmail: 

---%<-------------------------------------------------------------------------
dovecot_virtual_delivery:
  driver = pipe
  command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain
  message_prefix =
  message_suffix =
  delivery_date_add
  envelope_to_add
  return_path_add
  log_output
  user = vmail
---%<-------------------------------------------------------------------------

You'll also need to have a master authentication socket and give vmail user access to it. See >>LDA<< for more information. 


Multiple UIDs
=============


If you need multiple uids/gids you'll need to set deliver setuid root. See the >>LDA<< main page how to do this securely. 
You could alternatively set 'user = root', but this requires that you built Exim without root being in FIXED_NEVER_USERS list. 
(This file was created from the wiki on 2007-12-11 04:42)
