Export and import mails saved as ZIP archive
Starting from v8.2.11, WebMail Pro allows for exporting all mails from selected folder in user account. Mails are placed into ZIP archive, and once the import is completed, user gets the ZIP file offered for download.
The same tool allows for importing mails from ZIP archive back to any selected folder.
NB: This functionality requires ZIP extension of PHP. For example, on Debian and Ubuntu systems, it can be installed with the following command:
apt install php-zip
To use Import/Export tool, open "Manage Folders" screen under Settings > Email Accounts or using a quick link in bottom left corner of webmail interface, then click "Import/Export Mail" button. A popup window will be displayed, with folder selection and buttons: "Import", "Export" and "Cancel".
If you click "Export", a ZIP archive containing all the mails in the selected folder will be generated. It may take a while, depending on the amount of mails in the folder. Once the archive is ready, the button will switch to "Download ZIP" and you can download the archive.
"Import" button allows you to upload and unpack ZIP archive containing exported emails into a selected folder. While it's intended for use along with Export function, to copy mails to another folder or different account - it doesn't have to be an archive created with WebMail Pro, you can have email messages saved as .EML files placed into archive and Import will process those just fine.
This functionality is enabled by default. If you wish to disable it, modify data/settings/modules/ImportExportMailPlugin.config.json
file and set Disabled to true there.
Troubleshooting
You may need to adjust the following php.ini
configuration value for export and especially import to work smoothly:
- upload_max_filesize - defines how large files you can upload. Depending on how large ZIP archive you get while exporting mail, set it to high enough value, 128M for example.
- post_max_size - defines how large total data packet can be sent to server. Set it twice as much as upload_max_filesize.
- max_execution_time - sets time limit for running a single script call, in seconds. Try setting it to something like 600, or you can also set to -1 for unlimited execution time.
- memory_limit - sets memory limit for running a single script call.