Changelog
- Jan 21, 2026
- added notes for Alma Linux - Jan 5, 2026
-qmailnow avoids the PCRE dependency to make happy Debian 13 users
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 13, you may have to install at least these packages:
apt install build-essential autoconf automake libmariadb-dev default-libmysqlclient-dev libidn2-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 \ libmariadb-dev default-libmysqlclient-dev mariadb-server pkg-config \ libev-dev unzip help2man net-tools apache2 python-dev-is-python3 fcgiwrap \ apache2-utils libnet-ssleay-perl php php-fpm php-zip libidn2-dev libbz2-dev liblz4-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 libbz2-dev pkg-config
This is the required packages on Alma Linux v. 9.7, which could be the same on other RedHat-like systems:
dnf groupinstall "Development Tools" -y dnf install -y openldap openldap-devel openldap-clients bzip2-devel \ lz4-libs lz4-devel rpcgen expat-devel libidn2-devel perl-diagnostics \ mariadb-server mariadb-devel
Since we are going to install a couple of packages in /usr/local, you have to add it to your ld.so.conf:
cat >> /etc/ld.so.conf.d/usr-local.conf << __EOF__ /usr/local/lib /usr/local/lib64 /usr/local/qlibs __EOF__
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
Check your IP's reputation
When you buy an IP address, you know that it's not new and you inherit its reputation. So the first thing you may want to do is to check if it's listed in some RBL here: http://multirbl.valli.org or https://mxtoolbox.com/SuperTool.aspx
I think it would convenient for anyone to have a list of tools to remove an IP from the blocklists around the world. Please contribute posting a comment below. Here is the first one:
- https://ipremoval.sms.symantec.com for blocklist which uses Symantec


Comments
Deps packages - Debian 12
Ricardo Brisighelli August 4, 2025 16:45 CET
Hi to compile qmail-2025.07.01 yo need install libpcre3-dev
Regards
Reply | Permalink
Deps packages - Debian 12
GoofY Ricardo Brisighelli August 7, 2025 19:33 CET
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 | Permalink
Deps packages - Debian 12
Ricardo Brisighelli GoofY August 21, 2025 20:16 CET
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
Reply | Permalink
Deps packages - Debian 12
Roberto Puzzanghera Ricardo Brisighelli August 22, 2025 08:39 CET
Thank you, corrected
Reply | Permalink
Deps packages - Debian 12
Roberto Puzzanghera Ricardo Brisighelli August 4, 2025 18:08 CET
thank you, added
Reply | Permalink
Deps packages - Debian 12/Debian 13
William Silverstein Roberto Puzzanghera January 5, 2026 13:01 CET
You mentioned the libpcre3 issue and the missing pcre.The file has been added or fixed. What is that fix, as I am trying to build with debian 13 and qmail-2025.09.08 package?
Thanks.
Reply | Permalink
Deps packages - Debian 12/Debian 13
Roberto Puzzanghera William Silverstein January 5, 2026 15:54 CET
I released a new package for qmail, which avoids the PCRE dependency. It works here on Debian 13
Reply | Permalink
Deps packages - Debian 12/Debian 13
Roberto Puzzanghera William Silverstein January 5, 2026 14:33 CET
it is not fixed on debian 13. Edit Makefile and drop the following at the very bottom of the file
then compile. You'll not have the helodnscheck plugin for the time being, but qmail will work.
I'll try to upgrade that program in order to get rid of pcre
Reply | Permalink
Deps packages - Debian 12/Debian 13
William Silverstein Roberto Puzzanghera January 5, 2026 17:15 CET
Thanks. There are suspicious characters (according to emacs) at lines 2077 and 2444. Also, I needed to remove the helodnscheck from target: it. (line 869)
Reply | Permalink
Deps packages - Debian 12/Debian 13
Roberto Puzzanghera William Silverstein January 5, 2026 17:20 CET
which file has hidden characters? can you do
Reply | Permalink
Deps packages - Debian 12/Debian 13
William Silverstein Roberto Puzzanghera January 5, 2026 17:30 CET
It is in Makefile. Those are space characters before tab. Not an error in Makefile, but emacs was complaining about it.
Reply | Permalink
Deps packages - Debian 12/Debian 13
Roberto Puzzanghera William Silverstein January 5, 2026 17:32 CET
but the Makefile is not that long... it's only 2503 lines...
Reply | Permalink