install named yum -y install bind chkconfig --levels 2345 named on vi /etc/resolv.conf change to nameserver 127.0.0.1
vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 61093 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Country Name (2 letter code) [XX]:CN State or Province Name (full name) []:Hong Kong Locality Name (eg, city) [Default City]:Hong Kong Organization Name (eg, company) [Default Company Ltd]:Jason Tang Ltd Organizational Unit Name (eg, section) []:IT Common Name (eg, your name or your server's hostname) []:Jason Tang Email Address []:
3.http://IP/postfixadmin/setup.php You should see a list of 'OK' messages.
Setup password postfixadmin <-------- Input your Setup password Admin: <-------- Input your Email address(Just for postfixadmin) Password: <-------- Input your Password Password (again): <-------- Input your Password again
vi /usr/local/bin/postfixadmin-mailbox-postcreation.sh change basedir=/var/spool/maildirs to basedir=/home/domains
change maildirmake "$maildir" to /usr/lib/courier-imap/bin/maildirmake "$maildir"
vi /usr/local/bin/postfixadmin-mailbox-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
vi /usr/local/bin/postfixadmin-domain-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
chkconfig --levels 2345 courier-authlib on chkconfig --levels 2345 courier-imap on
vi /etc/postfix/master.cf maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 465 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 995 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT
install squirrelmail cd /home/jason/courier wget http://downloads.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz wget http://downloads.sourceforge.net/project/squirrelmail/locales/1.4.18-20090526/all_locales-1.4.18-20090526.tar.gz tar -zxvf squirrelmail-webmail-1.4.22.tar.gz rm -rf squirrelmail-webmail-1.4.22.tar.gz mv squirrelmail-webmail-1.4.22 /var/www/html/webmail tar -zxvf all_locales-1.4.18-20090526.tar.gz rm -rf all_locales-1.4.18-20090526.tar.gz ./install Please enter path to your squirrelmail installation:/var/www/html/webmail cp: overwrite `/var/www/html/webmail/help/en_US/options.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/compose.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/search.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/addresses.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/read_mail.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/folders.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/main_folder.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/FAQ.hlp'? y cp: overwrite `/var/www/html/webmail/help/en_US/basic.hlp'? y
3. Copy the files cp -rp /var/www/html/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation vi /var/spool/vacation/vacation.pl my $db_type = 'mysql';
my $db_username = 'postfix'; my $db_password = 'postfix'; my $db_name = 'postfix';
4. Setup the transport type vi /etc/postfix/master.cf vacation unix - n n - - pipe flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
vi /etc/postfix/main.cf transport_maps = hash:/etc/postfix/transport
cp -rp /etc/postfix/transport /etc/postfix/transport.bak vi /etc/postfix/transport autoreply.jason-tang.com vacation
install mysql cd /usr/ports/databases/mysql50-server make install WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_general_ci BUILD_OPTIMIZED=yes BUILD_STATIC=yes WITH_NDB=yes clean
install apache + php cd /usr/ports/www/apache22 make install clean
cd /usr/ports/lang/php5 make config add [X] APACHE Build Apache module [X] MULTIBYTE Enable zend multibyte support [X] MAILHEAD Enable mail header patch
make install clean
cp -rp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini vi /usr/local/etc/php.ini change magic_quotes_gpc = On to magic_quotes_gpc = Off
vi /usr/local/etc/apache22/httpd.conf change DirectoryIndex index.html to DirectoryIndex index.html index.htm index.php
cd /usr/ports/lang/php5-extensions make install clean add [X] FTP FTP support [X] GD GD library support [X] IMAP IMAP support [X] MBSTRING multibyte string support [X] MYSQL MySQL database support [X] MYSQLI MySQLi database support [X] ZIP ZIP support [X] ZLIB ZLIB support
install openssh cd /usr/ports/security/openssh-portable make install clean
vi /usr/local/etc/ssh/sshd_config Port 61093 AllowUsers jason
vi /var/named/etc/namedb/named.conf change listen-on { 127.0.0.1; }; to // listen-on { 127.0.0.1; };
vi /etc/resolv.conf change to nameserver 127.0.0.1
reboot
install cyrus-sasl cd /usr/ports/security/cyrus-sasl2 make install WITH_AUTHDAEMON=yes clean
vi /usr/local/lib/sasl2/smtpd.conf pwcheck_method:authdaemond log_level:3 mech_list: PLAIN LOGIN authdaemond_path:/var/run/authdaemond/socket
install Postfix cd /usr/ports/mail/postfix make install WITH_AUTHDAEMON=yes clean add [X] SASL2 Cyrus SASLv2 (Simple Auth. and Sec. Layer) [X] TLS Enable SSL and TLS support [X] MYSQL MySQL maps (choose version with WITH_MYSQL_VER)
You need user "postfix" added to group "mail". Would you like me to add it [y]? y
Would you like to activate Postfix in /etc/mail/mailer.conf [n]? n
Country Name (2 letter code) [AU]:CN State or Province Name (full name) [Some-State]:Hong Kong Locality Name (eg, city) []:Hong Kong Organization Name (eg, company) [Internet Widgits Pty Ltd]:Jason Tang Ltd Organizational Unit Name (eg, section) []:IT Common Name (eg, YOUR name) []:Jason Tang Email Address []:
3. Configure Apache vi /usr/local/etc/apache22/httpd.conf Alias /postfixadmin "/usr/local/www/postfixadmin/" <Directory "/usr/local/www/postfixadmin"> Options Indexes AllowOverride ALL Order allow,deny Allow from all </Directory>
/usr/local/etc/rc.d/apache22 restart
4.http://IP/postfixadmin/setup.php You should see a list of 'OK' messages.
Admin: <-------- Input your Email address(Just for postfixadmin) Password: <-------- Input your Password Password (again): <-------- Input your Password again
vi /usr/local/bin/postfixadmin-mailbox-postcreation.sh change basedir=/var/spool/maildirs to basedir=/home/domains
change maildirmake "$maildir" to /usr/local/bin/maildirmake "$maildir"
vi /usr/local/bin/postfixadmin-mailbox-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
vi /usr/local/bin/postfixadmin-domain-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
install courier-imap cd /usr/ports/mail/courier-imap make install clean add [X] AUTH_MYSQL MySQL support
chmod +x /var/run/authdaemond
vi /usr/local/etc/authlib/authdaemonrc authmodulelist="authmysql" authmodulelistorig="authmysql"
vi /usr/local/etc/apache22/httpd.conf Alias /webmail "/usr/local/www/squirrelmail/" <Directory "/usr/local/www/squirrelmail"> Options Indexes AllowOverride ALL Order allow,deny Allow from all </Directory>