Cannot start lmtp runner due to error while attempting to bind on address ('127.0.0.1', 8024): address already in use
Ubuntu focal 20.04 mailman3 3.2.2-1
In /etc/mailman3/mailman.cfg
:
# Where the LMTP server listens for connections. Use 127.0.0.1 instead of
# localhost for Postfix integration, because Postfix only consults DNS
# (e.g. not /etc/hosts).
# Configuration is for a system where Mailman and the MTA are on the same host
lmtp_host: 127.0.0.1
lmtp_port: 8024
Stopping mailman3 and checking that no lmtp runner is active:
# systemctl stop mailman3
# ps -aux |grep mailman|grep -Pv "(postgres|grep)"
www-data 855395 0.0 0.4 82856 37904 ? Ss 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 855411 0.0 0.3 156588 25724 ? Sl 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 858518 0.0 0.2 82856 22532 ? Ss 13:52 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
Starting mailman3 and checking all active mailman3 runners:
# ps -aux |grep mailman|grep -Pv "(postgres|grep)"
www-data 855395 0.0 0.4 82856 37904 ? Ss 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 855411 0.0 0.3 156588 25724 ? Sl 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 858612 0.0 0.2 82856 22532 ? Ss 13:54 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
list 858626 17.8 0.9 103248 74680 ? Ss 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/master --force -C /etc/mailman3/mailman.cfg
list 858628 27.2 0.7 87176 62244 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=archive:0:1
list 858629 28.6 0.8 89116 64044 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=bounces:0:1
list 858630 29.2 0.8 90184 64972 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=command:0:1
list 858631 27.0 0.7 87560 62420 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=in:0:1
list 858632 28.8 0.8 89620 64508 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=lmtp:0:1
list 858633 26.6 0.7 84464 60800 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=nntp:0:1
list 858634 26.2 0.7 81964 58580 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=out:0:1
list 858635 28.4 0.7 88692 63648 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=pipeline:0:1
list 858636 26.4 0.7 83308 59820 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1
list 858637 26.8 0.7 84076 60828 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=retry:0:1
list 858638 29.2 0.8 90176 64964 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=virgin:0:1
list 858639 27.4 0.7 87564 62528 ? R 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=digest:0:1
We clearly see that lmtp runner is active; then it exits after a few seconds:
# ps -aux |grep mailman|grep -Pv "(postgres|grep)"
www-data 855395 0.0 0.4 82856 37904 ? Ss 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 855411 0.0 0.3 156588 25724 ? Sl 13:01 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
www-data 858612 0.0 0.2 82856 22532 ? Ss 13:54 0:00 /usr/bin/uwsgi --plugin python3 --ini /etc/mailman3/uwsgi.ini
list 858626 2.7 0.9 103248 74680 ? Ss 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/master --force -C /etc/mailman3/mailman.cfg
list 858628 4.3 0.9 103260 74704 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=archive:0:1
list 858629 4.3 0.9 103256 74964 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=bounces:0:1
list 858630 4.3 0.9 103256 74920 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=command:0:1
list 858631 4.3 0.9 103256 74804 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=in:0:1
list 858633 4.4 0.9 103924 75444 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=nntp:0:1
list 858634 4.3 0.9 103256 74392 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=out:0:1
list 858635 4.3 0.9 103260 74876 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=pipeline:0:1
list 858636 4.4 0.9 182412 79472 ? Sl 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1
list 858637 4.4 0.9 103256 74964 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=retry:0:1
list 858638 4.5 0.9 103256 74808 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=virgin:0:1
list 858639 4.4 0.9 103256 74776 ? S 13:54 0:01 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=digest:0:1
The systemd service status gives a clue:
# systemctl status mailman3
● mailman3.service - Mailman3 server
Loaded: loaded (/lib/systemd/system/mailman3.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-12-02 13:54:45 CET; 2min 51s ago
Docs: man:mailman(1)
https://mailman.readthedocs.io/
Process: 858617 ExecStart=/usr/bin/mailman -C /etc/mailman3/mailman.cfg start --force (code=exited, status=0/SUCCESS)
Main PID: 858626 (python3)
Tasks: 14 (limit: 9284)
Memory: 688.5M
CGroup: /system.slice/mailman3.service
├─858626 /usr/bin/python3 /usr/lib/mailman3/bin/master --force -C /etc/mailman3/mailman.cfg
├─858628 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=archive:0:1
├─858629 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=bounces:0:1
├─858630 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=command:0:1
├─858631 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=in:0:1
├─858633 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=nntp:0:1
├─858634 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=out:0:1
├─858635 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=pipeline:0:1
├─858636 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1
├─858637 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=retry:0:1
├─858638 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=virgin:0:1
└─858639 /usr/bin/python3 /usr/lib/mailman3/bin/runner -C /etc/mailman3/mailman.cfg --runner=digest:0:1
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: self.lmtp.start()
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: File "/usr/lib/python3/dist-packages/aiosmtpd/controller.py", line 60, in start
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: raise self._thread_exception
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: File "/usr/lib/python3/dist-packages/aiosmtpd/controller.py", line 40, in _run
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: ssl=self.ssl_context))
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: return future.result()
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: File "/usr/lib/python3.7/asyncio/base_events.py", line 1374, in create_server
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: % (sa, err.strerror.lower())) from None
Dec 02 13:54:52 samsung4-ubuntu mailman3[858617]: OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 8024): address already in use
Of course the port is already in use: it is used by dovecot.
tcp6 0 0 ::1:8024 :::* LISTEN 0 1317360 129620/dovecot
tcp 0 0 127.0.0.1:8024 0.0.0.0:* LISTEN 0 1316324 129620/dovecot
I must be missing something.
On 12/2/19 5:04 AM, actionmystique@gmail.com wrote:
Of course the port is already in use: it is used by dovecot.
tcp6 0 0 ::1:8024 :::* LISTEN 0 1317360 129620/dovecot tcp 0 0 127.0.0.1:8024 0.0.0.0:* LISTEN 0 1316324 129620/dovecot
I must be missing something.
What is Dovecot listening for on the lmtp port?
If this is Postfix communicating with Dovecot as the LDA or for address verification and using TCP port 8024, you have at least two choices. You can have Postfix/Dovecot communicate via a unix socket instead or you can configure Mailman to use a different port. See <https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html> which says in part:
lmtp_port is fairly arbitrary (there is no standard port for LMTP). Use any port convenient for your site. “8024” is as good as any, unless another service is using it.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Dovecot is the LMTP server (https://doc.dovecot.org/configuration_manual/protocols/lmtp_server/) listening on port 8024.
I thought that lmtp_port
was precisely the port where to contact the LMTP server, as described in the comments (cf. first post).
- Are those comments wrong?
- Is mailman trying to act as a LMTP server instead?
- If so, wouldn't there be an issue with 2 LMTP servers if I choose another port number for
lmtp_port
?
actionmystique@gmail.com writes:
Dovecot is the LMTP server (https://doc.dovecot.org/configuration_manual/protocols/lmtp_server/) listening on port 8024. I thought that
lmtp_port
was precisely the port where to contact the LMTP server, as described in the comments (cf. first post).
- Are those comments wrong?
In Mailman documentation, Mailman's LMTP server is *the* LMTP server. Mailman wouldn't send *to* an LMTP server, it would send to the MTA's "submission" port or to the SMTP port.
- Is mailman trying to act as a LMTP server instead?
Yes.
- If so, wouldn't there be an issue with 2 LMTP servers if I choose another port number for
lmtp_port
?
No. Apparently Dovecot made the same architectural decision that Mailman did: "I want to receive incoming mail via LMTP because all the MTAs I'm willing to talk to can do it that way so I don't have to worry about pipes and configs and sockets, oh my!" Both want to receive via LMTP. So it has to be different ports. Only the MTA and Mailman need to know Mailman's port, and ditto for MTA + Dovecot. Ie:
LMTP SMTP
+-----> Mailman @ 9024 -----> subscribers
SMTP | (or whereever)
Internet -----> MTA -+ | LMTP IMAP +-----> Dovecot @ 8024 -----> local users
or whatever.
(note to me: needs to be in dox)
Steve
I've just noticed some potentially misconfigured items in /usr/lib/python3/dist-packages/mailman/config/mailman.cfg
(and not modified by /etc/mailman3/mailman.cfg)
[runner.lmtp]
class: mailman.runners.lmtp.LMTPRunner
path:
...
[runner.rest]
class: mailman.runners.rest.RESTRunner
path:
Is it an issue to have empty path
?
On 12/3/19 4:42 AM, actionmystique@gmail.com wrote:
I've just noticed some potentially misconfigured items in
/usr/lib/python3/dist-packages/mailman/config/mailman.cfg
(and not modified by /etc/mailman3/mailman.cfg)[runner.lmtp] class: mailman.runners.lmtp.LMTPRunner path: ... [runner.rest] class: mailman.runners.rest.RESTRunner path:
Is it an issue to have empty
path
?
As far as I can tell, the path
setting is not referenced anywhere. Its
presence in mailman.cfg may be an artifact.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
actionmystique@gmail.com
-
Mark Sapiro
-
Stephen J. Turnbull