Add to Favourites Add to Favourites    Print this Article Print this Article

Parallels Plesk Panel uses patched Qmail. How do I compile Qmail with my own patches ?

You should download Qmail sources, for example from, apply Plesk patches which are attached to this article, apply your own patches and compile Qmail. Here the steps that should be done:
  1. Review your custom patches and Plesk patches to find out what custom patch changes and when it should be applied: before Plesk patches or after them or in the middle before/after some specific patch. NOTE: for Plesk 8.3 and above qmail patches should be applied in alphabetical order. For Plesk 8.2 first apply all patch* files, and then fr49-quota-patch, for example:
    • cd qmail-1.03
    • for patch in ../patches/patch* ; do patch -p0 < $patch ; done
    • patch -p0 < ../patches/fr49-quota-patch
  2. Change conf-users and conf-groups files to match changes applied in patch-pe and patch-pf patches. Those files should contain records in format 'groupname GID' or 'username UID'. Below are the commands that will put correct records into these files. NOTE: these commands should be ran on system where qmail is already installed, i.e. where Plesk is already installed.
    • grep -E '^(qmail|alias)' /etc/passwd | awk 'BEGIN {FS=":"; OFS=" ";} {if ($1 == "qmaill") {print $1,$3,"\nroot 0"} else {print $1,$3}}' > conf-users
    • grep -E '^(qmail|nofiles)' /etc/group | awk 'BEGIN {FS=":"; OFS=" ";} {print $1,$3}' > conf-groups
  3. Configure linker flags (inside qmail source directory after patches are applied):
    • pkg-config --libs openssl > ssl.lib
    • echo "/var/qmail" > conf-qmail
  4. Now you can run `make`,
  5. After compilation you should NOT overwrite all existing qmail files with new ones, i.e. do not run `make install`, installed configuration files and init script should remain untouched. Instead, only needed qmail binaries should be replaced with new compiled ones:
    • Stop Qmail and DrWeb services from Plesk panel (not from shell!),
    • Stop xinetd(inetd) service from shell,
    • Replace files according to your Plesk version:
For Plesk 8.2: copy compiled qmail-queue, qmail-remote, qmail-local into Qmail bin/ directory plus make their copies with .origin suffix, f.e.: For Plesk 8.3 and above: copy compiled qmail-queue, qmail-remote, qmail-local into Qmail bin/ directory with .moved suffix (do NOT replace current files!), f.e.: Do not forget to restore original owners/permissions for the files replaced. Because files owners/permissions may differ on different operating systems we cannot provide exact commands. Before replacing the binaries remember original owners/permissions and restore them afterwards. Additional information
NOTE: Before starting the recompilation it is recommended to learn original qmail documentation for specification of the recompilation procedure.

Was this answer helpful?

Also Read