Redirecting E-mail to Non-local Addresses With 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 (later also 8.6), 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:
- Say we are need a mail for blue.dot@domain.org where domain.org is set up as a domain alias in Plesk.
- Make sure the Mail function for domain.org is switched on in your Plesk.
- Connect to your server's terminal, e.g. using Putty and log in as root and type:
nano /var/qmail/control/virtualdomains
- You will see there is a line similar to
domain.org:X
where 'X' is some number. - Change that line to:
domain.org:alias-domainorg
where 'domainorg' uniquely characterizes this virtual domain. - Restart qmail by e.g.:
service qmail restart
cd /var/qmail/alias/
- Now you need to create the following redirect file:
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 by http://lifewithqmail.org.
Related links- https://www.linuxjournal.com/article/2313
- http://lifewithqmail.org/
- https://en.wikipedia.org/wiki/Qmail
ENGLISH ARTICLEOCTOBER 20, 2018 AT 01:46:40 UTC