Well hopefully someone can help me!

I have issues with fail2ban and exim4 services aren’t starting or simlar to this !

Output:

● exim4.service - LSB: exim Mail Transport Agent
     Loaded: loaded (/etc/init.d/exim4; generated)
     Active: active (exited) since Mon 2023-12-18 19:15:36 CET; 3min 11s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 7245 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)
        CPU: 2ms

Dec 18 19:15:36 na.na.na systemd[1]: Starting exim4.service - LSB: exim Mail Transport Agent...
Dec 18 19:15:36 na.na.na systemd[1]: Started exim4.service - LSB: exim Mail Transport Agent.
× fail2ban.service - Fail2Ban Service
     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-12-18 19:23:03 CET; 1min 30s ago
   Duration: 177ms
       Docs: man:fail2ban(1)
    Process: 10168 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
   Main PID: 10168 (code=exited, status=255/EXCEPTION)
        CPU: 168ms

Dec 18 19:23:03 na.na.na systemd[1]: Started fail2ban.service - Fail2Ban Service.
Dec 18 19:23:03 na.na.na fail2ban-server[10168]: 2023-12-18 19:23:03,819 fail2ban.configreader   [10168]: WARNING 'al>
Dec 18 19:23:03 na.na.na fail2ban-server[10168]: 2023-12-18 19:23:03,857 fail2ban                [10168]: ERROR   Fai>
Dec 18 19:23:03 na.na.na fail2ban-server[10168]: 2023-12-18 19:23:03,866 fail2ban                [10168]: ERROR   Asy>
Dec 18 19:23:03 na.na.na systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Dec 18 19:23:03 na.na.na systemd[1]: fail2ban.service: Failed with result 'exit-code'.
owipv6' not defined in 'Definition'. Using default one: 'auto'
ed during configuration: Have not found any log file for exim-iptables jail
c configuration of server failed

Regarding Exim:

Are there log files in /var/log/exim4/?

ls -la /var/log/exim4/

Is there something interesting in paniclog and/or mainlog?

Regarding fail2ban:

You didn’t show all the lines, the output is cut off but seems it is failing to start because the exim issue (can’t find exim’s logs).

root@na7:~# ls -la /var/log/exim4/
total 184
drwxr-s---  2 Debian-exim adm   4096 Dec 18 19:00 .
drwxr-xr-x 14 root        root  4096 Dec 17 00:00 ..
-rw-r-----  1 Debian-exim adm  64495 Dec 17 22:44 mainlog.1
-rw-r-----  1 Debian-exim adm   2989 Dec  8 23:42 mainlog.10.gz
-rw-r-----  1 Debian-exim adm   5752 Dec 16 23:54 mainlog.2.gz
-rw-r-----  1 Debian-exim adm   4723 Dec 15 23:56 mainlog.3.gz
-rw-r-----  1 Debian-exim adm   4227 Dec 14 23:52 mainlog.4.gz
-rw-r-----  1 Debian-exim adm   4342 Dec 13 23:59 mainlog.5.gz
-rw-r-----  1 Debian-exim adm   4482 Dec 12 23:59 mainlog.6.gz
-rw-r-----  1 Debian-exim adm   2771 Dec 11 23:55 mainlog.7.gz
-rw-r-----  1 Debian-exim adm   2904 Dec 10 23:42 mainlog.8.gz
-rw-r-----  1 Debian-exim adm   3903 Dec  9 23:42 mainlog.9.gz
-rw-r-----  1 Debian-exim adm  15978 Dec 17 22:32 rejectlog.1
-rw-r-----  1 Debian-exim adm   1178 Dec  8 20:42 rejectlog.10.gz
-rw-r-----  1 Debian-exim adm   1573 Dec 16 23:53 rejectlog.2.gz
-rw-r-----  1 Debian-exim adm    871 Dec 15 20:40 rejectlog.3.gz
-rw-r-----  1 Debian-exim adm    573 Dec 14 23:52 rejectlog.4.gz
-rw-r-----  1 Debian-exim adm    704 Dec 13 23:19 rejectlog.5.gz
-rw-r-----  1 Debian-exim adm   1142 Dec 12 23:55 rejectlog.6.gz
-rw-r-----  1 Debian-exim adm    976 Dec 11 23:31 rejectlog.7.gz
-rw-r-----  1 Debian-exim adm   1240 Dec 10 23:13 rejectlog.8.gz
-rw-r-----  1 Debian-exim adm   1179 Dec  9 23:06 rejectlog.9.gz

mainlog.1:

https://termbin.com/sjmf

I can’t see a mainlog file, mainlog.1 is the yesterday’s log.

Do you have free space?

df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           795M  992K  794M   1% /run
/dev/vda3       157G   11G  140G   8% /
tmpfs           3.9G  2.2M  3.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/vda2       974M  122M  786M  14% /boot
/dev/loop2       41M   41M     0 100% /snap/snapd/20290
/dev/loop0      4.7M  4.7M     0 100% /snap/rdap/7
/dev/loop1      106M  106M     0 100% /snap/core/16202
/dev/loop4       75M   75M     0 100% /snap/core22/1033
/dev/loop3       74M   74M     0 100% /snap/core22/864
overlay         157G   11G  140G   8% /var/lib/docker/overlay2/f5b6ffe7c5d1eaad600cbcba4ae27e03556484e82f931d78615ba94cd2b13ae8/merged
tmpfs           795M  4.0K  795M   1% /run/user/1002

Yes sir !

That’s all what it is there is no mainlog “”

Try to restart exim and show the status again:

systemctl restart exim4
systemctl status exim4

Show the contents of /etc/exim4/ dir:

ls -la /etc/exim4/

And show the exim installed packages:

dpkg -l | grep -i exim
root@na7:/var/log/exim4# systemctl status exim4
● exim4.service - LSB: exim Mail Transport Agent
     Loaded: loaded (/etc/init.d/exim4; generated)
     Active: active (exited) since Mon 2023-12-18 21:08:11 CET; 4s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 24150 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)
        CPU: 2ms

Dec 18 21:08:11 na7.hax.al systemd[1]: Starting exim4.service - LSB: exim Mail Transport Agent...
Dec 18 21:08:11 na7.hax.al systemd[1]: Started exim4.service - LSB: exim Mail Transport Agent.
root@na7:/var/log/exim4# ls -la /etc/exim4/
total 88
drwxr-xr-x   4 root root         4096 Dec 18 19:15 .
drwxr-xr-x 120 root root        12288 Dec 18 18:52 ..
drwxr-xr-x   9 root root         4096 Oct 18 19:33 conf.d
-rw-r--r--   1 root root           32 Oct 18 19:41 dnsbl.conf
drwxr-xr-x   2 root root         4096 Nov 28 04:42 domains
-rw-r-----   1 root Debian-exim 20129 Dec 18 19:15 exim4.conf.template
-rw-r-----   1 root root        20129 Dec 18 18:50 exim4.conf.template.vst.back
-rw-r--r--   1 root root            3 Oct 18 19:41 limit.conf
-rw-r-----   1 root Debian-exim   204 Sep 29 22:38 passwd.client
-rw-r--r--   1 root root            0 Oct 18 19:41 spam-blocks.conf
-rw-r-----   1 root Debian-exim    17 Oct 18 19:41 srs.conf
-rw-r--r--   1 root root          442 Oct 18 19:41 system.filter
-rw-r--r--   1 root root         1054 Oct 18 19:34 update-exim4.conf.conf
-rw-r--r--   1 root root            0 Oct 18 19:41 white-blocks.conf
root@na7:/var/log/exim4# dpkg -l | grep -i exim
rc  exim4                                            4.96-15+deb12u2                               all          metapackage to ease Exim MTA (v4) installation
rc  exim4-base                                       4.96-15+deb12u2                               amd64        support files for all Exim MTA (v4) packages
rc  exim4-config                                     4.96-15+deb12u2                               all          configuration for the Exim MTA (v4)
rc  exim4-daemon-heavy                               4.96-15+deb12u2                               amd64        Exim MTA (v4) daemon with extended features, including exiscan-acl
root@na7:/var/log/exim4#

Did you reinstall exim or modified the conf in some way? I’m asking because conf has been modified two hours ago.

Yeah I just replaced conf file with the .back file since it wasn’t working I tried to do some google and stuff and in the forum aswell I found no luck so I am here now !

Here the main problem is that we don’t have a log and don’t know the reason exim is not starting correctly.

Show me the output of:

cat /etc/exim4/update-exim4.conf.conf

Sure here:

https://termbin.com/tkwa

That conf file is correct.

Just in case, show the output of journalctl:

journalctl -xa --no-pager --since=yesterday --until=now -u exim4

Also the exim4 conf:

cat /etc/exim4/exim4.conf.template

And also the services that are listening in your server:

lsof -Pn +c0 -i -sTCP:LISTEN
  1. https://termbin.com/xp1r
  2. https://termbin.com/rx4z
  3. https://termbin.com/16fn

Your exim4 conf is not using dovecot_virtual_delivery.

I’ve modfied your exim conf, replace it and try again:

cd /etc/exim4/
mv exim4.conf.template exim4.conf.template.backup_2023-12-18
curl https://termbin.com/xe5v -o exim4.conf.template
systemctl restart exim4
systemctl status exim4
● exim4.service - LSB: exim Mail Transport Agent
     Loaded: loaded (/etc/init.d/exim4; generated)
     Active: active (exited) since Mon 2023-12-18 22:31:36 CET; 2s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 35522 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)
        CPU: 3ms

Dec 18 22:31:36 na.na.na systemd[1]: Starting exim4.service - LSB: exim Mail Transport Agent...
Dec 18 22:31:36 na.na.na systemd[1]: Started exim4.service - LSB: exim Mail Transport Agent.

The results the hostname isn’t na.na.na btw

Lets try this:

systemctl add-wants multi-user.target exim4.service
systemctl start exim4
systemctl status exim4

If that doesn’t work:

/etc/init.d/exim4 start
lsof -Pn +c0 -i -sTCP:LISTEN | grep -i exim

If that doesn’t work too, reboot the server and if that doesn’t work, then…

Failed to add dependency: Unit /run/systemd/generator.late/exim4.service is transient or generated.

No out put out of:

lsof -Pn +c0 -i -sTCP:LISTEN | grep -i exim

well reboot then see what happend, and still no luck !

I’m sorry but I’m running out of ideas :frowning:

Let’s debug the start just in case we can see something…

bash -x /etc/init.d/exim4 start

root@na7:/etc/exim4# bash -x /etc/init.d/exim4 start
+ set -e
+ test -x /usr/lib/exim4/exim4
+ exit 0

Solved ! by doing this:

apt remove --purge exim4 exim4-config

and reinstalling it:

apt install exim4