Support Center > Knowledgebase > Plesk > Parallels Plesk Panel uses patched Qmail. How do I compile Qmail with my own patches ?
Parallels Plesk Panel uses patched Qmail. How do I compile Qmail with my own patches ?
You should 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: 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
- 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
- Configure linker flags (inside qmail source directory after patches are applied):
- pkg-config --libs openssl > ssl.lib
- echo "/var/qmail" > conf-qmail
- Now you can run `make`,
- 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.:
- cp qmail-queue /var/qmail/bin/qmail-queue
- cp qmail-queue /var/qmail/bin/qmail-queue.origin
- cp qmail-local /var/qmail/bin/qmail-local
- cp qmail-local /var/qmail/bin/qmail-local.origin
- cp qmail-remote /var/qmail/bin/qmail-remote
- cp qmail-remote /var/qmail/bin/qmail-remote.origin
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.:
- cp qmail-queue /var/qmail/bin/qmail-queue.moved
- cp qmail-local /var/qmail/bin/qmail-local.moved
- cp qmail-remote /var/qmail/bin/qmail-remote.moved
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.
- Start xinetd(inetd) service
- Start Qmail and DrWeb services.
Additional information
NOTE: Before starting the recompilation it is recommended to learn original qmail documentation for specification of the recompilation procedure.
Also Read