Configuring Name based VDSs that have an external MX record.
Before you configure your Name based VDS with an external MX record,check that you are using an external MX using the following command:
Dig [Domain] MX
If the output displays a different IP for the MX, this domain uses an external MX records and you can proceed with the procedure, otherwise this procedure is not necessary.
The following procedurewill work for perl script as well as php scripts:
1. su - VDS_name
2. backup /etc/mail/sendmail.mc
3. vi /etc/mail/sendmail.mc
4. append the following line: define(`MAIL_HUB', `vds.com.')
**Please note that "vds.com." is the value returned by VDS's hostname (i.e. the A record of the VDS that has also a different MX record). (DO NOT FORGET THE TRAILING '.' in the vds.com.).
5. compile sendmail.mc:
/bin/m4 / /usr/share/sendmail/sendmail.cf/m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
***Please backup files before modifiying them***