Re: courier-mta failing. Err msg no help

Norbert Harrer via courier-users <[email protected]> Tue, 25 Nov 2025 10:32:57 +0100
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============1329746736245723282==
Content-Type: multipart/alternative;
 boundary="------------DEfdtnhwT0CqxTp0FXNgDRjo"
Content-Language: de-AT, en-US

This is a multi-part message in MIME format.
--------------DEfdtnhwT0CqxTp0FXNgDRjo
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Hi Ivan.

I=E2=80=99m just a mere mortal with limited insight into how things work. =
But=20
I=E2=80=99m also running Courier on Debian and upgraded to Trixie a couple=
 of=20
weeks ago without any problems. So if you want, you can bounce ideas off=
=20
me and compare notes to maybe narrow down the issue.

> There is no /var/log/maillog like there used to be. It all goes to the=
=20
> journal which says nothing useful:

On my system, the logs are written through rsyslog. Maybe check if=20
rsyslog is running:

systemctl status rsyslog


My /etc/rsyslog.conf contains an entry so that all mail logs go to=20
/var/log/mail.log:

> grep=C2=A0 mail /etc/rsyslog.conf
mail.*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 -/var/log/mail.log


Regarding the startup problem: Sam already posted some tips. Here is the=
=20
data from my system. The systemd service config looks like this:

>=C2=A0cat /usr/lib/systemd/system/courier-mta.service
[Unit]
Description=3DCourier ESMTP Daemon
Requires=3Dcourier-authdaemon.service courier.service courierfilter.servic=
e
After=3Dcourier-authdaemon.service courier.service courierfilter.service
[Service]
Type=3Dforking
ExecStart=3D/usr/sbin/esmtpd start
ExecStop=3D/usr/sbin/esmtpd stop
PIDFile=3D/run/courier/esmtpd.pid
[Install]
WantedBy=3Dmulti-user.target

The important part is that the PIDFILE entry in /run/courier/esmtpd.pid=20
matches:

> grep PIDFILE=3D /etc/courier/esmtpd
PIDFILE=3D/run/courier/esmtpd.pid

/usr/sbin/esmtpd is actually a script installed by the courier-mta package=
:

dpkg -S /usr/sbin/esmtpd
courier-mta: /usr/sbin/esmtpd

It=E2=80=99s linked to /usr/lib/courier/esmtpd. Maybe you can run it manua=
lly to=20
find out more, as Sam suggested.

And have you checked whether /run/courier exists and is writable by the=20
courier user?

> l -d /run/courier                             =20
drwxrwxr-x 4 root courier 480 Nov 25 09:20 /run/courier


> Nov 24 10:03:16 sam systemd[1]: courier-mta.service: Can't open PID=20
> file '/run/courier/esmtpd.pid' (yet?) after start: No such file or=20
> directoryNov 24 10:03:16 sam systemd[1]: courier-mta.service: Failed=20
> with result 'protocol'.... =E2=96=91=E2=96=91The unit courier-mta.servic=
e has entered=20
> the 'failed' state with result 'protocol'.Nov 24 10:03:16 sam=20
> systemd[1]: Failed to start courier-mta.service - Courier ESMTP Daemon.

As far as I understand your error messages, all it tells you is that=20
systemd expects the pid file to appear within a certain time, which=20
doesn't seem to happen. Checking on my system, the script=20
/usr/sbin/esmtpd should execute two commands which in turn start esmtpd:

>systemctlstatus courier-mta --no-pager --full 1 =E2=86=B5
=E2=97=8Fcourier-mta.service - Courier ESMTP Daemon
 =C2=A0=C2=A0=C2=A0=C2=A0Loaded: loaded (/usr/lib/systemd/system/courier-m=
ta.service;=20
enabled; preset: enabled)
 =C2=A0=C2=A0=C2=A0=C2=A0Active: active (running)since Tue 2025-11-25 10:1=
1:30 CET; 15min ago
Invocation: 959a9355d4824583834f59434798baf7
 =C2=A0=C2=A0=C2=A0Process: 3709256 ExecStart=3D/usr/sbin/esmtpd start (co=
de=3Dexited,=20
status=3D0/SUCCESS)
 =C2=A0=C2=A0Main PID: 3709267 (couriertcpd)
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Tasks: 2(limit: 9258)
 =C2=A0=C2=A0=C2=A0=C2=A0Memory: 652K (peak: 1.7M)
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0CPU: 59ms
 =C2=A0=C2=A0=C2=A0=C2=A0CGroup: /system.slice/courier-mta.service
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=E2=94=9C=E2=94=803709267 /usr/sbin/couriertcpd=20
-stderrlogger=3D/usr/sbin/courierlogger -user=3Dcourier -group=3Dcourier=
=20
-access=3D/etc/courier/smtpaccess.dat -maxprocs=3D40 -maxperc=3D5 -maxperi=
p=3D5=20
-pid=3D/run/courier/esmtpd.pid smtp /usr/sbin/courieres
mtpd
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=E2=94=94=E2=94=803709270 /usr/sbin/courierlogger courieresmtpd

