6

I followed this guide on linode to setup dovecot and postfix mail server on my Ubuntu 12.04.2 LTS . The setup requires socket /var/spool/postfix/private/dovecot-lmtp to act as virtual transport. However, in my setup, this socket file doesn't exist when the service is started. And I do have the lmtp line in /etc/dovecot/conf.d/10-master.conf.

Here's a little info about my server.

Linux prosp 3.8.4-linode50 #1 SMP Mon Mar 25 15:50:29 EDT 2013 i686 i686 i386 GNU/Linux

root@prosp:/var/spool/postfix/private# ls
anvil   bsmtp    dovecot-auth  lmtp      mailman     relay    scache             tlsmgr      verify
auth    defer    error         local     proxymap    retry    scalemail-backend  trace   virtual
bounce  discard  ifmail        maildrop  proxywrite  rewrite  smtp               uucp

root@prosp:/var/spool/postfix/private# aptitude show postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql
Package: postfix
State: installed
Version: 2.9.6-1~12.04.1

Package: postfix-mysql
State: installed
Version: 2.9.6-1~12.04.1

Package: dovecot-core
State: installed
Version: 1:2.0.19-0ubuntu2

Package: dovecot-imapd
State: installed
Version: 1:2.0.19-0ubuntu2

Package: dovecot-pop3d
State: installed
Version: 1:2.0.19-0ubuntu2

Package: dovecot-lmtpd
State: installed
Version: 1:2.0.19-0ubuntu2

Package: dovecot-mysql
State: installed
Version: 1:2.0.19-0ubuntu2

Section from 10-master.conf

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    mode = 0600
    user = postfix
    group = postfix
  }
  # Create inet listener only if you can't use the above UNIX socket
  inet_listener lmtp {
    # Avoid making LMTP visible for the entire internet
    address = 127.0.0.1
    port = 2424
  }
}

I'm wondering why it doesn't exist. I've tried reinstalling dovecot-lmtpd to no avail. And because the lmtp socket doesn't exist, my mail server can send emails but cannot receive. The mail log has this line when an incoming email is received:

May 31 09:05:24 postfix/lmtp[3664]: 2FD80321F4: to=<myaddress@me.com>, relay=none, delay=0.41, delays=0.41/0/0/0, dsn=4.4.1, status=deferred (connect to me.com[private/dovecot-lmtp]: No such file or directory)

Logs after dovecot is restarted:

May 31 11:38:10 host dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May 31 11:38:10 host dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
May 31 11:38:10 host dovecot: master: Dovecot v2.0.19 starting up (core dumps disabled)
May 31 11:38:11 host postfix/smtpd[5741]: connect from localhost.localdomain[127.0.0.1]
May 31 11:38:11 host dovecot: auth-worker: mysql(127.0.0.1): Connected to database mailserver
May 31 11:38:11 host postfix/smtpd[5741]: 3F8A24DE2A3: client=localhost.localdomain[127.0.0.1], sasl_method=PLAIN, sasl_username=info@mydomain.com
May 31 11:38:11 host postfix/cleanup[5751]: 3F8A24DE2A3: message-id=<20130531113811.3F8A24DE2A3@otherdomain.com>
May 31 11:38:11 host postfix/qmgr[5683]: 3F8A24DE2A3: from=<info@mydomain.com>, size=938, nrcpt=1 (queue active)
May 31 11:38:11 host postfix/smtpd[5741]: disconnect from localhost.localdomain[127.0.0.1]
May 31 11:38:11 host postfix/error[5753]: 3F8A24DE2A3: to=<heshiming@mydomain.com>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to otherdomain.com[private/dovecot-lmtp]: No such file or directory)

Any ideas why this have happened?

It looks like I can't use lmtp as an inet listener either:

May 31 12:22:48 host postfix/lmtp[6798]: connect to localhost[127.0.0.1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6798]: connect to localhost[::1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6799]: connect to localhost[127.0.0.1]:2424: Connection refused
May 31 12:22:48 host postfix/lmtp[6799]: connect to localhost[::1]:2424: Connection refused
He Shiming
  • 283
  • 1
  • 3
  • 12
  • 2
    Do you have this: `service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { mode = 0600 user = postfix group = postfix }` in this `/etc/dovecot/conf.d/10-master.conf` ? – NickW May 31 '13 at 09:25
  • If you do, do you have errors in the pertinent log files when you start dovecot? – NickW May 31 '13 at 09:39
  • @NickW I do have the lmtp section. When dovecot is restarted, it produces thousands of the 'no such file or directory' error in the log. I guess this is because mails are actually received but not delivered. Besides these errors, I'm not seeing anything particular. My problem though, is that I really don't have this executable file. – He Shiming May 31 '13 at 11:26
  • Can you paste in the errors from the first 10-20 lines after the restart? – NickW May 31 '13 at 11:27
  • I've appended the log at the end of this post. – He Shiming May 31 '13 at 11:40
  • Hmm, not much there, do you have lmtp in the protocols line in dovecot.conf? – NickW May 31 '13 at 11:52
  • I do have this protocol. Actually I've copied the config file from the guide. I'll review the log file again to see why this socket is not created. – He Shiming May 31 '13 at 11:56
  • It is awfully odd, especially considering there is an `lmtp` and a `dovecot-auth` file, so it does seem to have the permission to create files.. – NickW May 31 '13 at 12:00
  • The other services are all up, including imap, authentication via mysql, pop, smtp. The folder is owned by postfix. The time of other sockets are exactly the service restart time. Only this lmtp transport is broken. And regarding the log, the errors are produced when postfix is restarted, dovecot restart produces no errors. – He Shiming May 31 '13 at 12:03
  • I'm going hazard a guess and say you may have some syntax error in `10-master.conf`, can you post the whole service lmtp section? – NickW May 31 '13 at 12:16
  • The file is actually identical to https://library.linode.com/assets/1240-dovecot_10-master.conf.txt with the exception that I opened 110 port. I now have tried switching it to inet listener, but it still failed to work. – He Shiming May 31 '13 at 12:26
  • If you use the inet listener, you'll need to change the postfix virtual transport line from unix: to inet: (I think) – NickW May 31 '13 at 12:33
  • I've done that and I've updated the post. That's why postfix is looking for lmtp at port 2424, but it's not opened regardless of the lmtp section dovecot config. – He Shiming May 31 '13 at 12:34
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/9029/discussion-between-nickw-and-he-shiming) – NickW May 31 '13 at 12:54
  • https://serverfault.com/questions/622978/dovecot-lmtp-no-such-file-or-directory – user421872 Jun 24 '17 at 07:03

4 Answers4

11

The answers and responses already given contain all the parts of the solution, here's my attempt to tie that info together, having struggled with and now fixed the same problem:

Overview: Dovecot only acts upon the service lmtp section if lmtp appears in the protocols setting. Especially if you have a custom dovecot.conf file you may have omitted something.

Detail (for Debian, and by extension Ubuntu): Here's the key steps,

  • apt-get install dovecot-lmtpd
  • Check that dovecot.conf (in /etc/dovecot) includes the line !include_try /usr/share/dovecot/protocols.d/*.protocol: This is where protocols is set (specifically the lmtp.protocol file contains protocols = $protocols lmtp
  • Now to the service lmtp section: This should be in conf.d/10-master.conf but may be empty; the original question has settings in this section (adjust accordingly if you're doing the same thing):

    service lmtp {
      unix_listener /var/spool/postfix/private/dovecot-lmtp {
        mode = 0600
        user = postfix
        group = postfix
      }
    }
    
  • Make sure that the above conf.d/10-master.conf is included by your dovecot.conf (typically with !include conf.d/*.conf)

  • Reload Dovecot (service dovecot reload) for this configuration change to take effect
  • Double-check the running configuration with dovecot -n: Check that protocols is set and includes lmtp; check that the above service lmtp stanza appears too.
  • If you're specifying the dovecot-lmtp socket name as above, it should now exist (that service ltmp stanza tells Dovecot to create it when running), check with ls -l /var/spool/postfix/private/dovecot-lmtp
  • This should now play nicely with Postfix.
Andrew Richards
  • 336
  • 3
  • 9
  • This worked for me... ubuntu 16 – mzalazar Dec 07 '18 at 14:12
  • 1
    In my case, I borrowed the default configuration block which lacked ''/var/spool/postfix/private/dovecot-lmtp'' and instead only had ''lmtp'' so it kept pitching a doesn't exist error since I did not specify the full path, nor the actual location. Thanks, oemb1905. – oemb1905 Aug 06 '23 at 18:32
5

I've discovered that though I have protocols = lmtp pop3 imap in /etc/dovecot/dovecot.conf, it's overridden by /etc/dovecot/conf.d/01-mail-stack-delivery.conf which contains only protocols = pop3 imap sieve. I've modified this file and the lmtp protocol is up.

He Shiming
  • 283
  • 1
  • 3
  • 12
  • You can check to make sure no other files have the `protocols =` line using `sudo grep -rnw '/etc/dovecot/' -e "protocols ="` – ki9 Feb 12 '17 at 00:51
  • this solved my problem, but it seems like a dirty solution. is there a cleaner way of solving this? – user3791372 Mar 11 '17 at 01:16
0

https://packages.debian.org/sid/dovecot-lmtpd

apt-get install dovecot-lmtpd

Jace
  • 19
  • 1
-1

It's very interesting thing. I've done all the things I read here. In my private directory is a

/var/spool/postfix/private/lmtp

but no

/var/spool/postfix/private/dovecot-lmtp

so the postfix tell me: