- Plesk for Linux
When importing a large file with emails (+150M) in Horde on Plesk for Linux, one of the following happens:
- the process hangs on "Importing (this may take some time)..." for more than an hour.
- the process fails with "No file uploaded".
When tailing the logs below, one of the following error messages appears during this operation:
In the nginx error logfile /var/log/nginx/error.log:
# tail -fn0 /var/log/nginx/error.log
[error] 25810#0: *243 client intended to send too large body: 226195119 bytes, client: 203.0.113.2, server: webmail.example.com, request: "POST /services/ajax.php/imp/importMailbox?jsonhtml=1&token=78BdYs9rgeGynEwWSlgr59- HTTP/2.0", host: "webmail.example.com", referrer: "https://webmail.example.com/imp/dynamic.php?page=mailbox"
In the Apache error logfile /var/log/httpd/error_log:
# tail -fn0 /var/log/httpd/error_log
[fcgid:warn] [pid 26653:tid 139880768202496] [client 203.0.113.2:51466] mod_fcgid: HTTP request length 134223190 (so far) exceeds MaxRequestLen (134217728), referer: http://webmail.example.com/imp/dynamic.php?page=mailbox
# tail -fn0 /var/log/httpd/error_log
[fcgid:warn] [pid 32112:tid 139731214673664] [client 203.0.113.2:46226] mod_fcgid: read data timeout in 45 seconds, referer: http://webmail.example.com/imp/dynamic.php?page=mailbox
[core:error] [pid 32112:tid 139731214673664] [client 203.0.113.22:46226] End of script output before headers: ajax.php, referer: http://webmail.example.com/imp/dynamic.php?page=mailbox
[fcgid:warn] [pid 32061:tid 139731499976832] mod_fcgid: process 32376 graceful kill fail, sending SIGKILL
Insufficient limits are set in Apache and nginx configuration.
Note: This guide is intended for Plesk administrators with an SSH access to the server. If you are a domain/mailbox owner, please contact your service provider for assistance with email account configuration.
Connect to a Plesk server via SSH.
Create a directory for custom templates:
# mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail/
Copy original files to the created directory:
# cp /usr/local/psa/admin/conf/templates/default/webmail/nginxWebmailPartial.php /usr/local/psa/admin/conf/templates/custom/webmail/
# cp /usr/local/psa/admin/conf/templates/default/webmail/horde.php /usr/local/psa/admin/conf/templates/custom/webmail/
Open the file
/usr/local/psa/admin/conf/templates/custom/webmail/in a text editor (for example, "vi" editor) and increase the value of "client_max_body_size", so it will be larger than the import file:
# grep client_max_body_size /usr/local/psa/admin/conf/templates/custom/webmail/nginxWebmailPartial.php
Then open the file
/usr/local/psa/admin/conf/templates/custom/webmail/horde.phpand increase the value of "FcgidMaxRequestLen" as shown below:
# grep FcgidMaxRequestLen /usr/local/psa/admin/conf/templates/custom/webmail/horde.php
Rebuild configuration files:
# /usr/local/psa/admin/bin/httpdmng --reconfigure-all
Next, open the file /etc/psa-webmail/horde/horde/php.ini and increase the values of post_max_size and upload_max_filesize, so their size will be larger than the size of the import file:
# grep -E "upload_max_filesize|post_max_size" /etc/psa-webmail/horde/horde/php.ini
post_max_size = 1000M
upload_max_filesize = 1000M
Open the file /etc/httpd/conf.d/fcgid.conf and increase the value of FcgidIOTimeout:
# grep FcgidIOTimeout /etc/httpd/conf.d/fcgid.conf
Try to import the file in Horde again.
Note: In some cases, the pop-up window "Importing (this may take some time)..." might still be shown (after more than 1 hour) despite the fact that all emails have been imported. To make sure that the process has finished, open a new private window, log in to your webmail and check if messages have been restored.