Setting up the email server on my home server was probably the most difficult task. Email server setup is intricate, risky and involves significant commitment and effort to setup reliably and maintain.
My current email server is based upon workaround.org ISPmail tutorials for a Debian based server. I first got this up and running in later 2020 on Debian 10 (Buster). The most current is ISPmail guide for Debian 12 “Bookworm” that was release in 2023 shortly after the Bookworm release.
I setup my email server on a separate virtual machine (VM) on my home server that also acts as a NAS. The main mail files are stored on a drive outside the VM.
As the home server has only one external static IPv4 address the mail server subdomain needs to be shared on the common IP address with other subdomains and applications. We can use the web server's “virtual host” feature to differentiate between different subdomains.
The mail server need to have a static IP address on the local area network.
Change host name: sudo hostnamectl set-hostname hostname
, may also need to change /etc/hosts
to suit
I store my main mail directory (/var/vmail
) off the VM and on a shared server drives.
This my old email server setup notes. This is for older Ubuntu servers and many of these links are no longer working or have not been updated for latest Ubuntu releases.
These setup notes are not compatible with my current email setup.
My current email server is based upon Debian 10 (Buster) with setup following, ISPmail on Debian Buster – your mail server workshop.
The major change is that I place my mail directory on a separate network attached drive.
I had a problem with my DNS setup that made the server fail. Use of Telnet helped find this fault as most the other tool were silent on the exact error. Telnet in to the server showed the wrong server / IP address. The setup indicated that these types of faults are commonly DNS issues.
The dovecot configuration files are located at: /etc/dovecot/conf.d/
. (This is mention in the setup discription.)
The “postconf” command conveniently adds configuration lines to your /etc/postfix/main.cf
file. It also activates the new setting instantly so you do not have to reload the Postfix process.
My server usage is complicated by my infrequent usage. This is particularly true of email server setup which one of the more complex setup. The other one is the router set-up which includes firewater and vpn. I tend to use other peoples descriptions “formula” to assist with email server set up e.g. Workaround.org; Creating a TLS encryption key and certificate. Whereas for my router setup I have more fully created my own notes.
Unfortunately the certbot site instructions certbot instructions call up the use for snaps. I do not like using snaps. In Debian and presumably Ubuntu the certbot package can be used sudo apt install certbot
.
Workaround uses the certonly option of certbot sudo certbot certonly --webroot --webroot-path /var/www/mail.kptree.net -d mail.kptree.net
. This works straight away and well. Unfortunately later on in the Roundcube webmail the appache2 configuration file has the DocumentRoot
changes to the roundcube location, that seems to stop the auto renew function of the certbot certonly
setup from working, as it was originally set up with a different document root! To allow certbot to function with the new DocumentRoot
I needed to add the following to the apach2 site configuration file sudo vim /etc/apache2/sites-available/mail.kptree.net-https.conf
:
Alias /.well-known /var/www/mail.kptree.net
My current email server is based upon Debian 10 (Buster) with setup following, ISPmail on Debian Buster – your mail server workshop. These setup instructions include Roundcube Webmail server setup.
I never had much success with Horde, not sure how good it is and if it is worth the effort. Further to this I use Nextcloud, which probably provides a lot of the similar functionallity I need.
sudo systemctl status apache2
sudo mysql -u root -p
show databases;
create dBase_NAME
SELECT table_schema “DB Name”, Round(Sum(data_length + index_length) / 1024 / 1024, 1) “DB Size in MB” FROM information_schema.tables GROUP BY table_schema;
use databasename;
show tables;
wget http://ipinfo.io/ip -qO -
ip a
sudo systemctl start deluge
sudo systemctl start deluge-web