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

Article ID: 1161 
Last Review: Oct,7 2008
Author: Bezborodova Anastasiya APPLIES TO:
  • Plesk 8.x for Linux/Unix

Resolution

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:

  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 arealy 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 owerwrite 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.

Attachments:



Subscription for this article changesSubscription for this article changes

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields