Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server running Plesk 8 and qmail as the MTA.

Now I switched one domain from multiple POP accounts to only one catchall because the mail app at the customers side (Tobit David) has the ability to deliver the mails to the right user by reading a specific header field (can be configured by the admin - that's me ;)

Most MTA's add the original recipient to the header already (mostly the field is called X-Delivered-To) and pleak does this, too. The field is called `Deliviered-To´.

However, there is on problem. Let's say I have a user called John Doe with the email address In the mail header the Deliviered-To field does not contain but

I believe that has something to do with the customer or domain I created in Plesk, since that number is unique for all recipients from this domain, but different for other domains.

Is there a way to tell qmail to add another header value with the original recipient? Or modify the current value of Deliviered-To?

share|improve this question
up vote 1 down vote accepted

Fixed! I found this link where someone had exactly the same problem:

Quick solution

  • Create the folder /usr/local/psa/handlers/user-handlers/
  • Create a file /usr/local/psa/handlers/user-handlers/xdeliveredto with this content

     echo "X-Delivered-To: ${3}"
  • Make it executable chmod +x /usr/local/psa/handlers/user-handlers/xdeliveredto

  • Register this file as a handler in plesk

    /usr/local/psa/admin/sbin/mailmng \
         --add-handler --handler-name xdeliveredto --handler-type global \
         --executable /usr/local/psa/handlers/user-handlers/xdeliveredto \
         --context xdeliveredto --hook before-local --priority 30
  • ???

  • Profit!
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.