Exim4 will not come up

I am new to HestiaCP and need help setting up. How do I get paid help to setup HestiaCP - nameserver, web, DNS and mail servers?
After installation Exim4 will not come up with the following error. I tried to uninstall and install but no luck.
Jul 01 13:46:51 xxx.com systemd[1]: Starting exim4.service - exim Mail Transport Agent…
Jul 01 13:46:51 xxx.com update-exim4.conf[803198]: 2025-07-01 13:46:51 Exim configuration error in line 50 of /var/lib/exim4/config.autogenerated.tmp:
Jul 01 13:46:51 xxx.com update-exim4.conf[803198]: main option “acl_smtp_mime” unknown
Jul 01 13:46:51 xxx.com update-exim4.conf[803200]: Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
Jul 01 13:46:51 xxx.com update-exim4.conf[803200]: /var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated

Are you sure the acl_smtp_mime error occurred after the first installation and not after reinstalling Exim?

Show the output of these commands:

curl -fsSLm15 https://7j.gg/hcpver | bash -s --
dpkg -l | grep exim4

yes, the error occurred right after installation. we attempted to fix it but there were other problems so we removed to be reinstalled. Here is the requested info:

$ curl -fsSLm15 https://7j.gg/hcpver | bash -s –
Software Version


OS Ubuntu 24.04.2 LTS
Hestia 1.9.3
Hestia-nginx 1.27.4
Hestia-php 8.3.17
FileGator 7.13.0
Nginx 1.27.5
PHP8.4 8.4.8
PHP8.3 8.3.22
PHP8.2 8.2.28
PHP8.1 8.1.32
PHP8.0 8.0.30
PHP7.4 7.4.33
PHP7.3 7.3.33
PHP7.2 7.2.34
PHP7.1 7.1.33
PHP7.0 7.0.33
PHP5.6 5.6.40
Awstats 7.9
Dovecot 2.3.21
Spamassassin 4.0.0
Clamav 1.0.8
Vsftpd 3.0.5
Bind9 9.18.30
PostgreSQL 16.9
phpPgAdmin 7.14.6
Fail2ban 1.0.2

$
$ dpkg -l | grep exim4

empty because we have removed it and want to reinstall

This script will purge Exim4, reinstall it and configure it to use SpamAssassin and ClamAV.

First, backup /etc/exim4

mkdir -p /root/backup_etc_exim4/
cp -prf /etc/exim4/ /root/backup_etc_exim4/

Now execute the script:

curl -fsSLm15 https://7j.gg/instexim | sudo bash -s --

Once finished, show the output of this command:

systemctl status exim4 --no-pager -l

Just in case, this is the script:

#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
    echo "Error: script must be run as root"
    exit 2
fi
export PATH=$PATH:/sbin
HESTIA='/usr/local/hestia'
HESTIA_BIN="$HESTIA/bin"
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
HESTIA_COMMON_DIR="$HESTIA/install/common"

version_ge() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o -n "$1" -a "$1" = "$2"; }
gen_pass() {
    matrix=$1
    length=$2
    if [ -z "$matrix" ]; then
        matrix="A-Za-z0-9"
    fi
    if [ -z "$length" ]; then
        length=16
    fi
    head /dev/urandom | tr -dc $matrix | head -c$length
}

check_result() {
    if [ $1 -ne 0 ]; then
        echo "Error: $2"
        exit $1
    fi
}

#Remove and reinstall exim4
exim=yes
spamd=yes
clamd=yes
sieve=no

echo "[ * ] Removing Exim4 packages"
apt purge -q -y "exim4*" &>/dev/null
echo "[ * ] Installing Exim4 packages"
apt install -q -y exim4 exim4-daemon-heavy &>/dev/null

if [ "$exim" = 'yes' ]; then
    "$HESTIA_BIN/v-change-sys-config-value" "MAIL_SYSTEM" "exim4"
    if [ "$clamd" = 'yes' ]; then
        "$HESTIA_BIN/v-change-sys-config-value" "ANTIVIRUS_SYSTEM" "clamav-daemon"
    fi
    if [ "$spamd" = 'yes' ]; then
        "$HESTIA_BIN/v-change-sys-config-value" "ANTISPAM_SYSTEM" "spamassassin"
    fi
    if [ "$sieve" = 'yes' ]; then
        "$HESTIA_BIN/v-change-sys-config-value" "SIEVE_SYSTEM" "yes"
    fi
fi
if [ "$exim" = 'yes' ]; then
    echo "[ * ] Configuring Exim mail server"
    gpasswd -a Debian-exim mail >/dev/null 2>&1
    exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
    # if Exim version > 4.9.4 or greater!
    if ! version_ge "4.94" "$exim_version"; then
        # Ubuntu 22.04 (Jammy) uses Exim 4.95 instead but config works with Exim4.94
        cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.4.95.template /etc/exim4/exim4.conf.template
    else
        cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template /etc/exim4/
    fi
    cp -f $HESTIA_INSTALL_DIR/exim/dnsbl.conf /etc/exim4/
    cp -f $HESTIA_INSTALL_DIR/exim/spam-blocks.conf /etc/exim4/
    cp -f $HESTIA_INSTALL_DIR/exim/limit.conf /etc/exim4/
    cp -f $HESTIA_INSTALL_DIR/exim/system.filter /etc/exim4/
    touch /etc/exim4/white-blocks.conf

    if [ "$spamd" = 'yes' ]; then
        sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template
    fi
    if [ "$clamd" = 'yes' ]; then
        sed -i "s/#CLAMD/CLAMD/g" /etc/exim4/exim4.conf.template
    fi

    # Generate SRS KEY If not support just created it will get ignored anyway
    srs=$(gen_pass)
    echo $srs >/etc/exim4/srs.conf
    chmod 640 /etc/exim4/srs.conf
    chmod 640 /etc/exim4/exim4.conf.template
    chown root:Debian-exim /etc/exim4/srs.conf

    rm -rf /etc/exim4/domains
    mkdir -p /etc/exim4/domains

    rm -f /etc/alternatives/mta
    ln -s /usr/sbin/exim4 /etc/alternatives/mta
    update-rc.d -f sendmail remove >/dev/null 2>&1
    update-rc.d -f postfix remove >/dev/null 2>&1
    systemctl stop postfix >/dev/null 2>&1
    update-rc.d exim4 defaults
    systemctl start exim4 >/dev/null
    check_result $? "exim4 start failed"
fi

echo "[ * ] Done!"

It works!
Thanks

This is the output:
$ systemctl status exim4 --no-pager -l
● exim4.service - exim Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/exim4.service; enabled; preset: enabled)
Active: active (running) since Thu 2025-07-03 01:13:18 UTC; 1min 7s ago
Docs: man:exim(8)
Documentation for Exim
Main PID: 33969
Tasks: 1 (limit: 9429)
Memory: 14.5M (peak: 25.4M)
CPU: 391ms
CGroup: /system.slice/exim4.service
└─33969 /usr/sbin/exim4 -bdf -q30m

Jul 03 01:13:18 [1]: Starting exim4.service - exim Mail Transport Agent…
Jul 03 01:13:18 systemd[1]: Started exim4.service - exim Mail Transport Agent.

1 Like