Hi Sami,
On Mon, 10 Sep 2018, Sami Ketola wrote:
Currently dovecot does rely on remote to send valid RFC-compliant headers. But you are not alone, we have seen similar problems with mixed header fields on some legacy servers on the migrations we have performed.
Bummer. Would have been _very_ cool if doveadm could just disregard a second copy of a header sent.
I have found dsync_hashed_headers setting as a good workaround for migrating mails from broken imap servers. As per RFC Message-ID should be unique and we have safely used setting dsync_hashed_headers=Message-ID to migrate the problematic users away from the broken servers.
There's a certain irony in hoping that Message-ID headers are RFC compliant while we're talking to a non-RFC compliant mailserver. ;-)
That being said, limiting dsync_hashed_headers to only look at the Message-ID _does_ seem to do the trick.
But just to clarify: As far as I read the sourecode, the logic is as follows:
Fetch UID on remote, hash headers. Fetch UID on local, hash headers. Compare that header hashes match _for this one UID_. If yes, good. If not, something has changed.
This means there's no comparing the hashed headers to other UIDs going on? e.g. someone having two copies of the same mail with the same Message-ID would _not_ lead to an error, as these are saved under different UIDs.
Is my understanding of the code correct?
cheers, Andreas