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

I've had a problem sending mail on my server. My host has informed me that it is due to not sending it through their relay. They tried to tell me what to do, here are their instructions:

Edit /etc/mail/sendmail.cf or /etc/sendmail.cf depend on your operating system.

and edit as 

# “Smart” relay host (may be null)
DS<mailserver_hostname>

exam.
DSspamfilter.de.santrex.net:1001

Neither file exists for me, and they're taking forever to respond. I was hoping someone else here might know a solution.

I'm running CentOS5.5 with cPanel/WHM on a VPS

share|improve this question

1 Answer 1

There might be a specific way to do it in cpanel, but provide a general answer for Exim, you need to create a new router that matches all non-local mail. There's already one in the default exim config file called "dnslookup". That router routes all non-local mail to a transport called "remote_smtp" that uses DNS to decide what server to send the mail to.

So, to add a static route to an outbound mail server, add a new router above the existing dnslookup router (because order matters in routers, your mail will be handled by the first one that matches).

Here's an example that, in a simple config (one outbound server only, on port 25, no authentication) should Just Work:

static:
  driver = manualroute
  domains = ! +local_domains
  route_list = * <mailserver_hostname>
  transport = remote_smtp
  no_more
  no_verify

Here's a slightly more complex example from my own config using pobox.com as a relay, on port 587, using authentication:

# This goes in ROUTERS section
static:
  driver = manualroute
  domains = ! +local_domains
  route_list = * sasl.smtp.pobox.com::587
  transport = auth_remote_smtp
  no_more
  no_verify

# This goes in TRANSPORTS section
auth_remote_smtp:
  driver = smtp
  hosts_require_auth = *

# This goes in AUTHENICATORS section
auth_plain:
  driver = plaintext
  public_name = plain
  client_send = ^MYUSERNAME^MYPASSWORD

(pobox only support LOGIN and PLAIN for auth types, but it supports TLS which Exim will use out of the box, so my creds only go over a TLS link).

Here's a log example of mail I sent outbound on that server using the configs above:

2010-11-26 10:04:49 LCHZ81-0000HN-NN <= SENDERADDRESS H=localhost (g3) [127.0.0.1] P=esmtp S=441  
2010-11-26 10:04:50 LCHZ81-0000HN-NN => RECIPADDRESS R=static T=auth_remote_smtp H=sasl.smtp.pobox.com [64.74.157.62] X=TLSv1:DHE-RSA-AES256-SHA:256  
2010-11-26 10:04:50 LCHZ81-0000HN-NN Completed  
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.