Nov 25 10:11:30 stargate systemd[1]: Starting courier-mta.service -=20
Courier ESMTP Daemon...
Nov 25 10:11:30 stargate systemd[1]: Started courier-mta.service -=20
Courier ESMTP Daemon.

--------------DEfdtnhwT0CqxTp0FXNgDRjo
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-=
8">
  </head>
  <body text=3D"#000000" bgcolor=3D"#FFFFFF">
    Hi Ivan.=C2=A0<br>
    <br>
    I=E2=80=99m just a mere mortal with limited insight into how things wo=
rk.
    But I=E2=80=99m also running Courier on Debian and upgraded to Trixie =
a
    couple of weeks ago without any problems. So if you want, you can
    bounce ideas off me and compare notes to maybe narrow down the
    issue.<br>
    <br>
    <blockquote type=3D"cite"
cite=3D"mid:4hMHi4m9AI0P978oh5F3EYJYOnWsKlihgAoRYXH_1fHzzV68NoCv1W1agqORdW=
[email protected]">
      <div style=3D"font-family: Arial, sans-serif; font-size: 14px;">Ther=
e
        is no /var/log/maillog like there used to be. It all goes to the
        journal which says nothing useful:</div>
    </blockquote>
    <br>
    On my system, the logs are written through rsyslog. Maybe check if
    rsyslog is running:
    <pre>systemctl status rsyslog</pre>
    <br>
    My /etc/rsyslog.conf contains an entry so that all mail logs go to
    /var/log/mail.log:
    <pre>&gt; grep=C2=A0 mail /etc/rsyslog.conf
mail.*=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 -/var/log/mail.log</pre>
    <br>
    Regarding the startup problem: Sam already posted some tips. Here is
    the data from my system. The systemd service config looks like this:
    <pre>&gt;=C2=A0cat /usr/lib/systemd/system/courier-mta.service
[Unit]
Description=3DCourier ESMTP Daemon
Requires=3Dcourier-authdaemon.service courier.service courierfilter.servic=
e
After=3Dcourier-authdaemon.service courier.service courierfilter.service
[Service]
Type=3Dforking
ExecStart=3D/usr/sbin/esmtpd start
ExecStop=3D/usr/sbin/esmtpd stop
PIDFile=3D/run/courier/esmtpd.pid
[Install]
WantedBy=3Dmulti-user.target

</pre>
    The important part is that the PIDFILE entry in
    /run/courier/esmtpd.pid matches:
    <pre>&gt; grep PIDFILE=3D /etc/courier/esmtpd
PIDFILE=3D/run/courier/esmtpd.pid

</pre>
    /usr/sbin/esmtpd is actually a script installed by the courier-mta
    package:
    <pre>dpkg -S /usr/sbin/esmtpd=C2=A0
courier-mta: /usr/sbin/esmtpd

</pre>
    It=E2=80=99s linked to /usr/lib/courier/esmtpd. Maybe you can run it
    manually to find out more, as Sam suggested.<br>
    <br>
    And have you checked whether /run/courier exists and is writable by
    the courier user?
    <pre>&gt; l -d /run/courier=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
drwxrwxr-x 4 root courier 480 Nov 25 09:20 /run/courier


<blockquote type=3D"cite"><span style=3D"font-family:monospace"><span
    style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">N=
ov 24 10:03:16 sam systemd[1]: courier-mta.service: Can't open PID file=20
'/run/courier/esmtpd.pid' (yet?) after start: No such file or directory</s=
pan><span
    style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><=
/span>
<span style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"=
>Nov 24 10:03:16 sam systemd[1]: </span><span
style=3D"font-weight: bold; color: rgb(215, 215, 95); background-color: rg=
b(255, 255, 255);">courier-mta.service: Failed with result 'protocol'.</sp=
an><span
    style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><=
/span>
...
<span
style=3D"color: rgb(138, 138, 138); background-color: rgb(255, 255, 255);"=
>=E2=96=91=E2=96=91</span><span
    style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> =
