At 03:45 PM 10/10/2003 -0400, Eric S. Raymond wrote:
Howard Spindel <howard(_at_)sci1(_dot_)com>:
> Initially, I had a problem that was causing multiple copies of email to be
> generated. I tracked this down to email that had multiple recipients on
> the "To:" line. Some upstream ISP would generate a message with a
> different message ID for each "To:" recipient but leave the "To:"
header as
> is, and when fetchmail used the "To:" header as the envelope address it
> would generate duplicates.
How is this possible? By design, fetchmail never generates any mail other
than
bounce and oversized messages. Where is it generating this duplicate?
Initially, I did not have Fetchmail configured to use an envelope
address. Fetchmail was deciphering the recipients by looking at the "To:"
header.
An upstream ISP (not my ISP) (running qmail, IIRC) would take a single
message with two addresses on the "To:" line and create two separate
messages from it. The messages would have different envelope addresses,
but would have both of the recipients left on the "To:" line. Furthermore,
the message would have two different message-IDs.
Consequently, when Fetchmail saw the two messages it parsed the "To:" lines
and sent out a copy of each message to both recipients, causing the
recipients to receive two copies each. This is not a Fetchmail problem -
Fetchmail was just doing what it was told to do.
> I attempted to fix this problem by using an "Envelope X-Original-To"
> command for fetchmail. That did fix the problem above, but created a new
> problem. I do get one message for each X-Original-To recipient, but
> sometimes the message-ID is the same. In multidrop mode fetchmail
> suppresses messages with duplicate message-ID, and I can't find a
switch to
> turn that behavior off. So now instead of the original problem of
> duplicate messages, only the first recipient on the "To:" line gets the
> message and the second recipient is dropped.
When fetchmail sees adjacent messages with the same message-ID, it
only removes the second and subsequent duplicates. Either you are
misunderstanding what you are seeing or I am misunderstanding what I
am reading.
I changed my Fetchmail configuration to use the Envelope address in
"X-Original-To" which my ISP always adds. This caused a different problem.
A different upstream ISP would take a message destined for two people on
the "To:" line and create two messages out of it. One message was created
for each envelope recipient. Unfortunately, the upstream ISP kept the same
message-ID for both of them. In this case, Fetchmail discarded one of the
messages due to the duplicate message-ID, and one recipient never got his
email. Commenting out the code in Fetchmail to discard duplicate
message-IDs fixed this problem. I think it would be a good idea if
discarding duplicate message-IDs was an option to Fetchmail.
Again, it is not clear that this is a Fetchmail problem - the problem was
created by an upstream ISP assigning the same message-ID to messages
destined for two different envelope addresses. But since my opportunity to
change the upstream ISP's behavior is nil, my only possible fix was in
Fetchmail.
If this explanation is not clear I'll try again.
Howard