Plesk

[BUG] Mail importing of a large mailbox fails in Plesk: Failed to backup IMAP folder ‘INBOX’: got more than 1000000 bytes: All messages of that folder will not be migrated

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:

  1. Connect to the server via SSH.

  2. 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

  3. 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

  4. Save changes and close the file.

  5. Restart mail importing in Plesk UI.

Exit mobile version