[Bug 1094984] [NEW] /etc/aliases does not work (dpkg-reconfigure error)

Jarno Pelkonen jarno.pelkonen at iki.fi
Tue Jan 1 04:34:13 UTC 2013

Public bug reported:

## Bug Summary:
Mail send from the localhost to "root" will not follow /etc/aliases in smarthost config due to "dpkg-reconfigure exim4-config" error. 

(solution provided in the end)

## Setting: exim4 (4.76-3ubuntu3.1) configured as smarthost without local mail delivery.
// installed packages
root at hostX (0)# dpkg-query -l 'exim4*'                                                                 /etc
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version               Description
ii  exim4                 4.76-3ubuntu3.1       metapackage to ease Exim MTA (v4) installation
ii  exim4-base            4.76-3ubuntu3.1       support files for all Exim MTA (v4) packages
ii  exim4-config          4.76-3ubuntu3.1       configuration for the Exim MTA (v4)
un  exim4-config-2        <none>                (no description available)
un  exim4-daemon-custom   <none>                (no description available)
un  exim4-daemon-heavy    <none>                (no description available)
ii  exim4-daemon-light    4.76-3ubuntu3.1       lightweight Exim MTA (v4) daemon
un  exim4-doc-html        <none>                (no description available)
un  exim4-doc-info        <none>                (no description available)
un  exim4-localscanapi-1. <none>                (no description available)
un  exim4-localscanapi-1. <none>                (no description available)

// dpkg-reconfigure exim4-config (relevant ones)
mail server configuration type: "mail sent by smarthost; no local mail"
mail name: "hostX.domainY"     ## same as ´hostname -A´
Other destinations for which mail is accepted: "hostX.domainZ;hostX.domainA"

// nano /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
root: me at example.org

/ /etc/exim4/passwd.client
The user account used for mail transport is different from me at example.org (something at gmail.com in my case)

## Bug:
mail send from the host to "root" will never go to "me at example.org" regardless of /etc/aliases config

## Root cause:
dpkg-reconfigure exim4-config does not add "mailname" ("hostX.domainY") into "MAIN_LOCAL_DOMAINS". This causes exim4 to skip /etc/aliases since "root" is automatically expanded to "root at hostX.domainY" which is not identified as local address due to "hostX.domainY" missing from "MAIN_LOCAL_DOMAINS"

// less /var/lib/exim4/config.autogenerated

MAIN_LOCAL_DOMAINS=@:localhost:hostX.domainZ:hostX.domainA  ("mail name" "hostX.domainY" is missing!)

FYI: "@" denotes hostname without domain part

## Solution

1) Automatically add "mail name" ("hostX.domainY" in this example) into
MAIN_LOCAL_DOMAINS in dpkg-reconfigure

2) Change the text in dpkg-reconfigure to explain that for some reason
(???) user needs to re-type "mail name" (hostname -A) into the field.
The current text misleadingly mentions only "_other_ destinations".

PS. It seems the issue has been here long:

** Affects: exim4 (Ubuntu)
     Importance: Undecided
         Status: New

You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to exim4 in Ubuntu.

  /etc/aliases does not work (dpkg-reconfigure error)

To manage notifications about this bug go to:

More information about the Ubuntu-server-bugs mailing list