To configure Exim under CentOS to send emails through an ISP’s SMTP server follow these steps:
Edit your /etc/exim/exim.conf file
Add to Routers section
send_to_gateway:
driver = manualroute
transport = remote_smtp
route_list = * mail.optusnet.com.au
If your SMTP server requires authentication you also need to do this:
Add to Authentication section
- Enable authentication for hosts host1.example.com, host2.example.net and host3.example.org (you have to list all smarthosts where Exim may authenticate users):
remote_smtp: debug_print = "T: remote_smtp for $local_part@$domain" driver = smtp hosts_try_auth = host1.example.com:host2.example.net:host3.example.org - SMTP-Auth with the name “usera” and the password “secrect” (cram_md5 encrypted):
cram_md5: driver = cram_md5 public_name = CRAM-MD5 client_name = usera client_secret = secrect - SMTP-Auth with the name “usera” and the password “secrect” (plaintext):
plain: driver = plaintext public_name = PLAIN client_send = ^usera^secrect - Or get name, password and send method automatically from my config-file:
cram_md5: driver = cram_md5 public_name = CRAM-MD5 client_name = "${extract{auth_name}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}" client_secret = "${extract{auth_pass}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}" plain: driver = plaintext public_name = PLAIN client_send = "${extract{auth_plain}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
Add to Transports section
remote_smtp:
debug_print = "T: remote_smtp for $local_part@$domain"
driver = smtp
hosts_try_auth = your.smtp.server.com
More information on this topic can be found at http://www.tgunkel.de/docs/exim_smarthosts.en