How do I enable LMTP with Dovecot/Postfix

SYSTEM INFORMATION
OS type and version Debian 12.7
Webmin version 2.202

I have Postfix and Dovecot installed via webmin. They are configured to allow local delivery into /home/{user}/Maildir/ and it is working.

I would like to set up sieve filtering and for this I need LMTP, but something may be wrong. In Webmin > Servers > Dovecot > Networking and Protocols, I cannot enable LMTP. If I select it and IMAP and apply, it returns with LMTP unselected.

Trying to research it, I found dovecot-lmtpd had not been installed, so I have installed it and it changed nothing.

I have tried following a combination of guides like Sieve mail filtering with dovecot on ubuntu, Let’s do Dovecot slowly and properly – Part 3: LMTP – brokkr.net and Let’s do Dovecot slowly and properly – Part 4: Filtering with Sieve – brokkr.net, but I cant even get LMTP to start (i.e I never see it listening on port 24), so I can’t even start looking at the sieve side of things.

How can I get the LMTP integration working? Also is there a bug with dovecot-lmtpd not being installed and are there other packages missing for this to work?

Is this just a firewall problem in disguise? LMTP uses port 24 SMTP uses 25 so is 24 open?
(I’ve not had the need/desire to be involved so no experience)

It is all on the same machine, so no firewall. Also ss -nplt shows nothing listening on TCP port 24.

It doesn’t have to use port 24 I don’t think.

root@main:/etc/init.d# netstat -ap |grep lmtp
unix  2      [ ACC ]     STREAM     LISTENING     9144008  1726002/master       private/lmtp
root@main:/etc/init.d# ps -aux |grep lmtp
list     2684175  0.1  0.4 158504 73912 ?        Sl   15:29   0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=lmtp:0:1
root     2690657  0.0  0.0   6264   712 pts/0    S+   15:44   0:00 grep lmtp

In /etc/dovecot/conf.d/10-master.conf, I have:

service lmtp {
  #unix_listener lmtp {
    #mode = 0666
  #}

  # 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 = 24
  }
}

So I would expect a port to be created. I could try using a socket, but first off, I want to confirm lmtp is running. Also I have not found the full socket set up for postfix.

I did try uncommenting the socket bit but I still couldn’t find the process with ps aux.

I found this while searching for a problem with Mailman3 in case it helps.
doc.dovecot.org/2.3/configuration_manual/howto/postfix_dovecot_lmtp/

`

1 Like

now I know Wikipedia is not exactly the most trusted source but …
https://en.wikipedia.org/wiki/Local_Mail_Transfer_Protocol

LMTP must not be used on port 25, reserved for SMTP

also…
https://www.geeksforgeeks.org/difference-between-smtp-and-lmtp/

OK, but I have not mentioned port 25. I configured it to use port 24.

Is this of any use?

Thanks so far.

From the Dovecot docs, tt looks like /etc/dovecot.conf was missing the lmtp in in the line `protocols = imap lmtp’ I now have adjusted the postfix and dovecot configs to use lmtp on port 24.

Now I’ve made that adjustment, it shows in the Webmin > Dovecot > Networking Protocols correctly. How should I have done this through Webmin rather than going under the hood?

lmtp is now rejecting mail valid users so I need to work out how to configure that.

To accept mail delivery, I also had to set auth_username_format = %Ln in /etc/dovecot/conf.d/10-auth.conf. How should I do that through Webmin?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.