2 mail domain SSL certificates aren't renewing for some reason

You can add a mail domain for your hostname cp.example.com, add the right DKIM, DMARC and SPF records and add an account postmaster with root and noreply as alias an you shouldn’t have issues.

I’m reading of a way using ssmtp where I can add the credentials I’ve made for an inbox in my mail domain. Does it sound good?

If you want to test it, go ahead but I think it’s easier to add the hostname as mail domain in Hestia.

But how do I indicate to the crontab (or the system in general) to use those credentials? :thinking:

This is the part I’m missing

I’ve never done that with crontab, so I’m not sure whether it’s possible… at least not easily. Some Ubuntu versions allow the MAILFROM="" variable in crontab, but you’d need to add it manually (Debian doesn’t support this variable).

As I mentioned, adding the hostname as the mail domain will make your life easier. :stuck_out_tongue:

I should have listen to you and slow down, exim isn’t working anymore since I’ve tried to follow the guide I found using ssmtp. I’ll try to install it from scratch

Is there a way to reinstall exim from HestiaCP? The /etc/exim4/exim4.conf.template file got reset unfortunately

I would say that you can restore it from your backup… :crazy_face:

The way to restore it will depend on the services you are using… clamav, spamassassin, sieve… I’ve wrote several posts in this forums regarding it. I’ve no time now but if you can’t solve it, let me know what are the services you are using and i’ll tell you the way to restore Exim’s conf later.

Since I moved to Oracle I never performed a restore and unfortunately I found out later that their support takes ages to reply so I would use a backup only in extreme cases :smile:

I was able to get the default conf file from GitHub but I think that the way I’ve reinstalled exim is not the default type of install that HestiaCP does as it doesn’t accept the default conf file. It won’t restart when using it:

authenticator dovecot_plain: cannot find authenticator driver “dovecot”

I think I was able to bring that back up, but Roundcube keeps saying Login failed even if the credentials are correct

I’m back.

Great! :+1:

Regarding roundcube:

Show me the output of telnet localhost 143

All good, I believe, but please, if you can, confirm that I’m not missing anything.
By checking dovecot logs I was able to see that exim4 was missing the /domains folder as well as passwd. Luckily I made a copy of that folder before reinstalling so I got them from there, current owner is root:root. The login now works as well as receive/sending emails. Is there anything else I should double check?

Tell me what’s your Exim version and whether you are using Sieve:

dpkg -l | grep -E 'exim|sieve'

Also, show the output of these commands:

ls -la /etc/exim4/
grep -Ev '^$|^#' /etc/exim4/update-exim4.conf.conf

Thank you!

ii  exim4                                  4.93-13ubuntu1.12                            all          metapackage to ease Exim MTA (v4) installation
ii  exim4-base                             4.93-13ubuntu1.12                            arm64        support files for all Exim MTA (v4) packages
ii  exim4-config                           4.93-13ubuntu1.12                            all          configuration for the Exim MTA (v4)
ii  exim4-daemon-heavy                     4.93-13ubuntu1.12                            arm64        Exim MTA (v4) daemon with extended features, including exiscan-acl
rc  exim4-daemon-light                     4.93-13ubuntu1.12                            arm64        lightweight Exim MTA (v4) daemon
root@1:~# ls -la /etc/exim4/
total 96
drwxr-xr-x   6 root root         4096 Dec 14 21:26 .
drwxr-xr-x 136 root root        12288 Dec 14 18:26 ..
drwxr-xr-x   9 root root         4096 Dec 14 18:26 conf.d
-rw-r--r--   1 root root           32 Dec 14 21:26 dnsbl.conf
drwxr-xr-x   2 root root         4096 Dec 14 21:26 domains
drwxr-xr-x   4 root root         4096 Dec 14 21:24 exim4.backup
-rw-r--r--   1 root root        17188 Dec 14 21:19 exim4.conf.template
-rw-r--r--   1 root root        17175 Dec 14 21:19 exim4.conf.template.backup2
-rw-r--r--   1 root root            3 Dec 14 21:26 limit.conf
drwxr-xr-x   2 root root         4096 Dec 14 21:26 passwd
-rw-r-----   1 root Debian-exim   204 Jul 30 19:25 passwd.client
-rw-r--r--   1 root root            0 Dec 14 21:26 spam-blocks.conf
-rw-r-----   1 root root           17 Dec 14 21:26 srs.conf
-rw-r--r--   1 root root          442 Dec 14 21:26 system.filter
-rw-r--r--   1 root root         1030 Dec 14 21:16 update-exim4.conf.conf
-rw-r--r--   1 root root            0 Dec 14 21:26 white-blocks.conf
root@1:~# grep -Ev '^$|^#' /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='internet'
dc_other_hostnames='localbizone-x'
dc_local_interfaces='0.0.0.0'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

That should be:

dc_eximconfig_configtype='local'
dc_other_hostnames='HereYourServerHostname'
dc_local_interfaces='127.0.0.1 ; ::1'

You are not using Sieve and your Exim version is a bit old so you are not using SRS too, only Spamassassin and Clamav so this script should build the right conf for your system.

#!/usr/bin/env bash
HESTIA_INSTALL_DIR="/usr/local/hestia/install/deb"
eximdir="/etc/exim4"
backup="/root/backup_etc_exim4_$(date +'%Y-%m-%d_%H$M$S')/etc"
mkdir -p "$backup"
cp -rf "$eximdir" "$backup"
cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template "$eximdir"/exim4.conf.template
sed -Ei "s/^#SPAM/SPAM/" "$eximdir"/exim4.conf.template
sed -Ei "s/^#CLAMD/CLAMD/" "$eximdir"/exim4.conf.template
chmod 640 "$eximdir"/exim4.conf.template
1 Like

Let me edit that, by hostname what does it refers to? The domain used by HestiaCP?

hostname -f

All done, should I restart exim4?

Yes, you should :wink:

It seems that all is well, finally :relieved:

1 Like