Discussion:
owner- aliases causing mail duplication?
(too old to reply)
Daniel Gnoutcheff
2016-07-20 19:47:40 UTC
Permalink
Hello all,

One of the mailservers I maintain has something like this in its
mailinglist: user1, user2, user3, user4, adminuser
owner-mailinglist: adminuser
The goals being:
- Mail sent to <***@our.domain.org> should be saved on the local
server, but should also be forward to `some.other.domain.org`.
- <***@our.domain.org> should be a simple mailing list to which
all staffmembers are subscribed, and
- mailinglist bounces (e.g. due to misconfiguration) should go to
`adminuser`.

However, with this configuration, mail sent to mailinglist@ is delivered
to <***@some.other.domain.org> *twice*. If I remove the
`owner-mailinglist` alias, the problem disappears.

This seems to be in addition to the usual Cc: duplicate "problem" (which
I was expecting). Indeed, adding <***@some.other.domain.org> to the
Cc: line results in a third copy.

We are using the LDA built into local(8); there should be no Sieve or
mailbox_command shenanigans at play.

What's happening here, and how to fix it?
13:59:52 postfix/submission/smtpd[15352]: connect from unknown[_some_ip_]
13:59:55 postfix/submission/smtpd[15352]: 4CD8F288043: client=unknown[_some_ip_], sasl_method=PLAIN, sasl_username=adminuser
13:59:55 postfix/cleanup[15358]: 4CD8F288043: message-id=<_scrubbed_message_id_>
13:59:56 postfix/cleanup[15358]: 362BE288048: message-id=<_scrubbed_message_id_>
13:59:56 postfix/qmgr[555]: 4CD8F288043: removed
13:59:56 postfix/submission/smtpd[15352]: disconnect from unknown[182.73.121.234]
13:59:56 postfix/cleanup[15358]: DC9AE288043: message-id=<_scrubbed_message_id_>
13:59:57 postfix/qmgr[555]: DC9AE288043: removed
13:59:57 postfix/qmgr[555]: 362BE288048: removed
Thanks!

Have a good one,
Daniel
Wietse Venema
2016-07-21 14:21:23 UTC
Permalink
Daniel Gnoutcheff:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
Post by Daniel Gnoutcheff
Hello all,
One of the mailservers I maintain has something like this in its
This means: deliver mail for 'user1' to 'user1' and to
Post by Daniel Gnoutcheff
mailinglist: user1, user2, user3, user4, adminuser
owner-mailinglist: adminuser
This means: deliver mail for 'mailinglist' as a new message with
sender 'adminuser' and recipients 'user1', 'user2', 'user3', 'user4',
'adminuser.'

This means the message is subjected again to virtual alias expansion,
something that you may have overlooked. This virtual alias expansion
would happen only when you have an 'owner-mailinglist' alias.
Post by Daniel Gnoutcheff
server, but should also be forward to `some.other.domain.org`.
all staffmembers are subscribed, and
- mailinglist bounces (e.g. due to misconfiguration) should go to
`adminuser`.
`owner-mailinglist` alias, the problem disappears.
I cannot reproduce this: with the `owner-mailinglist` alias present,
everyone gets one copy in their local mailbox.

mailinglist: wietse, test, root
owner-mailinglist: root
test: test, ***@example.com

First, mail to 'mailinglist' is forwarded as a new message without
any mailbox or off-site delivery:

Jul 21 09:52:05 wzv postfix/pickup[3011]: 1A543A0033: uid=0 from=<root>
Jul 21 09:52:05 wzv postfix/cleanup[3023]: 1A543A0033: message-id=<***@wzv.example.com>
Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1A543A0033: from=<***@wzv.example.com>, size=450, nrcpt=1 (queue active)
Jul 21 09:52:05 wzv postfix/cleanup[3023]: 1F2D4A0032: message-id=<***@wzv.example.com>
Jul 21 09:52:05 wzv postfix/local[3025]: 1A543A0033: to=<***@wzv.example.com>, orig_to=<mailinglist>, relay=local, delay=0.06, delays=0.04/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 1F2D4A0032)
Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1A543A0033: removed

