# Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail
______________________________ _____________________________
A mail server is the computerized equivalent of your friendly neighbourhood mailman. Every email that is sent passes through a series of mail servers along its way to its intended recipient. Although it may seem like a message is sent instantly - zipping from one PC to another in the blink of an eye - the reality is that a complex series of transfers takes place. Without this series of mail servers, you would only be able to send emails to people whose email address domains matched your own - i.e., you could only send messages from one example.com account to another example.com account.
Throughout this document we will be using a number of acronyms to describe things. It will help you (if you've never heard of these before) to know them in advance. Here is the short list with their associated definitions:
MTA - Mail Transfer Agent. We are using Postfix for MTA.
MDA - Mail Delivery Agent. Accepts inbound mail from an MTA and delivers it to the appropriate user on the local machine & we are using Courier as a MDA.
MUA - Mail User Agent. Software used by humans to download mail, upload to an MTA, create, and read mail. Squirrel mail agent will be our MUA.
POP3 - Post Office Protocol. This protocol POP3 allows a client computer to retrieve electronic mail from a POP3 server via a (temporary) TCP/IP or other connection.
IMAP - Internet Message Access Protocol. A protocol allowing a client to access and manipulate electronic mail messages on a server. It permits manipulation of remote message folders (mailboxes), in a way that is functionally equivalent to local mailboxes.
SMTP - Simple Mail Transport Protocol. A server to server protocol, so other protocols (POP3, IMAP etc.) are used to access the messages. The SMTP dialog usually happens in the background under the control of the message transport system, e.g. postfix but it is possible to interact with an SMTP server using telnet to connect to the normal SMTP port, 25. E.g.
Configuration Steps:
Before we start the installation we should make sure that the firewall (iptables) is off (at least for now) and that SELinux is disabled (this is important!).
Remove Iptables (firewall) and disable selinux
[root@mail ~]# iptables –F
[root@mail ~]# service iptables save
[root@mail ~]# chkconfigip tables off
[root@mail ~]# vi /etc/sysconfig/selinux
SELINUX=disabled
[root@mail ~]# reboot
Remove Some old Software (if installed)
[root@mail ~]# yum remove postfix dovecot
Install Apache, MySQL, phpMyAdmin&mailx
[root@mail ~]# yum install -y ntp httpd mysql* php* php-mysql gcc openssl* cyrus-sasl* pkgconfigzlib-devel phpMyAdmin pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel libidn-devel db4-devel mod_ssl telnet sqlite-devel mail
Install postfix, courier, maildrop
[root@mail ~]# cd /rpm-folder
[root@mail ~]# rpm -ivh courier-authlib-0.65.0-1.el6.x 86_64.rpm courier-authlib-mysql-0.65.0-1 .el6.x86_64.rpm courier-authlib-devel-0.65.0-1 .el6.x86_64.rpm courier-imap-4.12.0-1.x86_64.r pm maildrop-2.6.0-1.x86_64.rpm epel* postfix-2.6.6-2.2.el6.x86_64.r pm
Set MySQL Passwords And Configure phpMyAdmin
[root@mail ~]# chkconfig --levels 235 mysqld on
[root@mail ~]# servicemysqld start
[root@mail ~]# mysql_secure_installation
In order to log into MySQL to secure it, we'll need the currentpassword for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, So you should just press the Enter here.
Enter current password for root (enter for none): <-- ENTERPassword
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] <-- y
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into production environment.
Remove anonymous users? [Y/n] <-- n
... Success!
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <-- n
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <-- y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <-- y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Configure phpMyAdmin
(We have to configure this to manage the database through GUI)
[root@mail ~]# vi /etc/httpd/conf.d/ phpmyadmin.php
#<Directory /usr/share/phpMyAdmin/>
# <IfModulemod_authz_core.c>
# # Apache 2.4
# <RequireAny>
# Requireip 127.0.0.1
# Require ip ::1
# </RequireAny>
# </IfModule>
# <IfModule !mod_authz_core.c>
# Apache 2.2
# Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
# Allow from ::1
# </IfModule>
#</Directory>
[root@mail ~]# chkconfig --levels 235 httpd on
[root@mail ~]# service httpd restart
Create the MySQL Database for Postfix /courier
[root@mail ~]# mysqladmin -u root –p
password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help.Type '\c' to clear the current input statement.
mysql> create database mail;
mysql>GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost' IDENTIFIED BY 'mailadmin';
mysql>GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost.locald omain' IDENTIFIED BY mailadmin ';
mysql>FLUSH PRIVILEGES;
mysql> USE mail;
mysql> CREATE TABLE domains (
domain varchar(50) NOT NULL,
PRIMARY KEY (domain) )
ENGINE=MyISAM;
mysql> CREATE TABLE forwardings (
source varchar(80) NOT NULL,
destination TEXT NOT NULL,
PRIMARY KEY (source) )
ENGINE=MyISAM;
mysql> CREATE TABLE users (
email varchar(80) NOT NULL,
password varchar(20) NOT NULL,
quota bigint(20) DEFAULT '10485760',
PRIMARY KEY (email)
) ENGINE=MyISAM;
mysql> CREATE TABLE transport (
domain varchar(128) NOT NULL default '',
transport varchar(128) NOT NULL default '',
UNIQUE KEY domain (domain)
) ENGINE=MyISAM;
mysql> quit;
Here we are defining the Database structure for mail server
The domains table will store each virtual domain that Postfix should receive emails for (e.g. 16c.com).
domain
16c.com
The forwardings table is for aliasing one email address to another, e.g. forward emails for info@16c.com to sales@16c.com.
source destination
info@16c.com sales@16c.com
The users table stores all virtual users (i.e. email addresses, because theemail address and user name is the same) and passwords (in encrypted form!) and a quota value for each mail box (in this installation the default value is 209715200 bytes which means 200MB).
email password Quota
sales@16c.com No9.E4skNvGa. ("secret" in encrypted form) 209715200
The transport table is optional, it is for advanced users. It allows to forward mails for single users, whole domains or all mails to another server. For example,
domain transport
16c.com smtp:[1.2.3.4]
would forward all emails for 16c.com via the smtp protocol to the server with the IP address 1.2.3.4 (the square brackets [] mean "do not make a lookup of the MX DNS record" (which makes sense for IP addresses...). If you use a fully qualified domain name (FQDN) instead you would not use the square brackets.).
Configure Postfix & define virtual maps
[root@mail ~]# vi /etc/postfix/ mysql-virtual_domains.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/ mysql-virtual_forwardings.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/ mysql-virtual_mailboxes.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,' @',-1),'/ ',SUBSTRING_INDEX(email,'@',1), '/') FROM users WHERE email='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/ mysql-virtual_email2email.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT email FROM users WHERE email='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/ mysql-virtual_transports.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT transport FROM transport WHERE domain='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/ mysql-virtual_mailbox_limit_map s.cf
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT quota FROM users WHERE email='%s'
hosts = 127.0.0.1
[root@mail ~]# chmod o= /etc/postfix/ mysql-virtual_*.cf
[root@mail ~]# chgrp postfix /etc/postfix/ mysql-virtual_*.cf
[root@mail ~]# groupadd -g 5000 vmail
[root@mail ~]# useradd –r -g vmail -u 5000 vmail -d /storage_drive/vmail –m
Next we do some Postfix configuration in main.cf
[root@mail ~]# cp /etc/postfix/main.cf{,.bak}
[root@mail ~]# postconf -e 'myhostname = mail.16c.com'
[root@mail ~]# postconf -e 'mydestination = mail.16c.com, localhost, localhost.localdomain'
[root@mail ~]# postconf -e 'mynetworks = 127.0.0.0/8'
[root@mail ~]# postconf -e 'virtual_alias_domains ='
[root@mail ~]# postconf -e ' virtual_alias_maps = proxy:mysql:/etc/postfix/ mysql-virtual_forwardings.cf, mysql:/etc/postfix/ mysql-virtual_email2email.cf'
[root@mail ~]# postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/ mysql-virtual_domains.cf'
[root@mail ~]# postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/ mysql-virtual_mailboxes.cf'
[root@mail ~]# postconf -e 'virtual_mailbox_base = /storage_Drive/vmail’
[root@mail ~]# postconf -e 'virtual_uid_maps = static:5000'
[root@mail ~]# postconf -e 'virtual_gid_maps = static:5000'
[root@mail ~]# postconf -e 'smtpd_sasl_auth_enable = yes'
[root@mail ~]# postconf -e 'broken_sasl_auth_clients = yes'
[root@mail ~]# postconf -e 'smtpd_sasl_authenticated_head er = yes'
[root@mail ~]# postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'
[root@mail ~]# postconf -e 'smtpd_use_tls = yes'
[root@mail ~]# postconf -e 'smtpd_tls_cert_file = /etc/postfix/smtpd.cert'
[root@mail ~]# postconf -e 'smtpd_tls_key_file = /etc/postfix/smtpd.key'
[root@mail ~]# postconf -e 'transport_maps = proxy:mysql:/etc/postfix/ mysql-virtual_transports.cf'
[root@mail ~]# postconf -e 'virtual_create_maildirsize = yes'
[root@mail ~]# postconf -e 'virtual_maildir_extended = yes'
[root@mail ~]# postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/ mysql-virtual_mailbox_limit_map s.cf'
[root@mail ~]# postconf -e 'virtual_mailbox_limit_overrid e = yes'
[root@mail ~]# postconf -e 'virtual_maildir_limit_message = "The user you are trying to reach is over quota."'
[root@mail ~]# postconf -e 'virtual_overquota_bounce = yes'
[root@mail ~]# postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'
[root@mail ~]# postconf -e 'inet_interfaces = all'
Afterwards we create the SSL certificate that is needed for TLS:
[root@mail ~]# cd /etc/postfix
[root@mail ~]# opensslreq -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyoutsmtpd.key -keyform PEM -days 365 -x509
Country Name (2 letter code) [XX]:<-- Enter your Country Name (e.g., "DE").
State or Province Name (full name) []:<-- Enter your State or Province Name.
Locality Name (eg, city) [Default City]:<-- Enter your City.
Organization Name (eg, company) [Default Company Ltd]:<-- Enter your Organization Name (e.g., the name of your company).
Organizational Unit Name (eg, section) []:<-- Enter your Organizational Unit Name (e.g. "IT Department").
Common Name (eg, your name or your server's hostname) []:<-- Enter the Fully Qualified Domain Name of the system (e.g. "server1.example.com").
Email Address []:<-- Enter your Email Address.
Then change the permissions of the smtpd.key:
[root@mail ~]# chmod o= /etc/postfix/smtpd.key
Configure Saslauthd (this configuration required for SSL/TLS Authentication)
[root@mail ~]# vi /etc/sasl2/smtpd.conf
#pwcheck_method: saslauthd
#mech_list: plain login
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/ authdaemon/socket
Then start Postfix, saslauthd, and courier-authlib:
[root@mail ~]# chmod 755 /var/spool/authdaemon
[root@mail ~]# chkconfig --levels 235 courier-authlib on
[root@mail ~]# service courier-authlib restart
[root@mail ~]# chkconfig --levels 235 postfix on
[root@mail ~]# chkconfig --levels 235 saslauthd on
[root@mail ~]# service postfix restart
[root@mail ~]# service saslauthd restart
[root@mail ~]# chkconfig –levels 235 sendmail off
Configure Courier
Now we have to tell Courier that it should authenticate against our MySQL database. First, edit /etc/authlib/authdaemonrc and change the value of authmodulelistso that it reads.
[root@mail ~]# vi /etc/authlib/authdaemonrc
authmodulelist="authmysql" ( add this line )
#authmodulelist="authuserdbauthpamauthpgsqlau thldapauthmysqlauthcustomauthp ipe" ( add # or comment this line)
Then edit /etc/authlib/authmysqlrc. It should look exactly like this (again, make sure to fill in the correct database details):
[root@mail ~]# cp /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc_orig
[root@mail ~]# cat /dev/null > /etc/authlib/authmysqlrc
[root@mail ~]# vi /etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mailadmin
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/storage_drive/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,' @',-1),'/ ',SUBSTRING_INDEX(email,'@',1), '/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota
Then restart Courier:
[root@mail ~]# chkconfig --levels 235 courier-imap on
[root@mail ~]# service courier-authlib restart
[root@mail ~]# service courier-imap restart
delete old certificates and generatenewfileand replaced the CN and emailaddress
[root@mail ~]# cd /usr/lib/courier-imap/share
[root@mail ~]# rm -f imapd.pem
[root@mail ~]# rm -f pop3d.pem
[root@mail ~]# vi /usr/lib/courier-imap/etc/ imapd.cnf
CN=mail.16c.com
emailAddress=postmaster@16c.co m
[root@mail ~]# vi /usr/lib/courier-imap/etc/ pop3d.cnf
CN=mail.16c.com
emailAddress=postmaster@16c.co m
[root@mail ~]# ./mkimapdcert
[root@mail ~]# ./mkpop3dcert
[root@mail ~]# service courier-authlib restart
[root@mail ~]# service courier-imap restart
Test pop3 by telnet
[root@mail ~]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Hello there.
<-- quit (enter quit)
+OK Better luck next time.
Connection closed by foreign host.
Modify /etc/aliases (it is required to create alias for root)
[root@mail ~]# vi /etc/aliases
postmaster: root
root: postmaster@16c.com
[root@mail ~]# newaliases
[root@mail ~]# service postfix restart
Test Postfix
If you see the lines 250-STARTTLS and 250-AUTH PLAIN LOGIN everything is fine.
[root@mail ~]#telnetlocalhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix
<-- ehlo localhost (enter ehlo localhost)
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
<-- quit (enter quit)
221 2.0.0 Bye
Connection closed by foreign host.
Populate The Database And Test (add domains, users, aliases )
[root@mail ~]# mysql -u root –p
Password: enter password
Mysql> USE mail;
If you want to make entries in the table domains or add domains, that would look like this:
Mysql> INSERT INTO `domains` (`domain`) VALUES ('16c.com');
If you want to make entries in the table users or add users, that would look like this:
Mysql> INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('admin@16c.com', ENCRYPT('adminpassword'),‘1048 5760’);
If you want to make entries in the table forwardings or forward email, that would look like this:
Mysql> INSERT INTO `forwardings` (`source`, `destination`) VALUES ('info@16c.com', 'sales@16c.com');
Mysql> quit;
Reload postfix service every time when add user or changing in database :-
[root@mail ~]# service postfix reload
Send a Welcome Email For Creating Maildir
[root@mail ~]# mail admin@16c.com
Subject: Welcome<-- ENTER
Welcome! Have fun with your new mail account.<-- ENTER
<-- CTRL+D
EOT
[root@mail ~]#
Installing SquirrelMail
[root@mail ~]# yum install squirrelmail php-pear-DB
[root@mail ~]# service httpd restart
Change SQL Password plugin which we can install manually:
[root@mail ~]# cd /usr/share/squirrelmail/ plugins
[root@mail ~]# wget http://www.squirrelmail.org/ plugins/ change_sqlpass-3.3-1.2.tar.gz
[root@mail ~]# tar – xvfz change_sqlpass-3.3-1.2.tar.gz
[root@mail ~]# cd change_sqlpass
[root@mail ~]# cp config.php.sample config.php
Now we must edit config.php and adjust it to our setup
[root@mail ~]# cd /usr/share/squirrelmail/ plugins/change_sqlpass/
[root@mail ~]# vi config.php
[...]
$csp_dsn = 'mysql:// mail_admin:mail_admin_password@ localhost/mail';
[...]
$lookup_password_query = 'SELECT count(*) FROM users WHERE email = "%1" AND password = %4';
[...]
$password_update_queries = array('UPDATE users SET password = %4 WHERE email = "%1"');
[...]
$password_encryption = 'MYSQLENCRYPT';
[...]
$csp_salt_static = 'LEFT(password, 2)';
[...]
//$csp_salt_query = 'SELECT salt FROM users WHERE username = "%1"';
[...]
$csp_delimiter = '@';
[...]
The Change SQL Password plugin also depends on the Compatibility plugin which we install as follows:
[root@mail ~]# cd /usr/share/squirrelmail/ plugins
[root@mail~]# wget http://www.squirrelmail.org/ countdl.php?fileurl=http%3A%2F% 2Fwww.squirrelmail.org%2Fplugi ns%2Fcompatibility-2.0.16-1.0. tar.gz
{Note: above command wget should be type with below link with space}
[root@mail ~]# tar -xvzf compatibility-2.0.16-1.0.tar.g z
Now we must go into the SquirrelMail configuration and tell SquirrelMail that we use Courier as our POP3 and IMAP server and enable the Change SQL Password and the Compatibility plugins:
[root@mail ~]# cd /usr/share/squirrelmail/ config/
[root@mail ~]# ./conf.pl
You'll see the following menu. Navigate through it as indicated:
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >> <-- D
SquirrelMail Configuration : Read: config.php
------------------------------ ---------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything
Command >> <-- courier
imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true
Press enter to continue... <-- ENTER
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >> <-- 8
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
Available Plugins:
4. administrator
5. bug_report
6. calendar
7. change_sqlpass
8. compatibility
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- 8 (or whatever number the compatibility plugin has - it's needed by the change_sqlpass plugin)
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
Available Plugins:
5. administrator
6. bug_report
7. calendar
8. change_sqlpass
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- 8 (the number of the change_sqlpass plugin)
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. change_sqlpass
Available Plugins:
6. administrator
7. bug_report
8. calendar
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> S
Data saved in config.php
Press enter to continue... <-- ENTER
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------ ---------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. change_sqlpass
Available Plugins:
6. administrator
7. bug_report
8. calendar
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- Q
Change defaults sub folder setting :-
[root@mail ~]# vi /usr/share/squirrelmail/ config/config.php
line no. 56 $default_sub_of_inbox = false;
One last thing we need to do is modify the file /etc/squirrelmail/ config_local.php
and comment out the $default_folder_prefix variable - if you don't do
this, you will see the following error message in SquirrelMail after
you've logged in: Query: CREATE "Sent" Reason Given: Invalid mailbox
name.
[root@mail ~]# vi /etc/squirrelmail/ config_local.php
<?php
/**
* Local config overrides.
*
* You can override the config.php settings here.
* Don't do it unless you know what you're doing.
* Use standard PHP syntax, see config.php for examples.
*
* @copyright © 2002-2006 The SquirrelMail Project Team
* @license http://opensource.org/ licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @subpackageconfig
*/
//$default_folder_prefix = '';
?>
[root@mail ~]# service httpd restart
Now all configurations are done & our mail Server is ready to use.
For access mail server type http://mail-server-ip/webmail
______________________________
A mail server is the computerized equivalent of your friendly neighbourhood mailman. Every email that is sent passes through a series of mail servers along its way to its intended recipient. Although it may seem like a message is sent instantly - zipping from one PC to another in the blink of an eye - the reality is that a complex series of transfers takes place. Without this series of mail servers, you would only be able to send emails to people whose email address domains matched your own - i.e., you could only send messages from one example.com account to another example.com account.
Throughout this document we will be using a number of acronyms to describe things. It will help you (if you've never heard of these before) to know them in advance. Here is the short list with their associated definitions:
MTA - Mail Transfer Agent. We are using Postfix for MTA.
MDA - Mail Delivery Agent. Accepts inbound mail from an MTA and delivers it to the appropriate user on the local machine & we are using Courier as a MDA.
MUA - Mail User Agent. Software used by humans to download mail, upload to an MTA, create, and read mail. Squirrel mail agent will be our MUA.
POP3 - Post Office Protocol. This protocol POP3 allows a client computer to retrieve electronic mail from a POP3 server via a (temporary) TCP/IP or other connection.
IMAP - Internet Message Access Protocol. A protocol allowing a client to access and manipulate electronic mail messages on a server. It permits manipulation of remote message folders (mailboxes), in a way that is functionally equivalent to local mailboxes.
SMTP - Simple Mail Transport Protocol. A server to server protocol, so other protocols (POP3, IMAP etc.) are used to access the messages. The SMTP dialog usually happens in the background under the control of the message transport system, e.g. postfix but it is possible to interact with an SMTP server using telnet to connect to the normal SMTP port, 25. E.g.
Configuration Steps:
Before we start the installation we should make sure that the firewall (iptables) is off (at least for now) and that SELinux is disabled (this is important!).
Remove Iptables (firewall) and disable selinux
[root@mail ~]# iptables –F
[root@mail ~]# service iptables save
[root@mail ~]# chkconfigip tables off
[root@mail ~]# vi /etc/sysconfig/selinux
SELINUX=disabled
[root@mail ~]# reboot
Remove Some old Software (if installed)
[root@mail ~]# yum remove postfix dovecot
Install Apache, MySQL, phpMyAdmin&mailx
[root@mail ~]# yum install -y ntp httpd mysql* php* php-mysql gcc openssl* cyrus-sasl* pkgconfigzlib-devel phpMyAdmin pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel libidn-devel db4-devel mod_ssl telnet sqlite-devel mail
Install postfix, courier, maildrop
[root@mail ~]# cd /rpm-folder
[root@mail ~]# rpm -ivh courier-authlib-0.65.0-1.el6.x
Set MySQL Passwords And Configure phpMyAdmin
[root@mail ~]# chkconfig --levels 235 mysqld on
[root@mail ~]# servicemysqld start
[root@mail ~]# mysql_secure_installation
In order to log into MySQL to secure it, we'll need the currentpassword for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, So you should just press the Enter here.
Enter current password for root (enter for none): <-- ENTERPassword
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] <-- y
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into production environment.
Remove anonymous users? [Y/n] <-- n
... Success!
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <-- n
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <-- y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <-- y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Configure phpMyAdmin
(We have to configure this to manage the database through GUI)
[root@mail ~]# vi /etc/httpd/conf.d/
#<Directory /usr/share/phpMyAdmin/>
# <IfModulemod_authz_core.c>
# # Apache 2.4
# <RequireAny>
# Requireip 127.0.0.1
# Require ip ::1
# </RequireAny>
# </IfModule>
# <IfModule !mod_authz_core.c>
# Apache 2.2
# Order Deny,Allow
# Deny from All
# Allow from 127.0.0.1
# Allow from ::1
# </IfModule>
#</Directory>
[root@mail ~]# chkconfig --levels 235 httpd on
[root@mail ~]# service httpd restart
Create the MySQL Database for Postfix /courier
[root@mail ~]# mysqladmin -u root –p
password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help.Type '\c' to clear the current input statement.
mysql> create database mail;
mysql>GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost' IDENTIFIED BY 'mailadmin';
mysql>GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost.locald
mysql>FLUSH PRIVILEGES;
mysql> USE mail;
mysql> CREATE TABLE domains (
domain varchar(50) NOT NULL,
PRIMARY KEY (domain) )
ENGINE=MyISAM;
mysql> CREATE TABLE forwardings (
source varchar(80) NOT NULL,
destination TEXT NOT NULL,
PRIMARY KEY (source) )
ENGINE=MyISAM;
mysql> CREATE TABLE users (
email varchar(80) NOT NULL,
password varchar(20) NOT NULL,
quota bigint(20) DEFAULT '10485760',
PRIMARY KEY (email)
) ENGINE=MyISAM;
mysql> CREATE TABLE transport (
domain varchar(128) NOT NULL default '',
transport varchar(128) NOT NULL default '',
UNIQUE KEY domain (domain)
) ENGINE=MyISAM;
mysql> quit;
Here we are defining the Database structure for mail server
The domains table will store each virtual domain that Postfix should receive emails for (e.g. 16c.com).
domain
16c.com
The forwardings table is for aliasing one email address to another, e.g. forward emails for info@16c.com to sales@16c.com.
source destination
info@16c.com sales@16c.com
The users table stores all virtual users (i.e. email addresses, because theemail address and user name is the same) and passwords (in encrypted form!) and a quota value for each mail box (in this installation the default value is 209715200 bytes which means 200MB).
email password Quota
sales@16c.com No9.E4skNvGa. ("secret" in encrypted form) 209715200
The transport table is optional, it is for advanced users. It allows to forward mails for single users, whole domains or all mails to another server. For example,
domain transport
16c.com smtp:[1.2.3.4]
would forward all emails for 16c.com via the smtp protocol to the server with the IP address 1.2.3.4 (the square brackets [] mean "do not make a lookup of the MX DNS record" (which makes sense for IP addresses...). If you use a fully qualified domain name (FQDN) instead you would not use the square brackets.).
Configure Postfix & define virtual maps
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT email FROM users WHERE email='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT transport FROM transport WHERE domain='%s'
hosts = 127.0.0.1
[root@mail ~]# vi /etc/postfix/
user = mail_admin
password = mailadmin
dbname = mail
query = SELECT quota FROM users WHERE email='%s'
hosts = 127.0.0.1
[root@mail ~]# chmod o= /etc/postfix/
[root@mail ~]# chgrp postfix /etc/postfix/
[root@mail ~]# groupadd -g 5000 vmail
[root@mail ~]# useradd –r -g vmail -u 5000 vmail -d /storage_drive/vmail –m
Next we do some Postfix configuration in main.cf
[root@mail ~]# cp /etc/postfix/main.cf{,.bak}
[root@mail ~]# postconf -e 'myhostname = mail.16c.com'
[root@mail ~]# postconf -e 'mydestination = mail.16c.com, localhost, localhost.localdomain'
[root@mail ~]# postconf -e 'mynetworks = 127.0.0.0/8'
[root@mail ~]# postconf -e 'virtual_alias_domains ='
[root@mail ~]# postconf -e ' virtual_alias_maps = proxy:mysql:/etc/postfix/
[root@mail ~]# postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/
[root@mail ~]# postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/
[root@mail ~]# postconf -e 'virtual_mailbox_base = /storage_Drive/vmail’
[root@mail ~]# postconf -e 'virtual_uid_maps = static:5000'
[root@mail ~]# postconf -e 'virtual_gid_maps = static:5000'
[root@mail ~]# postconf -e 'smtpd_sasl_auth_enable = yes'
[root@mail ~]# postconf -e 'broken_sasl_auth_clients = yes'
[root@mail ~]# postconf -e 'smtpd_sasl_authenticated_head
[root@mail ~]# postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'
[root@mail ~]# postconf -e 'smtpd_use_tls = yes'
[root@mail ~]# postconf -e 'smtpd_tls_cert_file = /etc/postfix/smtpd.cert'
[root@mail ~]# postconf -e 'smtpd_tls_key_file = /etc/postfix/smtpd.key'
[root@mail ~]# postconf -e 'transport_maps = proxy:mysql:/etc/postfix/
[root@mail ~]# postconf -e 'virtual_create_maildirsize = yes'
[root@mail ~]# postconf -e 'virtual_maildir_extended = yes'
[root@mail ~]# postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/
[root@mail ~]# postconf -e 'virtual_mailbox_limit_overrid
[root@mail ~]# postconf -e 'virtual_maildir_limit_message
[root@mail ~]# postconf -e 'virtual_overquota_bounce = yes'
[root@mail ~]# postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'
[root@mail ~]# postconf -e 'inet_interfaces = all'
Afterwards we create the SSL certificate that is needed for TLS:
[root@mail ~]# cd /etc/postfix
[root@mail ~]# opensslreq -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyoutsmtpd.key -keyform PEM -days 365 -x509
Country Name (2 letter code) [XX]:<-- Enter your Country Name (e.g., "DE").
State or Province Name (full name) []:<-- Enter your State or Province Name.
Locality Name (eg, city) [Default City]:<-- Enter your City.
Organization Name (eg, company) [Default Company Ltd]:<-- Enter your Organization Name (e.g., the name of your company).
Organizational Unit Name (eg, section) []:<-- Enter your Organizational Unit Name (e.g. "IT Department").
Common Name (eg, your name or your server's hostname) []:<-- Enter the Fully Qualified Domain Name of the system (e.g. "server1.example.com").
Email Address []:<-- Enter your Email Address.
Then change the permissions of the smtpd.key:
[root@mail ~]# chmod o= /etc/postfix/smtpd.key
Configure Saslauthd (this configuration required for SSL/TLS Authentication)
[root@mail ~]# vi /etc/sasl2/smtpd.conf
#pwcheck_method: saslauthd
#mech_list: plain login
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/
Then start Postfix, saslauthd, and courier-authlib:
[root@mail ~]# chmod 755 /var/spool/authdaemon
[root@mail ~]# chkconfig --levels 235 courier-authlib on
[root@mail ~]# service courier-authlib restart
[root@mail ~]# chkconfig --levels 235 postfix on
[root@mail ~]# chkconfig --levels 235 saslauthd on
[root@mail ~]# service postfix restart
[root@mail ~]# service saslauthd restart
[root@mail ~]# chkconfig –levels 235 sendmail off
Configure Courier
Now we have to tell Courier that it should authenticate against our MySQL database. First, edit /etc/authlib/authdaemonrc and change the value of authmodulelistso that it reads.
[root@mail ~]# vi /etc/authlib/authdaemonrc
authmodulelist="authmysql" ( add this line )
#authmodulelist="authuserdbauthpamauthpgsqlau
Then edit /etc/authlib/authmysqlrc. It should look exactly like this (again, make sure to fill in the correct database details):
[root@mail ~]# cp /etc/authlib/authmysqlrc /etc/authlib/authmysqlrc_orig
[root@mail ~]# cat /dev/null > /etc/authlib/authmysqlrc
[root@mail ~]# vi /etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mailadmin
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/storage_drive/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota
Then restart Courier:
[root@mail ~]# chkconfig --levels 235 courier-imap on
[root@mail ~]# service courier-authlib restart
[root@mail ~]# service courier-imap restart
delete old certificates and generatenewfileand replaced the CN and emailaddress
[root@mail ~]# cd /usr/lib/courier-imap/share
[root@mail ~]# rm -f imapd.pem
[root@mail ~]# rm -f pop3d.pem
[root@mail ~]# vi /usr/lib/courier-imap/etc/
CN=mail.16c.com
emailAddress=postmaster@16c.co
[root@mail ~]# vi /usr/lib/courier-imap/etc/
CN=mail.16c.com
emailAddress=postmaster@16c.co
[root@mail ~]# ./mkimapdcert
[root@mail ~]# ./mkpop3dcert
[root@mail ~]# service courier-authlib restart
[root@mail ~]# service courier-imap restart
Test pop3 by telnet
[root@mail ~]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Hello there.
<-- quit (enter quit)
+OK Better luck next time.
Connection closed by foreign host.
Modify /etc/aliases (it is required to create alias for root)
[root@mail ~]# vi /etc/aliases
postmaster: root
root: postmaster@16c.com
[root@mail ~]# newaliases
[root@mail ~]# service postfix restart
Test Postfix
If you see the lines 250-STARTTLS and 250-AUTH PLAIN LOGIN everything is fine.
[root@mail ~]#telnetlocalhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix
<-- ehlo localhost (enter ehlo localhost)
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
<-- quit (enter quit)
221 2.0.0 Bye
Connection closed by foreign host.
Populate The Database And Test (add domains, users, aliases )
[root@mail ~]# mysql -u root –p
Password: enter password
Mysql> USE mail;
If you want to make entries in the table domains or add domains, that would look like this:
Mysql> INSERT INTO `domains` (`domain`) VALUES ('16c.com');
If you want to make entries in the table users or add users, that would look like this:
Mysql> INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('admin@16c.com', ENCRYPT('adminpassword'),‘1048
If you want to make entries in the table forwardings or forward email, that would look like this:
Mysql> INSERT INTO `forwardings` (`source`, `destination`) VALUES ('info@16c.com', 'sales@16c.com');
Mysql> quit;
Reload postfix service every time when add user or changing in database :-
[root@mail ~]# service postfix reload
Send a Welcome Email For Creating Maildir
[root@mail ~]# mail admin@16c.com
Subject: Welcome<-- ENTER
Welcome! Have fun with your new mail account.<-- ENTER
<-- CTRL+D
EOT
[root@mail ~]#
Installing SquirrelMail
[root@mail ~]# yum install squirrelmail php-pear-DB
[root@mail ~]# service httpd restart
Change SQL Password plugin which we can install manually:
[root@mail ~]# cd /usr/share/squirrelmail/
[root@mail ~]# wget http://www.squirrelmail.org/
[root@mail ~]# tar – xvfz change_sqlpass-3.3-1.2.tar.gz
[root@mail ~]# cd change_sqlpass
[root@mail ~]# cp config.php.sample config.php
Now we must edit config.php and adjust it to our setup
[root@mail ~]# cd /usr/share/squirrelmail/
[root@mail ~]# vi config.php
[...]
$csp_dsn = 'mysql://
[...]
$lookup_password_query = 'SELECT count(*) FROM users WHERE email = "%1" AND password = %4';
[...]
$password_update_queries = array('UPDATE users SET password = %4 WHERE email = "%1"');
[...]
$password_encryption = 'MYSQLENCRYPT';
[...]
$csp_salt_static = 'LEFT(password, 2)';
[...]
//$csp_salt_query = 'SELECT salt FROM users WHERE username = "%1"';
[...]
$csp_delimiter = '@';
[...]
The Change SQL Password plugin also depends on the Compatibility plugin which we install as follows:
[root@mail ~]# cd /usr/share/squirrelmail/
[root@mail~]# wget http://www.squirrelmail.org/
{Note: above command wget should be type with below link with space}
[root@mail ~]# tar -xvzf compatibility-2.0.16-1.0.tar.g
Now we must go into the SquirrelMail configuration and tell SquirrelMail that we use Courier as our POP3 and IMAP server and enable the Change SQL Password and the Compatibility plugins:
[root@mail ~]# cd /usr/share/squirrelmail/
[root@mail ~]# ./conf.pl
You'll see the following menu. Navigate through it as indicated:
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >> <-- D
SquirrelMail Configuration : Read: config.php
------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything
Command >> <-- courier
imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option
optional_delimiter = .
delete_folder = true
Press enter to continue... <-- ENTER
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >> <-- 8
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
Available Plugins:
4. administrator
5. bug_report
6. calendar
7. change_sqlpass
8. compatibility
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- 8 (or whatever number the compatibility plugin has - it's needed by the change_sqlpass plugin)
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
Available Plugins:
5. administrator
6. bug_report
7. calendar
8. change_sqlpass
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- 8 (the number of the change_sqlpass plugin)
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. change_sqlpass
Available Plugins:
6. administrator
7. bug_report
8. calendar
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> S
Data saved in config.php
Press enter to continue... <-- ENTER
SquirrelMail Configuration : Read: config.php (1.4.0)
------------------------------
Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. change_sqlpass
Available Plugins:
6. administrator
7. bug_report
8. calendar
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. sent_subfolders
16. spamcop
17. test
18. translate
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >> <-- Q
Change defaults sub folder setting :-
[root@mail ~]# vi /usr/share/squirrelmail/
line no. 56 $default_sub_of_inbox = false;
One last thing we need to do is modify the file /etc/squirrelmail/
[root@mail ~]# vi /etc/squirrelmail/
<?php
/**
* Local config overrides.
*
* You can override the config.php settings here.
* Don't do it unless you know what you're doing.
* Use standard PHP syntax, see config.php for examples.
*
* @copyright © 2002-2006 The SquirrelMail Project Team
* @license http://opensource.org/
* @version $Id$
* @package squirrelmail
* @subpackageconfig
*/
//$default_folder_prefix = '';
?>
[root@mail ~]# service httpd restart
Now all configurations are done & our mail Server is ready to use.
For access mail server type http://mail-server-ip/webmail
No comments:
Post a Comment