Re: [exim] Exim4 smarthost configuration help (debian)

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Gianluca Varenni
CC: exim-users
Subject: Re: [exim] Exim4 smarthost configuration help (debian)
On 2008-01-08 at 23:23 -0800, Gianluca Varenni wrote:
> First of all, let me start saying that I'm a total nb as far as mail server
> administration is concerned (it's not my primary job).
>
> I have a linux machine (pallino.cace.local) on the internal network, behind
> a NAT.


You also have a Debian Exim configuration, which is so very different
from normal (with good reason!) that the folks on exim-users don't
normally help with it:

http://pkg-exim4.alioth.debian.org/

That has pointers to Debian-specific information, including a
Debian-specific Exim mailing-list.

A friend's Debian machine has: /usr/share/doc/exim4/README.Debian.gz
Note that everything in your configuration is Debian-specific. Not one
line of it looks like general Exim config. Sorry.

> I want to configure exim4
> - not to manage any local mailbox for the users on pallino.cace.local
> - to forward all the messages directed to the local users to an external
> SMTP server (mail.cacetech.com) external to the network
> - to rewrite the local recipients and local sender with the addresses in
> /etc/email-addresses (e.g. root: gianluca.varenni@???)
>
> I configured exim4 as smarthost, forwarding the emails to
> mail.cacetech.com. That works perfectly, including TLS authentication, i.e.
> if I run "echo foo | mail -s test foo@???" the mail gets sent
> correctly.
>
> The problem. The sender address gets rewritten properly (root -->
> gianluca.varenni@???), the local recipient don't get rewritten
> properly.


The relevant Exim rewrite rule needs the 'T' flag; see:
31.8 Flags specifying which headers and envelope addresses to rewrite
in The Exim Specification; Debian provide this as the file:
/usr/share/doc/exim4/spec.txt.gz

> So if I run "echo foo | mail -s test gianlucav" the mail gets sent to
> gianlucav@??? (instead of gianluca.varenni@???)
>
> The update-exim4.conf.conf file is the following one
>
> # /etc/exim4/update-exim4.conf.conf
> #
> # This is a Debian specific file
>
> dc_eximconfig_configtype='satellite'
> dc_other_hostnames='cace.local'
> dc_local_interfaces='127.0.0.1'
> dc_readhost='cacetech.com'
> dc_relay_domains=''
> dc_minimaldns='false'
> dc_relay_nets=''
> dc_smarthost='mail.cacetech.com'
> CFILEMODE='644'
> dc_use_split_config='false'
> dc_hide_mailname='true'
> dc_mailname_in_oh='true'
> dc_localdelivery='mail_spool'
>
> email-addresses is the following one
>
> # This is /etc/email-addresses. It is part of the exim package
> #
> root: gianluca.varenni@???
> gianlucav: gianluca.varenni@???
>
> Can you point me in the right direction? I looked around for some easy
> guide on it, but I couldn't find anything useful (maybe I'm just blind)?


All of your config file is made up of Debian-specific hooks. Whilst
someone on the exim-users list might be able to help, you'll probably
get a faster and better response from the Debian-specific mailing-list:
http://lists.alioth.debian.org/mailman/listinfo/pkg-exim4-users

It looks as though the unclean quick hack to get it working would be to
edit /etc/exim4/conf.d/rewrite/31_exim4-config_rewriting to add the 'T'
flag to the 'Ffrs' set and do whatever it is Debian needs to rebuild the
config. That looks like the sort of change that will break with the
next update though.

You might be able to copy the relevant line into another config file in
that directory, replacing 'Ffrs' with 'T'. Pass.

Ask some Debian folk on pkg-exim4-users how to fix it properly.

Regards,
-Phil