Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a dedicated server with exim on it. I also have a regular shared hosting account ("sharedhostingdomain.com") on hostgator. I want to configure exim to always use hostgator's smtp server ("mail.sharedhostingdomain.com") for email delivery.

The problem is that hostgator's smtp server is obviously requiring authentication and it's on a different port (26). Since I do have legitimate account, I do have access credentials, but I don't know how to force exim to always use that SMTP server instead of trying to connect to the receipient's smtp server directly and where to specify those access credentials.

share|improve this question

2 Answers 2

As Daniel says, you need to configure exim as a smarthost. This means defining a router like this (N.B. the double colon separating the hostname and the port number):

send_to_smarthost:
  debug_print = "R: smarthost for $local_part@$domain"
  driver = manualroute
  domains = ! +local_domains
  transport = remote_smtp_smarthost
  route_list = * smarthost.example.com::26
  host_find_failed = defer
  no_more

and then a transport that can prod exim into authentication:

remote_smtp_smarthost:
  debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  driver = smtp
  hosts_require_auth = smarthost.example.com

For a lot of distributions, you can now just put your host:username:password triplet into /etc/exim/passwd.client and this should just work.

I believe that instead of specifying the port in the router, you can use the port command in the transport. In theory, both should work.

share|improve this answer

It's been a while since I've done anything interested with exim configs, but I can give you some basic pointers. This will also depend on which version of exim you are running, and which distro as well (eg, debian has a meta-config configuration file, which abstracts a lot of this for you).

Basically, you'll want to configure exim with a smarthost, set to hostgator's SMTP server. (This used to be called a "router" in exim-talk, I think it still is).

The transport that your router is configured with will need to be told to use port 26, not port 25. (There is a "port" variable you can set)

You'll also need to setup exim client authentication (eg, check here for the bit on "Authentication by an exim client"

Sorry I can't be more specific than that, but hopefully this is enough to get you on your way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.