Article ID: 10064, created on Mar 11, 2011, last review on May 11, 2014

  • Applies to:
  • Plesk 9.5 for Linux/Unix


After upgrading Parallels Plesk Panel on Ubuntu6/Debian, attachments cannot be sent through Webmail. The following error is shown:

The file "ATTACHED FILE" could not be attached
Did not attach "ATTACHED FILE" as the server configuration did not allow the file to be uploaded

Also, attachments cannot be sent through Webmail with the error "Could not attach Forwarded Message."

The following error is shown in the log file:

Mar 10 00:40:14 HORDE [error] [imp] Could not save the compiled template file '/usr/share/psa-horde/imp/templates/compose/compose.html'. [pid 31501 on line 231 of "/usr/share/psa-horde/imp/lib/Template.php"]


The problem is caused by the PHP function tempnam(). It does not work in safe_mode with the directory "/tmp": tempnam("/tmp").

A couple of the latest updates to Ubuntu/Debian PHP affect file permission checks in safe_mode.


Replace "/tmp" with "tmp" in the Horde configuration file. Add the record "if($tmp_dir=='/tmp') $tmp_dir = 'tmp';" before $tmp_file:

if($tmp_dir=='/tmp') $tmp_dir = 'tmp';

        if (empty($tmp_dir)) {
            return false;

        $tmp_file = tempnam($tmp_dir, $prefix);

Please remember to back up the original file, just in case.

60d3e722783ac7177a2b4b4c13af4062 a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 6ef0db7f1685482449634a455d77d3f4 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF