DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Exim+Dovecot+Sieve via LMTP

| 17:28:40 01.05.2013

* * * The guide is already outdated as of November 2018,
and still the guide can be used on servers without Directadmin or for your personal purposes.
Check the link for other similar guides* * *

To switch Exim+Dovecot+Sieve to LMTP from LDA one need to apply some changes.

LMTP is designed as an alternative to normal SMTP for situations where the receiving side does not have a mail queue, such as a mail storage server acting as a Mail Delivery Agent. Mail queues are an inherent requisite of SMTP. In situations in which mail queues are not possible, LMTP is desirable, since a mail storage server should manage only its mail store without having to allocate more storage for a mail queue.

You can configure LMTP on TCP or UNIX sockets (just add one of the following sections into /etc/dovecot.conf): 

service lmtp {
   inet_listener lmtp {
      address = 127.0.0.1
      port = 24024
   }
}

or

service lmtp {
   unix_listener lmtp {
      mode = 0666
   }
}

if you want to use UNIX sockets (see http://wiki2.dovecot.org/LMTP for more details) and restart dovecot.

If you've chosen TCP, then check netstat output the following way:

# netstat -antpl | grep 24024
tcp        0      0 127.0.0.1:24024             0.0.0.0:*                   LISTEN      13744/dovecot

If you've chosen sockets, then you can check existence of /var/run/dovecot/lmtp the following way:

# stat /var/run/dovecot/lmtp
  File: `/var/run/dovecot/lmtp'
  Size: 0               Blocks: 0          IO Block: 4096   socket
Device: 32h/50d Inode: 58690646    Links: 1
Access: (0666/srw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-04-03 20:13:32.000000000 +0700
Modify: 2013-04-03 20:13:32.000000000 +0700
Change: 2013-04-03 20:13:32.000000000 +0700

Don't know what for, but you can denote the both variants in /etc/dovecot.conf

Now you should update your /etc/exim.conf: Find a section in /etc/exim.conf

address_reply:
  driver = autoreply

and after that add the following lines:

dovecot_lmtp_tcp:
   driver = smtp
   protocol = lmtp
   port = 24024
   hosts = localhost
   allow_localhost
   return_path_add

dovecot_lmtp_udp:
   driver = lmtp
   socket = /var/run/dovecot/lmtp
   return_path_add

Depending on what you're going to use you should change

transport = virtual_localdelivery

either to

transport = dovecot_lmtp_tcp

for TCP, or to

transport = dovecot_lmtp_udp

for sockets in section

virtual_user:

of /etc/exim.conf And restart exim.

p.s. UNIX sockets should be a quicker way to use the things.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition