1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Install Squirrelmail to replace Horde

Discussion in 'Plesk for Linux - 8.x and Older' started by jas8522, May 23, 2006.

  1. jas8522

    jas8522 Basic Pleskian

    Feb 3, 2005
    Likes Received:
    Halifax, Nova Scotia Canada
    Hello everyone,

    This may have been done before, but in my searches I couldn't find a guide to help me completely switch over to Squirrelmail from Horde.

    Firstly, why would you want to do this?

    1) Horde appears to have a vulnerability at this time that is being exploited by hackers everywhere. Swsoft has not released an update to this to fix it.
    2) My current installation of Horde will not allow anyone to login - Page cannot be displayed at redirect.php and segfaults in the apache logs.
    3) Squirrelmail is faster (albeit uglier) than Horde

    I'm sure there's other reasons as well, but these were the ones I could think of.

    Firstly since I'm using a Red Hat box (Enterprise 3), I had the aid of ART (Atomic Rocket Turtle - www.atomicrocketturtle.com) and his repository. ART currently has simplified the squirrelmail install to 'yum install squirrelmail' or 'yum update squirrelmail'.

    This will install squirrelmail to /usr/share/squirrelmail. If you don't have an RPM based OS, just install it to this directory anyway or adjust the remaining steps to your own install path.

    Next I removed IMP and Horde in case of any problems they might cause by running the following commands:

    rpm -e --nodeps psa-imp
    rpm -e --nodeps psa-horde

    I then added the Squirrelmail directory to the Apache conf file by taking the following steps:

    Edit /etc/httpd/conf/httpd.conf and add the following line at the very bottom:

    Include /etc/httpd/conf/httpd.squirrel

    This should go below the Include of httpd.include.

    The file httpd.squirrel is as follows:

    <VirtualHost \
    xx.xx.xx.xxx:80 \
    xx.xx.xx.xxx:80 \
    xx.xx.xx.xxx:80 \
    xx.xx.xx.xxx:80 \
    xx.xx.xx.xxx:80 \

    DocumentRoot /usr/share/squirrelmail/
    Alias /squirrel/ /usr/share/squirrelmail/
    ServerName squirrelmail
    ServerAlias mail.*
    UseCanonicalName Off
    <Directory /usr/share/squirrelmail>
    <IfModule sapi_apache2.c>
    php_admin_flag engine on
    php_admin_flag magic_quotes_gpc off
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/tmp:/var/log:/usr/share/doc"
    php_admin_value include_path "/usr/share/squirrel:/var/lib/squirrelmail:/etc/squirrelmail:."
    <IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag magic_quotes_gpc off
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/tmp:/var/log:/usr/share/doc"
    php_admin_value include_path "/usr/share/squirrel:/var/lib/squirrelmail:/etc/squirrelmail:."
    Order allow,deny
    Allow from all

    This will allow any request to mail.yourdomain.suffix to link to squirrelmail, just like webmail.yourdomain.suffix linked to Horde before it was removed.

    You will need to edit /usr/share/squirrelmail/config/config.php. Change any of the custom settings - like logo and server address, etc. to your liking. The following settings should be set exactly as shown here:

    $full_domain = $_SERVER['HTTP_HOST']; [You must add this line yourself]
    $domain = substr("$full_domain",5,strlen($full_domain)); [This will allow replies to your emails to go to the right place]

    $imap_server_type = 'courier';
    $invert_time = false;
    $optional_delimiter = '.';

    $default_folder_prefix = 'INBOX.';
    $trash_folder = 'Trash';
    $sent_folder = 'Sent';
    $draft_folder = 'Drafts';
    $default_move_to_trash = true;
    $default_move_to_sent = true;
    $default_save_as_draft = true;
    $show_prefix_option = false;
    $list_special_folders_first = true;
    $use_special_folder_color = true;
    $auto_expunge = true;
    $default_sub_of_inbox = false;
    $show_contain_subfolders_option = false;
    $default_unseen_notify = 2;
    $default_unseen_type = 1;
    $auto_create_special = true;
    $delete_folder = true;
    $noselect_fix_enable = false;

    To verify that attachments are working properly I specified the following in the config file as well:

    $attachment_dir = '/var/lib/squirrelmail/attach/';

    After which you will need to run:

    mkdir /var/lib/squirrelmail/attach
    chmod 667 /var/lib/squirrelmail/attach

    The last step is to make webmail.yourdomain.suffix point to mail.yourdomain.suffix:

    Create file /usr/share/psa-horde/index.php and paste the following in to it:

    $full_domain = $_SERVER['HTTP_HOST'];
    $domain = substr("$full_domain",3,strlen($full_domain));
    header("location: http://$domain/") ?>

    This will redirect queries for webmail.yourdomain.suffx to mail.yourdomain.suffix by chopping off the web at the beginning.

    Hopefully this will help others trying to set this up as well!