QMail (Considered to be the most secure Mail server out there whose modified version is running on Google – Gmail.com and Mail Yahoo! and Yandex EMail (SMTP) servers, nowadays has been highly neglected and considered obsolete thus most people prefer to use postfix SMTP or EXIM but still if you happen to be running a number of qmail old rack Mail servers (running a bunch of Email addresses and Virtual Domains straight on the filesystem – very handy by the way for administration much better than when you have a Qmail Mail server configured to store its Mailboxes within MySQL / PostgreSQL or other Database server – because simple vpopmail configured to play nice with Qmail and store all user emails directly on Filesystem (though considered more insecure the email correspondence can be easily red, if the server is hacked it is much better managable for a small and mid-sized mailserver) or have inherited them from another sys admin and you wonder how to redirect a single Mailbox:
(under domain lets say domain's email my-server1.com should forward to to SMTP domain my-server-whatever2.com (e.g. firstname.lastname@example.org is supposed to forward to email@example.com).
To achieve it create new file called .qmail
Under the Qmail or VirtualDomain location for example:
root@qmail-server:~# vim /var/qmail/mailnames/myserver1.com/your-email-username/.qmail
!!! NOTE N.B. !!! the last slash / after Maildir (…Maildir/) is important to be there otherwise mail will not get delivered
That's all now send a test email, just to make sure redirection works properly, assuming the .qmail file is created by root, by default the file permissions will be with privileges root:root.
That shouldn't be a problem at all. That's all now enjoy emails being dropped out to the second mail 🙂