Question About Mail Headers (hostname and IP)?

tdd1984

Member
Jul 9, 2010
8
0
51
I'm just curious how do some people get their headers to output a unique host name and the current IP assigned to that domain name. We have 7 IP's and 7 domain names each IP goes into each domain (uniquely). When we send out mail, our default hostname and IP shows. How do we get a unique hostname and unique IP (that is assigned to that domain) to show instead?

Our main server IP shows in the originating IP section of the mail headers, not the domain IP?
 

Miraenda

Well-Known Member
Jul 28, 2004
243
6
168
Coralville, Iowa USA
cPanel Access Level
Root Administrator
Here are the steps to setup what you are wanting to do based on a tutorial I have done on my forum:

1. WHM > Exim Configuration Editor

2. If you want all domains with dedicated IPs to use those IPs, you'd select:

Code:
Automatically send outgoing mail from the account's IP address instead of
the main IP address. Warning: If you turn this setting on you should make
sure reverse  DNS entries match the ones in /etc/mail_reverse_dns. [?]
If you only want select domains to send using their own IP, you'd instead select:

Code:
Send HELO based on the domain name in /etc/mailhelo (*:
HELONAME can be added to the file to change the default helo name) [?]
 
Send outgoing mail from the ip that matches the domain name in /etc/mailips (*:
IP can be added to the file to change the main outgoing interface) [?]
3. Make sure that /etc/mailips has the information for the domains and IPs. File should look like this:

Code:
domain.com: IP1
seconddomain.com: IP2
4. Make sure that /etc/mailhelo file exists and has this type of info in it:

Code:
domain.com: domain.com
seconddomain.com: seconddomain.com
Subdomains will need to have the main domain as the mailhelo as you cannot have multiple mailhelo for the same IP.

5. Check that /etc/mail_reverse_dns exists and has the reverse DNS (PTR) for that dedicated IP. It likely will not exist and will need to be manually configured. This should ideally be the same as the mailhelo response.

Code:
IP1: domain.com
IP2: seconddomain.com
6. After setting all of this up, then send a test from the dedicated IP domain email to [email protected] to see the mailhelo response from that domain with the dedicated IP. Of note, you cannot telnet on the IP to get that response as a telnet on port 25 will instead return the server's hostname. The mailhelo name is not the same as the hostname when you've reconfigured exim to use the /etc/mailhelo file.

An example for the [email protected] test:

Code:
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [email protected]
    SMTP error from remote mail server after RCPT
TO:<[email protected]>:
    host mail-in.cbl.abuseat.org [82.94.216.251]:
    550 HELO for IP 1.1.1.2 was "cookiesonfriday.com"

------ This is a copy of the message, including all the headers. ------

Return-path: <[email protected]>
Received: from localhost ([127.0.0.1])
    by sdc232.thisworldtoday.com with esmtpa (Exim 4.69)
    (envelope-from <[email protected]>)
    id 1NDSR4-0008Te-HO
    for [email protected]; Wed, 25 Nov 2009 17:42:14 -0700
Received: from 1.1.1.2 ([1.1.1.2]) by 173.213.105.2 (Horde MIME
    library) with HTTP; Wed, 25 Nov 2009 17:42:14 -0700
Message-ID: <[email protected]>
Date: Wed, 25 Nov 2009 17:42:14 -0700
From: [email protected]
To: [email protected]
Subject: testing
MIME-Version: 1.0
Content-Type: text/plain;
    charset=ISO-8859-1;
    DelSp="Yes";
    format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.1.6)

testing
Here is the applicable line:

Code:
550 HELO for IP 1.1.1.2 was "cookiesonfriday.com"
This shows that the mailhelo is returning the actual entry for /etc/mailhelo rather than the main server IP if it is setup properly.

Please note that the above will only send using the dedicated IP for normal email sent by SMTP authentication. Email scripts using sendmail and forwarders will still use the main shared IP even on these dedicated IP domains to send emails.
 

R-n-R

Registered
Jan 13, 2009
3
0
51
Anyone know if cPanel is working on this as a standard feature on cPanel?

I also have some InterWorx Control Panel servers and this is a very nice feature that InterWorx has, set via NodeWorx (similar to WHM) to allow all SiteWorx (similar to cPanel) accounts to send emails using their dedicated IP.

Hopefully this will be added to WHM/cPanel in the coming months.