Mailing List Archive

Alias router only processes first recipient?
I'm running Exim 4.0.4 with this "out-of-the-box" System Aliases router:


system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe

The aliases file looks as it always has:

bin: root
daemon: root
adm: root
lp: root
sync: root
shutdown: root
halt: root
mail: root
news: root
uucp: root

# Person who should get root's mail
root: juha


[etc]

I was testing a new alias, when I noticed that the router only processes
the first recipient in To:, ignoring all the others.

Here's the debug output:

# exim -d -bt webmaster@saarinen.org postmaster@saarinen.org
root@saarinen.org > debug 2>&1

Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (January 24, 2001)
changed uid/gid: forcing real = effective
uid=0 gid=0
auxiliary group list: <none>
trusted user
admin user
originator: uid=0 gid=0 login=root name=root
sender address = root@saarinen.org
Address testing: uid=0 gid=93 euid=0 egid=93
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing webmaster@saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering webmaster@saarinen.org
active address webmaster@saarinen.org
local_part=webmaster domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing webmaster@saarinen.org

--------> dnslookup router <--------
local_part=webmaster domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch



--------> system_aliases router <--------
local_part=webmaster domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
search_find: file="/etc/aliases"
key="webmaster" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="webmaster"
file lookup required for webmaster
in /etc/aliases
lookup yielded: juha
expanded: juha
file is not a filter file
parse_forward_list: juha
extract item: juha
system_aliases router generated juha@saarinen.org
errors_to=NULL transport=NULL
uid=unset gid=unset home=NULL
routed by system_aliases router
envelope to: webmaster@saarinen.org
transport: <none>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering juha@saarinen.org
active address juha@saarinen.org
local_part=juha domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

[That looks OK to me.]


routing juha@saarinen.org
--------> dnslookup router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=juha domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="juha" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="juha"
file lookup required for juha
in /etc/aliases
lookup failed
expanded:
file is not a filter file
parse_forward_list:
system_aliases router declined for juha@saarinen.org
--------> userforward router <--------
local_part=juha domain=saarinen.org
checking for local user
calling userforward router
rda_interpret (file): $home/.forward
expanded: /home/juha/.forward
stat(/home/juha/.)=0
/home/juha/.forward does not exist
userforward router declined for juha@saarinen.org
--------> localuser router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "saarinen.org"? yes (matched "saarinen.org")
checking for local user
calling localuser router
localuser router called for juha@saarinen.org
domain = saarinen.org
set transport local_delivery
queued for local_delivery transport: local_part = juha
domain = saarinen.org
errors_to=NULL
domain_data=NULL localpart_data=NULL
routed by localuser router
envelope to: juha@saarinen.org
transport: local_delivery

[All good so far]

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing postmaster@saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering postaster@saarinen.org
active address postmaster@saarinen.org
local_part=postmaster domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing postmaster@saarinen.org
--------> dnslookup router <--------
local_part=postmaster domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=postmaster domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="postmaster" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="webmaster"
file lookup required for postmaster
in /etc/aliases
lookup yielded: juha
expanded: juha
file is not a filter file
parse_forward_list: juha
extract item: juha
system_aliases router generated juha@saarinen.org
errors_to=NULL transport=NULL
uid=unset gid=unset home=NULL
routed by system_aliases router
envelope to: postmaster@saarinen.org
transport: <none>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering juha@saarinen.org
active address juha@saarinen.org
local_part=juha domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing juha@saarinen.org
--------> dnslookup router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=juha domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="juha" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="juha"
file lookup required for juha
in /etc/aliases
lookup failed
expanded:
file is not a filter file
parse_forward_list:
system_aliases router declined for juha@saarinen.org

<two skipped virtual domain routers snipped>

