1

Asked this on StackOverflow (https://stackoverflow.com/questions/1655281/exim4-nonstandard-ports) but someone pointed out it belongs here.

I am trying to use exim4 on debian to relay mail, nothing more. I have a stage mail server and a production mail server (both written custom in python to do weird stuff). I also have all these running on a single linode host.

production mail is on port 2500, stage mail is running on port 2501. I'd like exim to relay mail based on the target domain to these nonstandard ports. I can easily get it to recognize the domain, but I can't seem to find any info on how to add port information to the configuration.

1 Answer 1

3

In the remote_smtp transport, add:

  port = ${lookup{$sender_address_domain}lsearch{/etc/exim/domain_port_mapping}{$value}{25}}

And then put your domain to port mappings into /etc/exim/domain_port_mapping as a regular lsearch list:

example.com    2500
staging.example.com    2501
4
  • Thanks. I'm still getting unroutable address in the logs. Do I need any special configuration for the relay?
    – dave paola
    Nov 2, 2009 at 18:45
  • That is the special configuration for the "relay" -- as in, the machine that receives mail on the regular port and then forwards to the alternate port. That config worked for me when I needed to do this. Now, of course, I just run Postfix and use a transport map, no special configuration required.
    – womble
    Nov 2, 2009 at 19:23
  • Just a note: $sender_address_domain is just $domain. Not sure if this is an exim4-specific thing, but took me quite awhile to figure out that's why it wasn't working :-)
    – dave paola
    Nov 3, 2009 at 7:31
  • Aaah, target domain. Misread.
    – womble
    Nov 3, 2009 at 9:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .