On Thu, Jul 16, 2020 at 05:19:52PM +0200, Kai Bojens via Exim-users wrote:
> Scenario: I want to archive customer e-mail. Right now I am sending
> copies through a router via "manualroute" and "unseen" which works
> perfectly fine.
> 
> The only problem occurs when mails have multiple recipients like Bcc.
> The recipient of the mails must be rewritten to the same address (i.e.
> foo...@archive.tld) for the mailarchive to work – I use headers_add for
> adding  "X-Envelope-To:" in order for the mail archive to distinguish
> them later.

 You are doing something strange: get original mail with several addresses
 and make several copies with a single-address X-Envelope-To: header.
 Why so? Put all recipients into X-Envelope-To: and write copy into archive.
 Such approach saves file space.

> The problem is that Exim recognizes these mails as the same and either
> sends one mail with multiple recipients or (when I add "max_rcpt = 1")
> sends multiple mails - but these mails are all the same, they only have
> the "X-Envelope-To:" of the latest redirection.
> 
> Debugging the process shows:
> 
> "[duplicate, would not be delivered]"
> 
> As far as I understand this is expected behaviour and only within pipes
> mails are treated differently.
> 
> tl;dr: how can I force Exim to actually create single and unique mails
> instead of just ignoring duplicates?

 Unique mails MUST have unique Message-Id's. Some mail storage systems
 (Cyrus, for example) remove duplicates by message-id automatically.

 Nevetheless, you can pipe mail to you custom script written to create
 several files, with the only difference in X-Envelope-To: header, but
 for me it looks ridiculous.
-- 
 Eugene Berdnikov

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to