Mehmet Avcioglu:
> Hello,
> 
> It looks like there is difference in postfix implementation of milter
> protocol regarding adding and deleting recipients compared to sendmail.
> 
> The following results in one final recipient on sendmail but no recipients
> on postfix while still logging nrcpt=2
> 
>   del_rcpt "<em...@otherdomain.com>"
>   add_rcpt "al...@domain.com"
>   del_rcpt "<al...@domain.com>"
>   add_rcpt "al...@domain.com"
> 
> Jun 28 16:15:00 server postfix/smtpd[264815]: connect from
> server.local[127.0.0.1]
> Jun 28 16:15:14 server postfix/smtpd[264815]: 49vrhL14pvzBGTn:
> client=server.local[127.0.0.1]
> Jun 28 16:15:21 server postfix/cleanup[264963]: 49vrhL14pvzBGTn:
> message-id=<49vrhL14pvzBGTn@server.local>
> Jun 28 16:15:21 server postfix/qmgr[264819]: 49vrhL14pvzBGTn: from=<
> sen...@domain.com>, size=378, nrcpt=2 (queue active)
> Jun 28 16:15:21 server postfix/qmgr[264819]: 49vrhL14pvzBGTn: removed
> Jun 28 16:15:22 server postfix/smtpd[264815]: disconnect from
> server.local[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
> 
> From what I understand the duplicate filter suppresses the address. Is this
> desired behavior?

Well we can't simply turn off duplicate filter when a recipient is
added (back) by a milter.

Incorrect solution:

Suppose you have an alias expansion:

    f...@example.com -> b...@example.com, f...@example.com, b...@example.com

You delete f...@example.com from the queue file, and then disable
the duplicate filter while adding it back with a milter. 

Then, adding f...@example.com back would result in another alias
expansion:

    f...@example.com -> b...@example.com, f...@example.com, b...@example.com

and because the duplicate filter is turned off, all addresses would
be added again to the queue file. That is annoying when the alias
is small, but could be bad if there alias is large.  Postfix should
work for 'small' and 'large' alias expansions.

Also incorrect solution:

An alternative, disabling alias expansion AND duplicate filtering
while adding a recipient by milter, would break Postfix compatibility
for cases where people rely on virtual alias expansion of recipients
added by a milter.

Correct solution:

The correct fix would that the 'delete recipient' method reads the
to-be-deleted recipient from the queue file, and then requests that
the address be removed from the duplicate filter.

Then, adding back f...@example.com  will produce the expected result:
a new f...@example.com recipient and no duplicate b...@example.com
or b...@example.com address.

        Wietse

Reply via email to