Sunday, December 28, 2014

Setup webmail using squirrelmail

1- install and setup postfix and dovecot with the following link
http://theamdara.blogspot.com/2014/09/how-to-configure-email-with-virtual.html

2- install apache server and some conponents
root@mail-server:/# apache2 libapache2-mod-php5 php5

3-  download squirrelmail and extract to web root document
root@mail-server:/# wget http://squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fprdownloads.sourceforge.net%2Fsquirrelmail%2Fsquirrelmail-webmail-1.4.22.zip

root@mail-server:/# unzip squirrelmail-webmail-1.4.22.zip -d /var/www/html/
root@mail-server:/# mv /var/www/html/squirrelmail-webmail-1.4.22 /var/www/html/wmail

4- create necessary directories  and assign permission

root@mail-server:/#  cd /var/local/squirrelmail/
root@mail-server:/#  mkdir attach
root@mail-server:/#  chgrp -R www-data attach
root@mail-server:/#  chmod 730 attach

root@mail-server:/#  mkdir data
root@mail-server:/#  chown www-data:www-data data -R
root@mail-server:/#  chmod 775 data -R

5- configure squirrelmail to use the postfix and dovecot
- change some setting in /var/www/html/wmail/config/config.php

$squirrelmail_default_language = 'en_US';
$default_charset       = 'iso-8859-1';
$lossy_encoding        = false;

$domain                 = 'test.qq';
$imapServerAddress      = 'localhost';
$imapPort               = 143;
$useSendmail            = false;
$smtpServerAddress      = 'localhost';
$smtpPort               = 25;
$sendmail_path          = '/usr/sbin/sendmail';
$sendmail_args          = '-i -t';
$pop_before_smtp        = false;
$pop_before_smtp_host   = '';
$imap_server_type       = 'dovecot';
$invert_time            = false;
$optional_delimiter     = 'detect';
$encode_header_key      = '';

$default_folder_prefix          = '';
$trash_folder                   = 'INBOX.Trash';
$sent_folder                    = 'INBOX.Sent';
$draft_folder                   = 'INBOX.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           = true;
$show_contain_subfolders_option = false;
$default_unseen_notify          = 2;
$default_unseen_type            = 1;
$auto_create_special            = true;
$delete_folder                  = false;
$noselect_fix_enable            = false;

$data_dir                 = '/var/local/squirrelmail/data/';
$attachment_dir           = '/var/local/squirrelmail/attach/';
$dir_hash_level           = 0;
$default_left_size        = '150';




- if you prefer wizard  interface use command
root@mail-server:/# /var/www/html/wmail/configure


6- access the webmail "http://test.qq/wmail/src/login.php"


No comments:

Post a Comment