Redirecting e-mail to non-local addresses on qmail

Accumulated, I've spent days trying to solve this problem, so now that I've found a solution I am posting it to help others.

I was setting up Drupal multisites on a CentOS 5 system under Plesk 8.2, and the only practical way to do that in such configuration is to use Plesk's excellent system of domain aliases. The only problem was in current Plesk there is no way of assigning e-mail addresses to alias domains. And I needed them badly, for some of them.

The mail server is qmail, so I studied its manual, and read hundreds of Internet posts related to redirects and aliases in qmail.

This is the solution:

  1. Say we are need a mail for blue.dot@domain.org where domain.org is set up as a domain alias in Plesk.
  2. Make sure the Mail function for domain.org is switched on in your Plesk.
  3. Connect to your server's terminal, e.g. using Putty and log in as root and type:
    Quote:
    nano /var/qmail/control/virtualdomains
  4. You will see there is a line similar to
    Quote:
    domain.org:X
    where 'X' is some number.
  5. Change that line to:
    Quote:
    domain.org:alias-domainorg
    where 'domainorg' uniquely characterizes this virtual domain.
  6. Restart qmail by e.g.:
    Quote:
    service qmail restart
  7. Quote:
    cd /var/qmail/alias/
  8. Now you need to create the following redirect file:
    Quote:
    nano .qmail-domainorg-blue:dot
    (Note that the full stop between 'blue' and 'dot' has become a colon here!)

Note that this is a generic solution valid for qmail redirects to non-local users whether or not one deals with domain aliases.

This solution was inspired by the old but wonderful article http://www.linuxjournal.com/article/2313 and also http://lifewithqmail.org; less so by the otherwise obvious http://www.qmail.org/

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <strike> <caption> <br> <p>
  • Make collapsible text blocks using [collapse] and [/collapse].
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Use <!--pagebreak--> to create page breaks.
  • Web page addresses and e-mail addresses turn into links automatically.
CAPTCHA
Please prove that you are not a robot