Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to set up Exim4 on Debian as an authenticated smart host, which behaves not terribly different from gmail (or google apps).

I want it to accept mail via TLS, require username and password credentials, and always rewrite the sender as the authenticated user.

share|improve this question
up vote 1 down vote accepted

You will need to:

1.Setup a working Exim server

2.Setup authentication (eg cram_md5) (see section 35.1 of the manual)

begin authenticators
    driver = cram_md5
    public_name = CRAM-MD5
    server_secret = ${lookup{$1}lsearch{CONFDIR/crammd5.config}{$value}fail}
    server_set_id = $1

3.Set the server to require tls (see section 38.1 of the manual)

auth_over_tls_hosts = *

4.Configure sender rewriting (section 34.10 of the manual, examples from same)

*@*  $
*    ${lookup{$1}dbm{/etc/realnames}\
                     {$value}fail} bctfrF

There is a useful guide here to rewriting. Note that rewriting is often frowned upon as the reasons for rewriting are often nefarious.

You can test rewriting with exim -brw <test_address>.

share|improve this answer

Your Answer


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.