November 7, 2011

Plesk Qmail Error 5.4.6

I recently ran into a strange problem with Plesk 9.3 and Qmail. After completing the install of a new Plesk server I initiated migrations of production sites to it. Post migration the sites and email functioned normally for around 22 hours until suddenly all inbound email to the server bounced with the following error:

Nov 6 05:50:29 vh1 qmail-[27612]: Handlers Filter before-remote for qmail started ...
Nov 6 05:50:29 vh1 qmail-[27612]: [email protected]
Nov 6 05:50:29 vh1 qmail-[27612]: [email protected]
Nov 6 05:50:29 vh1 qmail-[27612]: hook_dir = '/usr/local/psa/handlers/before-remote'
Nov 6 05:50:29 vh1 qmail-[27612]: recipient[3] = '[email protected]'
Nov 6 05:50:29 vh1 qmail-[27612]: handlers dir = '/usr/local/psa/handlers/before-remote/recipient/[email protected]'
Nov 6 05:50:29 vh1 qmail: 1320533429.707838 delivery 233: failure: Sorry._Although_I'm_listed_as_a_best preference_MX_or_A_for_that_host,/it_isn't_in_my_control/locals_file,_so_I_don't_treat_it_as_local._(#5.4.6)/

The problem could be resolved by simply restarting Qmail but then the issue re-occured 22 hours later, immediately after nightly backups.

Parallels notes a fix for the problem at: http://kb.parallels.com/en/1380 but after running /usr/local/psa/admin/sbin/mchk then waiting 22 hours, the problem re-occurred.

After much research I found a Hotfix for “Mail service does not function after suspend/unsuspend domain or backup task with domain suspension” at: http://kb.parallels.com/7019. The Hotfix is for Plesk versions 9.2, 9.3 and 9.5 and resolves the issue with mail delivery errors after a domain is suspended then un-suspended during the backup process.

You can quickly apply the hotfix, as follows:

# wget http://kb.parallels.com/Attachments/11691/Attachments/class.Domain.zip
# unzip class.Domain.zip
# mv /usr/local/psa/admin/plib/class.Domain.php /usr/local/psa/admin/plib/class.Domain.php.bak
# mv class.Domain.php /usr/local/psa/admin/plib/class.Domain.php
# chown root:psaadm /usr/local/psa/admin/plib/class.Domain.php
# chmod 644 /usr/local/psa/admin/plib/class.Domain.php

Problem solved!