Symptoms
Importing of an email account with more than 30GB of data via Plesk > Domains > example.com > Mail Importing fails:
stdout:
stderr: Failed to backup IMAP folder 'INBOX': Failed to get list of message UIDs: command: UID => got more than 1000000 bytes. All messages of that folder will not be migrated.
Cause
This is a Plesk Site Import extension bug with ID #PMT-4549, which is planned to be fixed in future product updates.
The limit of 1000000 bytes set in /opt/plesk/python/2.7/lib64/python2.7/imaplib.py
prevents the migration of a mail account with a big amount of data:
# grep MAXLINE /opt/plesk/python/2.7/lib64/python2.7/imaplib.py
_MAXLINE = 1000000
Resolution
Until the bug is fixed, apply the following workaround:
-
Connect to the server via SSH.
-
Open the file
/opt/plesk/python/2.7/lib64/python2.7/imaplib.py
in any text editor, for example, vi text editor:# vi /opt/plesk/python/2.7/lib64/python2.7/imaplib.py
-
Find the line
_MAXLINE = 1000000
at the beginning of this file and modify it as below by adding two zeros at the end of the line:_MAXLINE = 100000000
-
Save changes and close the file.
-
Restart mail importing in Plesk UI.