--------> userforward router <--------
local_part=juha domain=saarinen.org
checking for local user
calling userforward router
rda_interpret (file): $home/.forward
expanded: /home/juha/.forward
stat(/home/juha/.)=0
/home/juha/.forward does not exist
userforward router declined for juha@saarinen.org
--------> localuser router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "saarinen.org"? yes (matched "saarinen.org")
checking for local user
calling localuser router
localuser router called for juha@saarinen.org
domain = saarinen.org
queued for local_delivery transport: local_part = juha
domain = saarinen.org
errors_to=NULL
domain_data=NULL localpart_data=NULL
routed by localuser router
envelope to: juha@saarinen.org
transport: local_delivery

[.So, that should end up in my mail box, but it doesn't.]

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing root@saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering root@saarinen.org
active address root@saarinen.org
local_part=root domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing root@saarinen.org
--------> dnslookup router <--------
local_part=root domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=root domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="root" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="root"
file lookup required for root
in /etc/aliases
lookup yielded: juha
expanded: juha
file is not a filter file
parse_forward_list: juha
extract item: juha
system_aliases router generated juha@saarinen.org
errors_to=NULL transport=NULL
uid=unset gid=unset home=NULL
routed by system_aliases router
envelope to: root@saarinen.org
transport: <none>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering juha@saarinen.org
active address juha@saarinen.org
local_part=juha domain=saarinen.org
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing juha@saarinen.org
--------> dnslookup router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "@ : saarinen.org : taitoltd.com : futhermucker.net"? yes
(matched "saarinen.org")
saarinen.org in "! +local_domains"? no (matched "! +local_domains")
cached lookup data = NULL
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=juha domain=saarinen.org
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="juha" partial=-1
LRU list:
8/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="juha"
file lookup required for juha
in /etc/aliases
lookup failed
expanded:
file is not a filter file
parse_forward_list:
system_aliases router declined for juha@saarinen.org

[two skipped virtual domain routers snipped]

--------> userforward router <--------
local_part=juha domain=saarinen.org
checking for local user
calling userforward router
rda_interpret (file): $home/.forward
expanded: /home/juha/.forward
stat(/home/juha/.)=0
/home/juha/.forward does not exist
userforward router declined for juha@saarinen.org
--------> localuser router <--------
local_part=juha domain=saarinen.org
checking domains
saarinen.org in "saarinen.org"? yes (matched "saarinen.org")
checking for local user
calling localuser router
localuser router called for juha@saarinen.org
domain = saarinen.org
queued for local_delivery transport: local_part = juha
domain = saarinen.org
errors_to=NULL
domain_data=NULL localpart_data=NULL
routed by localuser router
envelope to: juha@saarinen.org
transport: local_delivery
search_tidyup called
>>>>>>>>>>>>>>>>>> Exim pid=3388 terminating with rc=0 >>>>>>>>>>>>>>>>>>
juha@saarinen.org
<-- webmaster@saarinen.org
router = localuser, transport = local_delivery
juha@saarinen.org
<-- postmaster@saarinen.org
router = localuser, transport = local_delivery
juha@saarinen.org
<-- root@saarinen.org
router = localuser, transport = local_delivery


I only get the message to the first recipient, however. I thought it was a
Courier-IMAP problem at first, as the debug output indicates that all
messages were routed, but looking at Exim's main.log, I only see one
instance of delivery:


2002-05-22 10:43:30 17AILq-0000v9-00 <= juha@saarinen.org
H=den2.saarinen.org [192.168.1.12] P=esmtp S=547
id=Pine.WNT.4.43.0205221043030.2024-100000@den2.saarinen.org

2002-05-22 10:43:30 17AILq-0000v9-00 => juha <root@saarinen.org>
R=localuser T=local_delivery
2002-05-22 10:43:30 17AILq-0000v9-00 Completed

Putting the other addresses in the cc: field has the same effect.

If you have:

alias1: account1
alias2: account2

and put alias1, alias2 as the recipients, the message gets delivered to
account1 and account2 as expected (but not to any further aliases either
account might have).

What am I missing here? Is this a feature?

--
Juha Saarinen
Re: Alias router only processes first recipient? [ In reply to ]
On Wed, 22 May 2002, Juha Saarinen wrote:

> I was testing a new alias, when I noticed that the router only processes
> the first recipient in To:, ignoring all the others.

Routers do not process recipients in To: lines. They process recipients
from the message's envelope.

> # exim -d -bt webmaster@saarinen.org postmaster@saarinen.org
> root@saarinen.org > debug 2>&1

Testing routing isn't quite the same as testing a real delivery. In
particular, de-duplication doesn't happen. What is the output when you
actually send a message to several addresses?

> I only get the message to the first recipient, however. I thought it was a
> Courier-IMAP problem at first, as the debug output indicates that all
> messages were routed, but looking at Exim's main.log, I only see one
> instance of delivery:

Aha! It *is* the de-duplication that is confusing you.

> What am I missing here? Is this a feature?

Yes. Exim only delivers one copy when several addresses resolve to the
same mailbox. However, you should see all the addresses in the
Envelope-To: header line.


--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: Alias router only processes first recipient? [ In reply to ]
On Wed, 22 May 2002, Philip Hazel wrote:

> Routers do not process recipients in To: lines. They process recipients
> from the message's envelope.

Yes, sorry, I phrased that carelessly.

> Aha! It *is* the de-duplication that is confusing you.

De-duplication? But I was triplicating! Quadruplicating! Quintuplicating
even! You're not making it easy for us speakers of Very Literal English.
;-)

