QWeb Ric
Basic Pleskian
User name: QWeb Ric
TITLE
Mail not migrating properly if source server is Courier 5
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Plesk 18.0.21 Update #5 and Migrator 2.18.0-897. CentOS 7 on the destination server, CentOS 6 on the origin server.
PROBLEM DESCRIPTION
When migrating a website from a Plesk server running Courier mail, to a Plesk server running Dovecot mail, emails are migrated successfully but the client software then downloads all existing emails again.
I've narrowed this down to an issue with the maildir-migrate-dovecot script which seems to be based on old Dovecot migration scripts and is presumably what Plesk automatically runs during the migration process. This script appears to be built to convert lines from courierpop3dsizelist into a Dovecot format, but only works if the courierpop3dsizelist file begns with "/2" or "/1" (UID format version numbers, I believe). With Courier 5 this file begins instead with "/3" which looks to have been introduced inline with Courier 5 receiving UTF8 support.
In a nutshell, the migration doesn't properly create the Dovecot UID maps and as such, all migrated mail is considered to be new and re-downloaded.
The format of UID lines within this file may or may not differ to /2 formatted files. I'm not able to investigate this unfortunately.
STEPS TO REPRODUCE
Begin a migration process for a website where the source server is running Courier and its courierpop3dsizelist file begins with /3, and where the destination server is running Dovecot.
After migration, check for the existence of dovecot-* map files alongside the original courierpop3dsizelist file. Such files should, but don't, exist.
Repoint the domain to the new server and check for new mail using a standard mail client. Existing mail will be re-downloaded due to the missing dovecot-* map files.
ACTUAL RESULT
dovecot-* map files don't exist due to the migration script not being able to interpret the courierpop3dsizelist file if version 3 is specified. More precisely, the script outputs a "Broken header" error if run manually, which is produced by the part of the code that tries to interpret this file.
EXPECTED RESULT
dovecot-* files should be produced and existing mail should not be re-downloaded after the domain repoint.
ANY ADDITIONAL INFORMATION
I originally posted to the forums here, where I've posted more detail throughout my investigation: https://talk.plesk.com/threads/plesk-migrator-seems-to-be-duplicating-emails.354914/
Dovecot these days seem to advise using dsync scripts instead of the migration scripts that Plesk seems to incorporate. maildir-migrate-dovecot itself hasn't been updated for a number of years now, by the looks of it.
We're currently paying for more servers than we need as I'd hoped to have all websites migrated by now, but can't migrate any client site that contains mailboxes at the moment due to the risk in them having to receive potentially thousands of old emails when the domains are repointed, so would obviously appreciate any help in resolving this issue please while a proper patch is produced for Plesk. Presumably either the maildir-migrate-dovecot script needs hacking to support /3 versioned courierpop3dsizelist files, or this script needs replacing with a dsync based alternative.
Much appreciated.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Help with sorting out
TITLE
Mail not migrating properly if source server is Courier 5
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Plesk 18.0.21 Update #5 and Migrator 2.18.0-897. CentOS 7 on the destination server, CentOS 6 on the origin server.
PROBLEM DESCRIPTION
When migrating a website from a Plesk server running Courier mail, to a Plesk server running Dovecot mail, emails are migrated successfully but the client software then downloads all existing emails again.
I've narrowed this down to an issue with the maildir-migrate-dovecot script which seems to be based on old Dovecot migration scripts and is presumably what Plesk automatically runs during the migration process. This script appears to be built to convert lines from courierpop3dsizelist into a Dovecot format, but only works if the courierpop3dsizelist file begns with "/2" or "/1" (UID format version numbers, I believe). With Courier 5 this file begins instead with "/3" which looks to have been introduced inline with Courier 5 receiving UTF8 support.
In a nutshell, the migration doesn't properly create the Dovecot UID maps and as such, all migrated mail is considered to be new and re-downloaded.
The format of UID lines within this file may or may not differ to /2 formatted files. I'm not able to investigate this unfortunately.
STEPS TO REPRODUCE
Begin a migration process for a website where the source server is running Courier and its courierpop3dsizelist file begins with /3, and where the destination server is running Dovecot.
After migration, check for the existence of dovecot-* map files alongside the original courierpop3dsizelist file. Such files should, but don't, exist.
Repoint the domain to the new server and check for new mail using a standard mail client. Existing mail will be re-downloaded due to the missing dovecot-* map files.
ACTUAL RESULT
dovecot-* map files don't exist due to the migration script not being able to interpret the courierpop3dsizelist file if version 3 is specified. More precisely, the script outputs a "Broken header" error if run manually, which is produced by the part of the code that tries to interpret this file.
EXPECTED RESULT
dovecot-* files should be produced and existing mail should not be re-downloaded after the domain repoint.
ANY ADDITIONAL INFORMATION
I originally posted to the forums here, where I've posted more detail throughout my investigation: https://talk.plesk.com/threads/plesk-migrator-seems-to-be-duplicating-emails.354914/
Dovecot these days seem to advise using dsync scripts instead of the migration scripts that Plesk seems to incorporate. maildir-migrate-dovecot itself hasn't been updated for a number of years now, by the looks of it.
We're currently paying for more servers than we need as I'd hoped to have all websites migrated by now, but can't migrate any client site that contains mailboxes at the moment due to the risk in them having to receive potentially thousands of old emails when the domains are repointed, so would obviously appreciate any help in resolving this issue please while a proper patch is produced for Plesk. Presumably either the maildir-migrate-dovecot script needs hacking to support /3 versioned courierpop3dsizelist files, or this script needs replacing with a dsync based alternative.
Much appreciated.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Help with sorting out