how to setup cpanel to send email for a domain off the IP that is setup for it

mattjustin

Registered
Jun 1, 2011
3
0
51
how do I setup cpanel to send email for a domain off the IP that is setup for it?

Ive searched for this solution but it seems that there are older posts relating to this and they dont seem to work for new versions of cpanel.

Im running WHM 11.30.0 (build 23) CENTOS 5.6 x86_64

I have a class c assigned to my box and have multiple urls setup.

Im trying to configure outbound mail to go out on the IP that is configured for that url and or additional specific IP's instead of going out main ip (eth0). The headers print the main ulr and eth0 which is incorrect as its setup for multiple clients.

thanks
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please note that scripts will still send out using the main IP for the machine if you are using sendmail or the PHP mail() function. To have the script use the dedicated IP once you have checked the Exim Configuration Editor options that follow, you need to use SMTP authentication in the script rather than sendmail or PHP mail() function. Here are the options you would check in WHM > Exim Configuration Editor to have the dedicated IPs automatically used:

** Send mail from account’s dedicated IP [?]
Automatically send outgoing mail from the account’s IP address instead of the main IP address. Warning: If you turn this setting on, make sure that reverse DNS entries match the ones in /etc/mail_reverse_dns.

** Reference /etc/mailhelo for outgoing SMTP HELO [?]
Send HELO based on the domain name in /etc/mailhelo (more information)

** Reference /etc/mailips for outgoing SMTP connections [?]
Send outgoing mail from the IP that matches the domain name in /etc/mailips (more information)
 

blogbytes

Member
Jul 11, 2011
13
0
51
Hello,

I am facing the same issue. What do I need to select exactly to send mail from the domains dedicated ip and to use the dedicated IP helo?

View attachement, if i select Send mail from account’s dedicated IP. the other 2 parts get greyed out and I am unable to select them.

My second question is, I have a clients crm tool setup on our main server. His email gets relayed through another server, smtp settings are all correct and setup, however, I have noticed that the main server still gets referenced in the email header. View header below.

Code:
Received: from smtp.secondary.server ([xx.xxx.xx.xx])
	by receiving.server with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.69)
	(envelope-from <[email protected]>)
	id 1QgBS1-0002Yi-D1
	for email.email.com; Mon, 11 Jul 2011 10:02:46 +0200
Received: from main.server ([xxx.xx.xxx.xx] helo=domain.crm.runs.on)
	by smtp.secondary.server with esmtpa (Exim 4.69)
	(envelope-from <[email protected]>)
	id 1QgBRy-0007oJ-LV
	for email.email.com; Mon, 11 Jul 2011 10:02:42 +0200
How can I remove this part?
Code:
Received: from main.server ([xxx.xx.xxx.xx] helo=domain.crm.runs.on)
	by smtp.secondary.server with esmtpa (Exim 4.69)
	(envelope-from <[email protected]>)
	id 1QgBRy-0007oJ-LV
	for email.email.com; Mon, 11 Jul 2011 10:02:42 +0200

Thanks
 

Attachments

blogbytes

Member
Jul 11, 2011
13
0
51
For anybody that needs to remove the main header when relaying to an external smtp

add this to your exim.conf just below driver = smtp "headers_remove = Received"

will look like this:
Code:
remote_smtp:
  driver = smtp
headers_remove = Received
  interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
  helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
 

stunn3r

Registered
Jun 21, 2009
1
0
51
Re: how to setup cpanel to send email for a domain off the IP that is setup

Thanks blogbytes!!

It worked for me. similarly can we remove other header attributes?

Best Regards,
 

storminternet

Well-Known Member
Nov 2, 2011
460
0
66
cPanel Access Level
Root Administrator
Re: how to setup cpanel to send email for a domain off the IP that is setup

Thanks blogbytes!!

It worked for me. similarly can we remove other header attributes?

Best Regards,
You should be aware about the changes you are going to make in exim.conf else it will corrupt the configuration causing email problem.

For anybody that needs to remove the main header when relaying to an external smtp

add this to your exim.conf just below driver = smtp "headers_remove = Received"
Thanks blogbytes!!