RESOLUTION
You can download Qmail sources, for example from http://qmail.org/, apply Plesk patches which are attached to this article, apply your own patches and compile Qmail. Here the steps that should be done:- 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 that Plesk 8.3.x qmail patches should be applied in alphabetical order, for Plesk 8.2 and below 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 - 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 inot these files (note that these commands should be ran on system where qmail is already installed):
# grep -E '^(qmail|alias)' /etc/passwd | awk 'BEGIN {FS=":"; OFS=" ";} {if ($1 == "qmail") {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 - configure linker flags (inside qmail src directory after patches applied):
# pkg-config --libs openssl > ssl.lib
# echo "/var/qmail" > conf-qmail Now you can run 'make'.