小松鼠邮件(squirrelmail)服务器部署(squirrelmail+Postfix)
平臺:centos6.4
軟件:
下載軟件:http://www.squirrelmail.org/download.php(官網(wǎng))
squirrel-webmail-1.4.22.tar.bz2
all_locales-1.4.18-20090526.tar.bz2 ? ? ? ? ? ? ? ? ? (語言包)
依賴包:
httpd ? ?php ? ?phpd-mysql ? ? mysql ? ?mysql-server ? ?postfix ? ?dovecot
小松鼠郵件服務(wù)器搭建配置過程
安裝依賴包軟件
# yum -y install httpd php php-mysql mysql mysql-server postfix dovecot
下載軟件:http://www.squirrelmail.org/download.php(官網(wǎng))
squirrel-webmail-1.4.22.tar.bz2
all_locales-1.4.18-20090526.tar.bz2
解壓軟件
# cd /var/www/html
# tar vjxf squirrel-webmail-1.4.22.tar.bz2
重命名文件
# mv squirrelmail-webmail-1.4.22 webmail
進(jìn)入目錄,解壓軟件
# cp all_locales-1.4.18-20090526.tar.bz2/var/www/html/webmail
# cd webmail/
# tar vjxf all_locales-1.4.18-20090526.tar.bz2
創(chuàng)建目錄
# mkdir -p attach data
更改權(quán)限
# chown -R daemon:daemon data/
# chown -R root:apache attach ? ? #作為附近暫存空間
# chmod -R o+w data
# chmod 730 attach/
備份配置文件
# cp config/config_default.php config/config.php
編輯文件
# vi config/config.php
修改一下參數(shù)內(nèi)容:
$squirrelmail_default_language = 'zh_CN'; ?#漢化
$default_charset = 'zh_CN.UTF-8'; ? ? ? ? ? #漢化
$domain = 'benet.com'; ? ? ? ? ? ? ? ? ? ? ? ?#定義域名
$imap_server_type = 'dovecot';
$data_dir = '/var/www/html/webmail/data/';
$p_w_upload_dir = '/var/www/html/webmail/attach';
啟動httpd服務(wù)
# service httpd restart
配置postfix
進(jìn)入目錄 ,備份文件
# cd /etc/postfix
# cp main.cf main.cf.bak
提取出非默認(rèn)的配置
# postconf -n > main.tmp
覆蓋文件
# cp main.tmp main.cf
編輯文件
vim main.cf
在最后一行添加如下內(nèi)容
inet_interfaces = 192.168.0.30,127.0.0.1
myhostname = mail.benet.com
mydomain = benet.com
myorigin = $mydomain
mydestination = $mydomain, $myhostname
home_mailbox = Maildir/
重新啟動服器
service postfix restart
配置dovecot
復(fù)制配置文件,編輯文件
# cp /etc/dovecot/dovecot.conf /etc/dovecot.conf.bak
# vi /etc/dovecot/dovecot.conf ?
在最后一行添加
ssl_disable = yes
protocols = pop3 imap
disable_plaintext_auth = no
mail_location = maildir:~/Maildir ?
注意:首先如果有sendmail服務(wù),停止sendmail服務(wù),它會和postfix有沖突的
service sendmail stop
chkconfig --level 2345 sendmail off
附件擴(kuò)容:
郵件附件默認(rèn)為2M,如有需要可擴(kuò)大上傳附件的容量,具體步驟如下:
修改配置文件
# vim /etc/php.ini
修改參數(shù)如下:
file_uploads = On ? #開啟上傳功能
upload_tmp_dir ='/var/www/html/webmail/attach' ?#上傳附件存放位置
upload_max_filesize = 1000M ? #設(shè)定上傳附件最大值(默認(rèn)為2)
post_max_size = 1000M ? ? ? ?#允許post的數(shù)據(jù)的最大字節(jié)長度(默認(rèn)為8)
memory_limit = 1024M ? ? ? ? ? ? ? #內(nèi)存最大限制(默認(rèn)為128)
max_execution _time = 600 ? ? ? ? ?#每個(gè)腳本執(zhí)行最大允許執(zhí)行時(shí)間(0代表沒有限制)
max_input_time = -1 ? ? ? ? ? ? ? ? ? #上傳時(shí)間(-1代表沒有限制)
解開post限制
#postconf -e "message_size_limit =1024000000" 擴(kuò)容到1G
更改本身booleand現(xiàn)有的狀態(tài):
setsebool -P httpd_can_network_connect =1
重啟postfix服務(wù)
# service postfix restart
重啟mysql服務(wù)
# service mysql restart
重啟httpd服務(wù)
# service httpd restart
設(shè)置開機(jī)啟動項(xiàng)
開放端口:25,80,110,143,3306
# vim /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 80 -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 143 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
開機(jī)啟動:
# chkconfig httpd on
# chkconfig postfix on
創(chuàng)建本地用戶
# useradd usera
# passwd usera
在客戶端訪問網(wǎng)頁http://192.168.0.30/webmail ?
登陸用戶usera
點(diǎn)擊撰寫郵件s
給userb發(fā)送郵件
點(diǎn)擊退出
登錄用戶userb
收到一封郵件
內(nèi)容是用戶usera發(fā)送給userb的
虛擬用戶就無法實(shí)現(xiàn)了。
轉(zhuǎn)載于:https://blog.51cto.com/8429872/1408966
總結(jié)
以上是生活随笔為你收集整理的小松鼠邮件(squirrelmail)服务器部署(squirrelmail+Postfix)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP代码审计工具RIPS
- 下一篇: 50个常用sql语句