Nigel Metheringham edited this page Nov 25, 2012 · 1 revision

Authenticated Outgoing SMTP


This in a situation where you need to use an outgoing mail relay (smarthost) that requires authentication. ISPs sometimes need this, they may block outgoing SMTP to force you to use their MTAs and then require authentication.

Required Software:

  • Exim 4.x

Configuring exim

You will need to configure a router, a transport and the authenticator sections. You will also need to configure a file to contain the password.

In this example, the smarthost is at

Router configuration

Add a router like this:

  driver = manualroute
  domains = ! +local_domains
  transport = IspSmarthost
  route_list = *

Transport configuration

  driver = smtp
  hosts_try_auth = isp_auth

Authenticator configuration

begin authenticators

     driver = cram_md5
     public_name = CRAM-MD5
     client_name = "${extract{auth_name}{${lookup{$host}lsearch{/etc/exim/smtp_users}{$value}fail} }}"
     client_secret = "${extract{auth_pass}{${lookup{$host}lsearch{/etc/exim/smtp_users}{$value}fail} }}"
     driver = plaintext
     public_name = PLAIN
     client_send = "${extract{auth_plain}{${lookup{$host}lsearch{/etc/exim/smtp_users}{$value}fail} }}"

Contents of password lookup file

The file /etc/exim/smtp_users will contain lines like:

isp_auth:     auth_name=my_username   auth_pass=secret        auth_plain=^my_username^secret

You substitute appropriate values for my_username and secret.

See also

CategoryHowTo HowTo

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.