Setting outgoing IP address for domain in exim4

Thanks to Dave Evans on the exim4 users list for this.

I need to set different IP addresses for different outgoing domains.

Since I only have a few - we took a simple approach

/etc/exim4/interfaces

has lines of the form

domain: ip
domain: ip
domain: ip

Then - in /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp (or wherever your definition of remote_smtp transport is) add the following to the remote_smtp transport:

interface = ${lookup{$sender_address_domain}lsearch{/etc/exim4/interfaces}{$value}{default_ip_in_case_no_match}}

Technorati Tags:

Reply

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <pre> <hr>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • Replace [debbug:xxxxx] with a link to the relevant debian bug.
  • Images can be added to this post.
  • You can link nodes to other nodes using the following syntax:
    [node:node_id,title="val2"]
  • You may link to Gallery2 items on this site using a special syntax.
  • Insert Google Map macro.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

worried