Exim send and receive mail under specific IP address

Spark

Verified User
Joined
Aug 25, 2006
Messages
109
In order to make exim listen on a specific IP address you must add the following line to exim.conf:
local_interfaces = 127.0.0.1 : IP Address

this works to make exim listen only at this IP address but it will still send mail over the servers primary IP address.

So find the remote smtp driver and make it look like this:
remote_smtp:
driver = smtp
interface = IP Address


the smtp driver needs the interface added as well in order to make it send mail out over your new IP address
 
Are you saying, that with this change to Exim, if setup properly and a person sends email from the account [email protected] that the mail would look like it came from mail.domain1.com instead of hostname.primarydomain.com? Likewise, if a user sends the mail from [email protected] that the mail would look like it came from mail.domain2.com? If so, I really like this because then resellers would not see the mail routed through the machine name, which would give away the fact that the reseller is not hostng mail on their own domain.
 
Actually no this solution does not provide that functionality, what this does is just change the IP address that exim uses to send and receive email.


I do know of a solution that does what you are asking and that is what I had started to talk about in another thread. But with your reply about the reverse PTR and A records having to match in order to prevent outgoing mail from ending up in spam boxes makes it kind of pointless unless you are prepared to change the reverse DNS for every single customer.


I will start another thread that coveres that but not tonight
 
I do know of a solution that does what you are asking and that is what I had started to talk about in another thread. But with your reply about the reverse PTR and A records having to match in order to prevent outgoing mail from ending up in spam boxes makes it kind of pointless unless you are prepared to change the reverse DNS for every single customer.
See my reply in your other thread about what has to match between A and PTR records for email to be accepted.

You shouldn't have more than one PTR record for any domain, since RFCs do not define what resolvers should do when they find more than one PTR record, and different resolvers handle it different ways, probably none in the way you'd expect, which would be to look for an exact match with an A records search from a different call to the same resolver.

Jeff
 
Jeff again you are way off base, You are looking at this all wrong and misunderstanding. I cannot get any more clear than I already have but to try and ask you to quit trying to associate the customer's domain who is sending the email with this because it has nothing to do with it.
 
Sorry to ressurect an old topic ...

This works GREAT, but I've got a question

Does anyone know if you can have TWO lines
interface = IP Address1
interface = IP Address2

??

The reason I'm asking is because the named records have the IP hardcoded into them - and I can't figure out a perl -pi -e replacement script to handle the records with the tabs - so I want to change only SELECTED domains to use one of the ip's - and all the others to use the other.

Ideally, I'd like to rewrite the named.db records with that ONE IP - but I can't figure that out - if anyone's got an idea on that, I'm all ears.
 
Never mind, answered my own question

"interface" option set for the second time

Ok, anyone got any ideas on a perl replacement command for that line - or another way to globally edit all .db records?
 
Never mind, answered my own question



Ok, anyone got any ideas on a perl replacement command for that line - or another way to globally edit all .db records?

I would like to know how to do this too.

Also would the aforementioned exim.conf directive work for an external IP?
 
I just wanted add something I found useful:

After setting the outgoing interface for exim with the 'interface' addition:

Code:
remote_smtp:
  driver = smtp
  [B]interface = new.ip.add.res[/B]

I also changed all the existing spf records with this (make sure that your only occurence of the old IP is in the SPF first!!):
Code:
cd /var/named
perl -pi -e 's/old.ip.add.res/new.ip.add.res/' *.db

Then I modified the DirectAdmin default template for new domains:
Code:
cd /usr/local/directadmin/data/templates/custom
cp ../dns_txt.conf .
perl -pi -e 's/\|SERVER_IP\|/new.ip.add.res/' dns_txt.conf

Now, exim sends messages out on a public IP address, not my server-license IP address, and all domains (including newly-added ones) will have the correct SPF records.

GMail has a 'Show Original' optionwhen reading message (upper-left corner of message is a drop-down arrow) which shows you the detailed message information and routing. It also shows you how gmail rates the spf:

Received-SPF: pass (google.com: domain of [email protected] designates new.ip.add.res as permitted sender) client-ip=new.ip.add.ress;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates new.ip.add.ress as permitted sender) [email protected]
 
Back
Top