</span><span
style=3D"color: rgb(24, 178, 24); background-color: rgb(255, 255, 255);">T=
he unit courier-mta.service has entered the 'failed' state with result 'pr=
otocol'.</span><span
    style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><=
/span>
<span style=3D"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"=
>Nov 24 10:03:16 sam systemd[1]: </span><span
style=3D"font-weight: bold; color: rgb(255, 84, 84); background-color: rgb=
(255, 255, 255);">Failed to start courier-mta.service - Courier ESMTP Daem=
on.</span></span></blockquote></pre>
    As far as I understand your error messages, all it tells you is that
    systemd expects the pid file to appear within a certain time, which
    doesn't seem to happen. Checking on my system, the script
    /usr/sbin/esmtpd should execute two commands which in turn start
    esmtpd:<br>
    <br>
    <span style=3D"font-family:monospace"><span
        style=3D"color:#b21818;background-color:#ffffff;">&gt;</span><span
        style=3D"color:#000000;background-color:#ffffff;">=C2=A0</span><sp=
an
        style=3D"color:#18b218;background-color:#ffffff;">systemctl</span>=
<span
        style=3D"color:#000000;background-color:#ffffff;"> status
        courier-mta --no-pager --full
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span><span
        style=3D"color:#b21818;background-color:#ffffff;">1 =E2=86=B5</spa=
n><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span
        style=3D"font-weight:bold;color:#54ff54;background-color:#ffffff;"=
>=E2=97=8F</span><span
        style=3D"color:#000000;background-color:#ffffff;">
        courier-mta.service - Courier ESMTP Daemon</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0Loaded:
        loaded (/usr/lib/systemd/system/courier-mta.service; </span><span
        style=3D"font-weight:bold;color:#54ff54;background-color:#ffffff;"=
>enabled</span><span
        style=3D"color:#000000;background-color:#ffffff;">; preset: </span=
><span
        style=3D"font-weight:bold;color:#54ff54;background-color:#ffffff;"=
>enabled</span><span
        style=3D"color:#000000;background-color:#ffffff;">)</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0Active:
      </span><span
        style=3D"font-weight:bold;color:#54ff54;background-color:#ffffff;"=
>active
        (running)</span><span
        style=3D"color:#000000;background-color:#ffffff;"> since Tue
        2025-11-25 10:11:30 CET; 15min ago</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> Invocation:
        959a9355d4824583834f59434798baf7</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0Process:
        3709256 ExecStart=3D/usr/sbin/esmtpd start (code=3Dexited,
        status=3D0/SUCCESS)</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0Main PID:
        3709267 (couriertcpd)</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0Tasks:
        2</span><span style=3D"color:#8a8a8a;background-color:#ffffff;">
        (limit: 9258)</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0Memory:
        652K (peak: 1.7M)</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0CPU:
        59ms</span><span style=3D"color:#000000;background-color:#ffffff;"=
>
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;"> =C2=A0=C2=
=A0=C2=A0=C2=A0CGroup:
        /system.slice/courier-mta.service</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;">
        =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=E2=94=9C=E2=94=80</span><span
        style=3D"color:#8a8a8a;background-color:#ffffff;">3709267
        /usr/sbin/couriertcpd -stderrlogger=3D/usr/sbin/courierlogger
        -user=3Dcourier -group=3Dcourier -access=3D/etc/courier/smtpaccess=
.dat
        -maxprocs=3D40 -maxperc=3D5 -maxperip=3D5 -pid=3D/run/courier/esmt=
pd.pid
        smtp /usr/sbin/courieres</span><br>
      mtpd<span style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;">
        =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=E2=94=94=E2=94=80</span><span
        style=3D"color:#8a8a8a;background-color:#ffffff;">3709270
        /usr/sbin/courierlogger courieresmtpd</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <br>
      <span style=3D"color:#000000;background-color:#ffffff;">Nov 25
        10:11:30 stargate systemd[1]: Starting courier-mta.service -
        Courier ESMTP Daemon...</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
      <span style=3D"color:#000000;background-color:#ffffff;">Nov 25
        10:11:30 stargate systemd[1]: Started courier-mta.service -
        Courier ESMTP Daemon.</span><span
        style=3D"color:#000000;background-color:#ffffff;">
      </span><br>
    </span><br>
  </body>
</html>

--------------DEfdtnhwT0CqxTp0FXNgDRjo--


--===============1329746736245723282==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1329746736245723282==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

--===============1329746736245723282==--