But anyway, there it is, in the spec. And there's a good reason for it,
too. Oh well.

> Yes. Exim only delivers one copy when several addresses resolve to the
> same mailbox. However, you should see all the addresses in the
> Envelope-To: header line.

Yes, I saw that, which actually added to the confusion. Could I please ask
for a small feature to be added? Could Exim insert e.g. [Duplicate
message; delivered to first address only] or something clearer?

--
Juha Saarinen
Re: Alias router only processes first recipient? [ In reply to ]
On Wed, 22 May 2002, Juha Saarinen wrote:

> Yes, I saw that, which actually added to the confusion. Could I please ask
> for a small feature to be added? Could Exim insert e.g. [Duplicate
> message; delivered to first address only] or something clearer?

Where are you suggesting? In the log? In another header? As a comment in
the Envelope-To: header?

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: Alias router only processes first recipient? [ In reply to ]
On Wed, 22 May 2002, Philip Hazel wrote:

> Where are you suggesting? In the log? In another header? As a comment
> in the Envelope-To: header?

Any of these would work for me. Having it in the message would
be the most useful to end users, I guess.

--
Juha Saarinen
Re: Alias router only processes first recipient? [ In reply to ]
In article <Pine.WNT.4.43.0205230758060.2024-100000@den2.saarinen.org>,
Juha Saarinen <juha@saarinen.org> wrote:
>On Wed, 22 May 2002, Philip Hazel wrote:
>
>> Where are you suggesting? In the log? In another header? As a comment
>> in the Envelope-To: header?
>
>Any of these would work for me. Having it in the message would
>be the most useful to end users, I guess.

The fact that there's more than one address listed in the
Envelope-to: header already means that multiple recipients
were collapsed into one mailbox. No need to add an extra
comment or header.

Mike.
--
"Insanity -- a perfectly rational adjustment to an insane world."
- R.D. Lang
Re: Alias router only processes first recipient? [ In reply to ]
On Thu, 23 May 2002, Juha Saarinen wrote:

> On Wed, 22 May 2002, Philip Hazel wrote:
>
> > Where are you suggesting? In the log? In another header? As a comment
> > in the Envelope-To: header?
>
> Any of these would work for me. Having it in the message would
> be the most useful to end users, I guess.

I've put the last of them on the Wish List.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: Re: Alias router only processes first recipient? [ In reply to ]
On Thu, 23 May 2002, Miquel van Smoorenburg wrote:

> The fact that there's more than one address listed in the
> Envelope-to: header already means that multiple recipients
> were collapsed into one mailbox. No need to add an extra
> comment or header.

I did realize that, but some people might feel more comfortable if they
are told explicitly what has happened.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.