To add to @user9517's answer with the return_output directive, I'd like to share how I saw Exim log output on a RedHat based cPanel server:
- Turn off any monitoring or service restarts of Exim. E.g. cPanel servers have a 'Service Manager' that can stop restarts that would interfere with your debug run, as well as stop the service gracefully when you need to in a following step.
- Check how Exim normally runs for you:
ps aux | grep "exi[m]"
- Kill Exim, your command may be different from mine. (-9 is dangerous, know what you're doing)
kill -9 $( ps aux | grep "sbin\/exi[m]" )
- Start Exim in debug mode with
-d
, and save output to a file as well as STDIN if desired, your command may be different from mine. +all adds as much as possible AFAIK.
/usr/sbin/exim -d+all -ps -bd -q15m -oP /var/spool/exim/exim-daemon.pid 2&1 | tee ~/exim-debug.log
- See Exim's routing. This is just a handy one-liner to only show the successful routes taken.
cat ~/exim-debug.log | perl -0076 -ne '@x = $_ =~ /(^ ([^ ]*) .+? routed by \2 )/gs; $"="\n==========\n\n"; $cnt=0; for (@x){ print " -------->$_\n\n" unless $cnt % 2; $cnt++}'
The full log is where it mentions the child process.
grep -A15 'direct command' ~/exim-debug.log
The Exim mainlog also shows the result:
/var/log/exim_mainlog