Patching qmail

June 19, 2019 Roberto Puzzanghera 227 comments


The complete changelog and patch info are inside the README.PATCH file.

  • 2019.06.19
    - DKIM patch updated to v. 1.26
    * BUG - honor body length tag in verification
  • 2019.05.24
    - qmail-tls patch updated to v. 20190517
    * bug: qmail-smtpd ssl_free before tls_out error string (K. Wheeler)
  • 2019.05.23
    - DKIM patch updated to v. 1.25
    * SIGSEGV - when the txt data for domainkeys is very large exposed a bug in the way realloc() was used incorrectly.
    * On 32 bit systems, variable defined as time_t overflows. Now qmail-dkim will skip expiry check in such conditions.
  • 2019.04.25
    * bug fixed on qmail-smtpd.c: it was selecting the wrong openssl version on line 2331 (tx ChangHo.Na)
  • 2019.04.09
    - qmail-tls patch updated to v. 20190408
    * make compatible with openssl 1.1.0 (Rolf Eike Beer, Dirk Engling, Alexander Hof)
    * compiler warnings on char * casts (Kai Peter)
  • 2019.04.03
    -libdomainkeys patch updated (tx Manvendra Banghui)
  • 2019.03.22
    - fixed a bug causing crashes of qmail-remote when using openssl-1.1 (tx Luca Franceschini)
  • 2019.02.27
    - port to openssl-1.1
    - DKIM patch updated to v. 1.24
    * bug fix: restored signaturedomains/nosignaturedomains functionalities.
  • 2018.08.25
    -DKIM patch updated to v. 1.23
    * fixed a bug where including round brackets in the From: field ouside the double quotes (From: "Name Surname (My Company)" <>) results in a DKIMContext structure invalid error (tx Mirko Buffoni).
    * qmail-dkim and dkim were issuing a failure for emails which had multiple signature with at least one good signature. Now qmail-dkim and dkim will issue a success if at least one good signature is found.
  • 2018.08.23
    -logging patch updated to v. 5
    * fixed a bug in logit and logit2 functions where a RSET command and a subsequent brutal quit of the smtp conversation ^] by the client cause a segfault (tx Mirko Buffoni, more info here)
    -patch info moved to README.PATCH file

smtp-auth + qmail-tls + forcetls patch for qmail

April 17, 2019 Roberto Puzzanghera 77 comments


  • 2019-04-17
    - qmail-tls patch updated to v. 20190408
    * make compatible with openssl 1.1.0 (Rolf Eike Beer, Dirk Engling, Alexander Hof)
    * compiler warnings on char * casts (Kai Peter)
  • 2019-03-12
    * openssl-1.1 port
  • 2017-08-18
    -qmail-smtpd now retains authentication upon rset (tx to Andreas)
  • 2016-09-19
    -qmail-tls patch updated to v. 20160918
      * bug: qmail-remote accepting any dNSName, without checking that is matches (E. Surovegin)
      * bug: documentation regarding RSA and DH keys (K. Peter, G. A. Bofill)
  • 2016-05-15 force-tls patch improved (a big thanks to Marcel Telka). Now qmail-smtpd avoid to write the auth verb if the STARTTLS command was not sent by the client
  • 2015-12-26 qmail-tls: updated to v. 20151215
    * typo in #if OPENSSL_VERSION_NUMBER for 2015-12-08 patch release (V. Smith)
    * add ECDH to qmail-smtpd
    * increase size of RSA and DH pregenerated keys to 2048 bits
    * qmail-smtpd sets RELAYCLIENT if relaying allowed by cert
  • 2015-10-05 qmail-authentication: updated to v. 0.8.3
  • 2015.08-24 fixed a bug on qmail-smtpd.c causing a double 250-STARTTLS, thanks to Andreas
  • 2015.08.08 fixed a bug on qmail-remote.c that was causing the sending of an additional ehlo greeting, thanks to Cristoph Grover

I have put into a package the latest version of the following patches for netqmail-1.06. You may be interested to the combined patch I have put together here.

Installing a Let's Encrypt certificate for your qmail and dovecot servers

March 21, 2018 Roberto Puzzanghera 14 comments

More info:

Here is how to install and configure a valid certificate from Let's Encrypt for your qmail and dovecot servers. The installation will be done by certbot.

Certbot is part of EFF’s effort to encrypt the entire Internet. Secure communication over the Web relies on HTTPS, which requires the use of a digital certificate that lets browsers verify the identity of web servers (e.g., is that really Web servers obtain their certificates from trusted third parties called certificate authorities (CAs). Certbot is an easy-to-use client that fetches a certificate from Let’s Encrypt—an open certificate authority launched by the EFF, Mozilla, and others—and deploys it to a web server.

Installing Dovecot and sieve on a vpopmail + qmail server

March 21, 2018 Roberto Puzzanghera 49 comments


Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory.

Limiting the number of emails sent by a given auth-user/domain/IP

October 24, 2017 Roberto Puzzanghera 8 comments

If you want to avoid the risk of compromising your server because of accounts who are sending messages indiscriminately to the world, due to the fact that their password was violated in some way, then you can take advantage of Luca Franceschini's script, which has to be used in conjunction with the rcptcheck patch (a patch derived by Luca himself from an original work of Jay Soffian).

Since in 2016 Luca has decided to merge his combo with my big patch, he is giving his personal contribution to it. He fixed many bugs and added new important patches and functionalities, often writing himself the code. The script shared here is just the last one and it's quite surprising (at least for me) to observe how many things are performed putting together just 20 lines.

Slackware guest on Linux-Vserver

July 5, 2016 Roberto Puzzanghera 4 comments

Linux-Vserver is an open source software which acts as a virtual private server implementation done by adding operating system-level virtualization capabilities to the Linux kernel.