Bug#309792: exim4-config: Rewriting via /etc/email-addresses should be configurable to apply to only non-local mail.

Steven E. Harris "Steven E. Harris" <seh@panix.com>, 309792@bugs.debian.org
Thu, 19 May 2005 08:11:22 -0700


Package: exim4-config
Version: 4.50-6
Severity: normal

At present exim applies the /etc/email-addresses rewriting mechanism
to all mail sent through the MTA. This causes interference with a
setup that permits both local exchange of mail among local users and
mail sent out to remote destinations either by the remote_smtp or
remote_smtp_smarthost transports.

Note that in the configuration captured in this report represents a
smarthost setup. Any mail not destined for a local user must be sent
out through the designated smarthost. I have another computer that can
make direct SMTP connections to non-local hosts and hence does not use
the smarthost setup, but it suffers the same problem reported here.

When I send a message out from my computer to a remote recipient, I
want any mention of my local user name and host replaced with my
externally-visible email address; I have this mapping defined as
expected in /etc/email-addresses. However, for local mail, I do not
want my From address to be rewritten. The local messages do get
delivered properly, but if the recipient replies without editing the
To address, the message goes out to my externally-visible address
unnecessarily. Also, the rewriting in this case changes the facts: The
local messages look like they came from a remote sender, despite being
sent from a local account.

Supporting this rewrite-only-for-non-local scheme requires that the
/etc/email-addresses rewrite rule be moved to the transport's
"headers_rewrite" entry, as suggested in the Exim FAQ (Q0803). I use
this technique in an older hand-crafted exim.conf on Cygwin and it
works as desired. I'm just surprised to see that the Debian
exim4-config package doesn't offer this choice.

There is an optional facility offered now to mask the local host name
with an alternate "visible" host name. When selected, this option adds
a headers_rewrite entry to the remote_smtp* transports. This option
does not support my scheme; my computer is not visible externally and
is not meant to receive non-local messages directly.

Though I can't provide a patch today for the debconf mechanism, I can
at least sketch some proposed changes.

  o For setups that permit non-local outbound mail, ask the user
    whether he wants per-user rewriting (via /etc/email/addresses),
    global rewriting (the current "visible host" option), or no
    rewriting.
  o If either of the first two rewriting options are chosen above,
    place an appropriate headers_rewrite entry in each of the
    remote_smtp* transports.
  o Remove the current global /etc/email-addresses rewrite rule.

I found mention of a similar proposal in Bug 229911, but the
submitter's proposal to limit the /etc/email-addresses rewriting was
not properly addressed in the discussion that followed.


-- Package-specific info:
Exim version 4.50 #1 built 17-Apr-2005 19:12:46
Copyright (c) University of Cambridge 2004
Berkeley DB: Sleepycat Software: Berkeley DB 4.2.52: (December  3, 2003)
Support for: iconv() IPv6 GnuTLS
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configuration file is /var/lib/exim4/config.autogenerated
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'

dc_eximconfig_configtype='smarthost'
dc_other_hostnames='debutant.sehlabs.com'
dc_local_interfaces='127.0.0.1'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='mail.panix.com'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_readhost=''
mailname:localhost.localdomain

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages exim4-config depends on:
ii  adduser                       3.63       Add and remove users and groups
ii  debconf [debconf-2.0]         1.4.49     Debian configuration management sy
ii  passwd                        1:4.0.3-34 change and administer password and

-- debconf information:
  exim4/dc_noalias_regenerate: false
* exim4/dc_smarthost: mail.panix.com
  exim4/dc_relay_domains:
* exim4/dc_relay_nets:
* exim4/mailname: localhost.localdomain
* exim4/dc_local_interfaces: 127.0.0.1
* exim4/dc_minimaldns: false
  exim4/exim3_upgrade: true
* exim4/dc_other_hostnames: debutant.sehlabs.com
* exim4/dc_eximconfig_configtype: mail sent by smarthost; received via SMTP or fetchmail
  exim4/no_config: true
* exim4/hide_mailname: false
* exim4/dc_postmaster: seh
* exim4/dc_readhost:
* exim4/use_split_config: true
  exim4/exim4-config-title: