redirect email to another server, other than mx record

On the EHCP server, we have, we are ONLY performing web hosting, no mail.
Inside we have a file called email_form.php
This page sends an email to The EHCP is set up to receive ANY mail that is sent to it. Meaning the web-site will also send its mail to the local host to be processed, if the local host CAN accept mail for, it will.

It is kinda hard to explain.

The mail generated from the web form is sent to the local mailer to be processed (sent out). If the local mailer, IS postfix, and postfix can accept mail for the domain sending the mail, then it will search for the email address located inside the virtual mailbox. IF the virtual mailbox (or email address) doesn't exist then postfix bounces it, back to the sender, and the sender IS the local domain name email address.

[WEb Server] [ email server]
hosts host
(has postfix) (has postfix)

if the web server sends email to, then the web-server will accept the mail for
A DNS request is never performed.

I hope this makes some sense.

On Mon, Jun 4, 2012 at 9:37 AM, wrote:

You say, "EHCP server WILL NOT accept any mail that is destined for
the domain names it hosts"
why the mail would arrive at this server, if mx record points to
another server ?
I mean, If you set mx record point to another server, the email should
never arrive at this ehcp server...

what you think ?

On Mon, Jun 4, 2012 at 4:32 PM, David wrote:
> No worries, on the relay, I got it to work. So this might help someone else,
> if you want to post it.
> To set up a successful relay, so that EHCP will NOT accept email destinted
> to a domain name it is hosting, perform these step.
> 1) Create a sasl_password file.
> sudo touch /etc/postfix/sasl_password
> 2) Edit /etc/postfix/sasl_password
> sudo vim /etc/postfix/sasl_password
> 3) Insert your username and password
> SMTP.DOMAIN.COM username_or_email-address:password
> 4) Now you have to make the file so that postfix can read it. - this will
> create a dot db file
> sudo postmap /etc/postfix/sasl_password
> 5) Edit the postfix configuration file.
> sudo vim /etc/postfix/
> On like 37 I have added these two lines
> smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
> relayhost = [YOUR_SMTP_HOST]:25
> Around line 51 comment out the two lines
> virtual_mailbox_domains = proxy:mysql:/etc/postfix/
> virtual_mailbox_maps = proxy:mysql:/etc/postfix/
> 6) Restart the postfix server
> sudo /etc/init.d/postfix restart
> You should NOW have a successful relay setup. Your EHCP server WILL NOT
> accept any mail that is destined for the domain names it hosts. This is very
> useful, if you use seperate EHCP server to host domain names. IE, 1 server
> for mail and 1 server for web.
> ---[ END ]---
> Correct me if I am wrong, I believe the multi-server structure would also
> correct this, when implementated.