Mailing List Archive

How to debug when script calls exim via sendmail
Dear collegues,
I'm debugging a problem between sympa and exim.
To start the daemon in debug mode I start it as
/usr/sbin/exim4 -bd -q5m -d+all
and I see the flow from extern to exim and from there to the sympa.
So far so good.
When the mails comes out of the sympa list manager it
calls directly /usr/sbin/sendmail which is a symlink to the exim binary
and I have only the usual logging, no -d+all
Can you give me a hint how to enable debugging in this case ?
Regards, Olaf

--
Karlsruher Institut für Technologie (KIT)
Steinbuch Centre for Computing (SCC)

Dipl.-Geophys. Olaf Hopp

Zirkel 2
Gebäude 20.21, Raum 316
76131 Karlsruhe

Telefon: +49 721 608-48009
E-Mail: Olaf.Hopp@kit.edu
Web: www.scc.kit.edu

Sitz der Körperschaft:
Kaiserstraße 12, 76131 Karlsruhe

KIT - Die Forschungsuniversität in der Helmholtz-Gemeinschaft
Re: How to debug when script calls exim via sendmail [ In reply to ]
On 04/07/2022 09:42, Olaf Hopp (SCC) via Exim-users wrote:
> When the mails comes out of the sympa list manager it
> calls directly /usr/sbin/sendmail which is a symlink to the exim binary
> and I have only the usual logging, no -d+all
> Can you give me a hint how to enable debugging in this case ?

You didn't say what version of exim, but if it is new enough
you can enable debug using an ACL modifier.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: How to debug when script calls exim via sendmail [ In reply to ]
On Mon, Jul 04, 2022 at 10:42:50AM +0200, Olaf Hopp (SCC) via Exim-users wrote:
> When the mails comes out of the sympa list manager it
> calls directly /usr/sbin/sendmail which is a symlink to the exim binary
> and I have only the usual logging, no -d+all
> Can you give me a hint how to enable debugging in this case ?

Place a script wrapper instead of symlink on /usr/sbin/sendmail, which
could add some flags, like that:

#!/bin/sh
exec /path/to/exim -d+all "$@"

Or enable debug in ACL for non-SMTP messages (acl_not_smtp).
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: How to debug when script calls exim via sendmail [ In reply to ]
On 7/4/22 11:12, Evgeniy Berdnikov via Exim-users wrote:
>
> Place a script wrapper instead of symlink on /usr/sbin/sendmail, which
> could add some flags, like that:
>
> #!/bin/sh
> exec /path/to/exim -d+all "$@"

Tried that with redirecting that command to <somefile>
I see the beginning of the debug output in <somefile> but then

14:59:10 83016 cwd=/var/lib/sympa/list_data 12 args: /usr/sbin/exim4 -d+all -oi -odi -oem -N success,delay,failure -V00000021 -f bounce+o.hopp==a==example.com.edu==olaftest1==21@test2.lists.example.com -- olaf@example.com
14:59:10 83016 trusted user
exim: debugging permission denied

and the output died. exim is suid root. User sympa is calling the wrapper arounf exim
Anyway the line of interest got already catched up "/usr/sbin/exim4 -d+all -oi -odi -oem..."
That is, what I was searching for, the way how sympa called the exim

> Or enable debug in ACL for non-SMTP messages (acl_not_smtp).

So I gave this a chance. exim is 4.94.2 on Debian Bullseye

acl_not_smtp = not_smtp_acl
[...]
begin acl
not_smtp_acl:
accept
control = debug/opts=+all

Logging is expected in file "debuglog" aside the usual exim logs.
But nothing there.

Any hints ?
Olaf


--
Karlsruher Institut für Technologie (KIT)
Steinbuch Centre for Computing (SCC)

Dipl.-Geophys. Olaf Hopp

Zirkel 2
Gebäude 20.21, Raum 316
76131 Karlsruhe

Telefon: +49 721 608-48009
E-Mail: Olaf.Hopp@kit.edu
Web: www.scc.kit.edu

Sitz der Körperschaft:
Kaiserstraße 12, 76131 Karlsruhe

KIT - Die Forschungsuniversität in der Helmholtz-Gemeinschaft
Re: How to debug when script calls exim via sendmail [ In reply to ]
On Mon, Jul 04, 2022 at 03:43:20PM +0200, Olaf Hopp (SCC) via Exim-users wrote:
> On 7/4/22 11:12, Evgeniy Berdnikov via Exim-users wrote:
> >
> > Place a script wrapper instead of symlink on /usr/sbin/sendmail, which
> > could add some flags, like that:
> >
> > #!/bin/sh
> > exec /path/to/exim -d+all "$@"
>
> Tried that with redirecting that command to <somefile>
> I see the beginning of the debug output in <somefile> but then
>
> 14:59:10 83016 cwd=/var/lib/sympa/list_data 12 args: /usr/sbin/exim4 -d+all -oi -odi -oem -N success,delay,failure -V00000021 -f bounce+o.hopp==a==example.com.edu==olaftest1==21@test2.lists.example.com -- olaf@example.com
> 14:59:10 83016 trusted user
> exim: debugging permission denied

I suspect such combination of arguments "-N success,delay,failure" is
specific for Postfix and/or Sendmail, but not for Exim. As Exim's manual
says, "-N" suppresses delivery on transport level. Then, "-V" is unknown
option for Exim. Is any mail passed out after such submission?

> That is, what I was searching for, the way how sympa called the exim

Probably -N.. and -V.. should be removed for submission to Exim.
It can be done in wrapper script.

> > Or enable debug in ACL for non-SMTP messages (acl_not_smtp).
>
> So I gave this a chance. exim is 4.94.2 on Debian Bullseye
>
> acl_not_smtp = not_smtp_acl
> [...]
> begin acl
> not_smtp_acl:
> accept
> control = debug/opts=+all
>
> Logging is expected in file "debuglog" aside the usual exim logs.
> But nothing there.

If Exim is not started mail processing due illegal CLI options,
ACLs would not be executed. Nevertheless, try to set world-write
permissions to log directory.
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/