Then, it is delivered to the individual recipients, and forwarded
to the off-site destination:

Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1F2D4A0032: from=<owner-***@wzv.example.com>, size=592, nrcpt=4 (queue active)
Jul 21 09:52:05 wzv postfix/local[3025]: 1F2D4A0032: to=<***@wzv.example.com>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 21 09:52:05 wzv postfix/local[3025]: 1F2D4A0032: to=<***@wzv.example.com>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 21 09:52:05 wzv postfix/cleanup[3023]: 219D3A0033: message-id=<***@wzv.example.com>
Jul 21 09:52:05 wzv postfix/qmgr[3012]: 219D3A0033: from=<owner-***@wzv.example.com>, size=727, nrcpt=1 (queue active)
Jul 21 09:52:05 wzv postfix/local[3025]: 1F2D4A0032: to=<***@wzv.example.com>, relay=local, delay=0.01, delays=0/0/0/0.01, dsn=2.0.0, status=sent (forwarded as 219D3A0033)
Jul 21 09:52:05 wzv postfix/local[3025]: 1F2D4A0032: to=<***@wzv.example.com>, relay=local, delay=0.02, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

So, no duplication. If you have duplication, perhaps there is a virtual alias
that you forgot to tell us about.

One puzzle: the above log says 'nrcpt=4' It takes too much time to figure out
what this means. I can look at that in the train ride home from work.

Wietse
Daniel Gnoutcheff
2016-07-21 15:08:55 UTC
Permalink
Thanks for the reply, Wietse!
Post by Wietse Venema
So, no duplication. If you have duplication, perhaps there is a virtual alias
that you forgot to tell us about.
The server in question (from which I derived my example log) does not
appear to have any virtual aliases configured:

# postconf virtual_alias_maps
virtual_alias_maps = $virtual_maps
# postconf virtual_maps
virtual_maps =
#

I've also been able to reproduce this problem on my personal mailserver,
though admittedly I *do* use virtual aliases on that one. Perhaps I'll
see about reproducing this on a fresh test server.

In case it matters, I forgot to mention that I've been using the Postfix
build shipped in Debian stable (8.x "jessie"), i.e. 2.11.3-1.

Thanks,
Daniel
Wietse Venema
2016-07-21 17:11:43 UTC
Permalink
Daniel Gnoutcheff:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
[ Charset windows-1252 converted... ]
Post by Daniel Gnoutcheff
Thanks for the reply, Wietse!
Post by Wietse Venema
So, no duplication. If you have duplication, perhaps there is a virtual alias
that you forgot to tell us about.
The server in question (from which I derived my example log) does not
# postconf virtual_alias_maps
virtual_alias_maps = $virtual_maps
# postconf virtual_maps
virtual_maps =
#
I've also been able to reproduce this problem on my personal mailserver,
though admittedly I *do* use virtual aliases on that one. Perhaps I'll
see about reproducing this on a fresh test server.
In case it matters, I forgot to mention that I've been using the Postfix
build shipped in Debian stable (8.x "jessie"), i.e. 2.11.3-1.
It's probably the same with many releases. The local(8) delivery
agent implements compatibility with historical interfaces, and
for that reason alone, the code changes rarely.

Wietse
Wietse Venema
2016-07-22 00:02:39 UTC
Permalink
Wietse Venema:
mailinglist: wietse, test, root
owner-mailinglist: root
test: test, ***@example.com

First, mail to 'mailinglist' is forwarded as a new message without
any mailbox or off-site delivery:

Jul 21 09:52:05 wzv postfix/pickup[3011]: 1A543A0033: uid=0 from=<root>
Jul 21 09:52:05 wzv postfix/cleanup[3023]: 1A543A0033: message-id=<***@wzv.example.com>
Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1A543A0033: from=<***@wzv.example.com>, size=450, nrcpt=1 (queue active)
Jul 21 09:52:05 wzv postfix/cleanup[3023]: 1F2D4A0032: message-id=<***@wzv.example.com>
Jul 21 09:52:05 wzv postfix/local[3025]: 1A543A0033: to=<***@wzv.example.com>, orig_to=<mailinglist>, relay=local, delay=0.06, delays=0.04/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 1F2D4A0032)
Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1A543A0033: removed

As the next logfile record shows, the message has four recipients.
I captured the queue file, and found that the recipients are
***@wzv.example.com, ***@wzv.example.com, ***@wzv.example.com,
and the off-site address, ***@example.com

Jul 21 09:52:05 wzv postfix/qmgr[3012]: 1F2D4A0032: from=<owner-***@wzv.example.com>, size=592, nrcpt=4 (queue active)

What happens next is that ***@wzv.example.com and ***@wzv.example.com
get one message in their mailbox. The ***@wzv.example.com recipient
is alias-expanded, resulting in one email message in their mailbox,
and another off-site email for ***@example.com.

Without the 'owner-mailinglist' alias, all expansions would be done
in the same local(8) delivery request, which can de-duplicate aliases
so that everyone gets only one copy.

It's an old problem, and it is not likely to get fixed because
the fix would break at least one other thing.

Wietse

Continue reading on narkive:
Loading...