Preinstallation tasks

September 3, 2023 by Roberto Puzzanghera 5 comments

Before we start let's see how to prepare our machine for the installation. What follows is mostly a collection of hints that I extracted from the comments, so feel free to contribute.

On Debian 12, you may have to install at least these packages:

apt install build-essential autoconf automake libmariadb-dev default-libmysqlclient-dev libidn2-dev libpcre3-dev

You can decide to install a wider set of packages, if your installation doesn't provide the webserver and the database:

apt install sudo git autoconf automake build-essential libssl-dev libpcre3-dev \
libmariadb-dev default-libmysqlclient-dev mariadb-server \
libev-dev unzip help2man net-tools apache2 python-dev-is-python3 fcgiwrap \
apache2-utils libnet-ssleay-perl php php-fpm php-zip libidn2-dev

This is the list of packages to install on Ubuntu 22.04:

apt install build-essential autoconf automake libmariadb-dev libmariadb-dev-compat wget man help2man unzip psmisc libexpat-dev libidn2-dev

rc.local or systemd?

Maybe you are wondering if it is convenient to let systemd handle the boot of the daemontools, dovecot, spamassassin and so on. I strongly advise against using systemd, especially for daemontools to start/stop them by means of dedicated scripts (qmailctl for instance). Keep in mind that, if you let systemd manage daemontools and the other programs, you will not be able to use other control scripts like qmailctl and dovecotctl to manage the start and stop of services and that you will diverge from what is reported here. Therefore, expecially if you are a newby, I suggest to strictly follow this guide. The comments on this blog have many requests for help from users who have systemd supervising everything and then use qmailctl boot/stop/start causing overlaps and processes that fail due to the inability to acquire the supervise/lock files.

Installing rc.local as a systemd service

In the following guide, our services (not only qmail) will be launched at boot time via rc.local, which is dismissed on a systemd OS. So let's create a new rc.local executable and define it as a systemd service.

Create rc.local and make it executable:

cat > /etc/rc.local << __EOF__ 
#!/bin/bash -e 

__EOF__
chmod +x /etc/rc.local

Create the systemd service:

cat > /etc/systemd/system/rc-local.service << __EOF__ 
[Unit] 
Description=/etc/rc.local 
ConditionPathExists=/etc/rc.local 

[Service] 
Type=forking 
ExecStart=/etc/rc.local 
TimeoutSec=0 
StandardOutput=tty 
RemainAfterExit=yes 

[Install] 
WantedBy=multi-user.target 
__EOF__

Enable and start:

systemctl enable rc-local 
systemctl start  rc-local

Comments

Deps packages - Debian 12

Hi to compile qmail-2025.07.01 yo need install libpcre3-dev

Regards

Reply |

Deps packages - Debian 12

I assume you meant libpcre2-dev, as I was unable to find libpcre3-dev in the repos.

@Roberto, minor thing, maybe add the libpcre2-dev also to the wider set for debian.

Reply |

Deps packages - Debian 12

Hi in debian-12 I use libpecre3-dev in debian-13  libpecre3-dev is deprecated because Old Perl 5 Compatible Regular Expression Library 

Libpcre2-dev does not contain de file pcre.h necessary to compile helodnscheck.cpp

helodnscheck.cpp:106:10: fatal error: pcre.h: No existe el fichero o el directorio 
 106 | #include
     |          ^~~~~~~~
compilation terminated.

root@sa:~/scripts# cat /etc/issue
Debian GNU/Linux 12 \n \l

root@sa:~/scripts# apt list | grep libpcre
libpcre2-16-0/stable 10.42-1 amd64
libpcre2-32-0/stable 10.42-1 amd64
libpcre2-8-0/stable,now 10.42-1 amd64
libpcre2-dev/stable 10.42-1 amd64
libpcre2-posix3/stable 10.42-1 amd64
libpcre3-dbg/stable 2:8.39-15 amd64
libpcre3-dev/stable 2:8.39-15 amd64 

Reply |

Deps packages - Debian 12

Thank you, corrected

Reply |

Deps packages - Debian 12

thank you, added

Reply |