Mathias Jeschke:
> Hello,
> 
> I'm experiencing an issue with duplicate suppression and recipient
> address verification.
> 
> Basically I'm looking for a solution to suppress mail duplicates when a
> mail is sent to more than one recipient (typically virtual aliases) and
> those recipients/aliases are not disjoint, e.g. consider this alias map:
> 
> [email protected]    [email protected],[email protected]
> [email protected]    [email protected],[email protected]
> 
> If someone sends a mail to group1@ and group2@ the user2@ gets two
> copies of the same mail. Back then, when we used Cyrus there was a
> feature called "duplicatesuppression" that did the trick, but Dovecot
> does not seem to have such feature.
> 
> The solution I found on the web is to set the config option
> "enable_original_recipient=no" for postfix. This seems to do the trick,
> but on only if I do not use recipient address verification like this:
> 
> smtpd_recipient_restrictions =
>      ...
>      reject_unverified_recipient
>      ...
> 
> If I understand this diagram
> http://www.postfix.org/ADDRESS_VERIFICATION_README.html#how
> and the debug logs correctly, verify expects probe responses for the
> alias addresses itself, group1@ and group2@, but the probe response is
> sent for the resolved addresses, user1@/user2@/user3@.
> Finally smtpd rejects the mail with a "450 4.1.1 <[email protected]>:
> Recipient address rejected: unverified address: Address verification in
> progress". Unfortunately, this state is not temporary - a later attempt
> fails still/again with a 450.

Viktor's response misses one important thing.

Short story: address verification requires that the original recipient
address is available. That is, the recipient address before canonical
mapping, before address masquerading, and yes, before virtual alias
expansion. Because the original recipient address is what the Postfix
SMTP server uses in address verify database queries. This is
fundamental and cannot be changed.

Other things can be changed, however.

The enable_original_recipient parameter serves multiple functions
that should probably be separated.

- The first function is to enable address duplicate elimination
  without breaking deliveries to domains that receive all their
  email in the same mailbox. For this to work, Postfix must not
  eliminate duplicate deliveries to the same mailbox, when those
  deliveries have a different original recipient address. This first
  function is enabled with "enable_original_recipient = yes"
  (the default).

- The second function is to remember the original recipient address
  and to flag it as valid (or not) when an address probe completes.
  Remember, the original recipient is the address that the Postfix
  SMTP server uses in address address verification database queries.
  These queries will fail when "enable_original_recipient = no".

The solution for you would be that:

1) Postfix always records the original recipient, regardless of the
   enable_original_recipient setting, so that address verification
   works.

2) The enable_original_recipient parameter determines whether the
   original address will be used for address deduplication and
   whether it will show up in X-Original-To: headers, maillog
   records, and so on. This requires that a bunch of tests be
   replaced by with other tests. We can even introduce finer-grained
   control (enable_original_recipient = x-original-to, deduplication,
   logging, ...).

        Wietse

Reply via email to