Plesk: Error opening /var/lib/squirrelmail/prefs/default_pref

On brand new Plesk 8.2.x installations or on servers that have been upgraded to Plesk 8.2.x, you might run into this error when you attempt to log into squirrelmail after it was installed via RPM:

Error opening /var/lib/squirrelmail/prefs/default_pref
Could not create initial preference file!
/var/lib/squirrelmail/prefs/ should be writable by user apache
Please contact your system administrator and report this error.

No matter what you do to the /var/lib/squirrelmail/prefs/default_pref file, even if you chmod 777 the file, you will still get the error. If you check the /etc/php.ini, you will normally find safe_mode set to on.

;
; Safe Mode
;
safe_mode = Off

Simply change safe_mode to off and reload Apache. If you try to log into squirrelmail again, it should complete successfully. I've tested this on Red Hat Enterprise Linux 4:

# rpm -q squirrelmail
squirrelmail-1.4.8-4.0.1.el4

Printed from: http://rackerhacker.com/2007/10/08/plesk-error-opening-varlibsquirrelmailprefsdefault_pref/ .
© Major Hayden 2012.

2 Comments   »

  • sean says:

    Better to set safe_mode just for Squirrelmail.

    You can add this anywhere, but I like to set it in /etc/httpd/conf.d/squirrelmail.conf:


    <Directory /var/www/squirrelmail>
    php_admin_value safe_mode off
    </Directory>

  • Steven says:

    Stumbled into other problems with squirrelmail after solving this:
    ERROR: Could not complete request.
    Query: CREATE "Sent"
    Reason Given: Invalid mailbox name.

    Solved by editing /etc/squirrelmail/config.php
    editing these lines:
    $optional_delimiter = 'detect';
    $default_folder_prefix = 'INBOX.'; <-- point at end
    $trash_folder = 'INBOX.Trash';
    $sent_folder = 'INBOX.Sent';

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this