</>復(fù)制代碼
yum -y groupinstall Development Libraries Development Tools
yum install -y httpd httpd-devel php php-mysql mysql mysql-server mysql-devel openssl-devel dovecot perl-DBD-MySQL tcl tcl-devel libart_lgpl libart_lgpl-devel libtool-ltdl libtool-ltdl-devel expect db4 db4-devel cyrus-sasl-* dovecot-mysql perl-CGI
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/perl-Unix-Syslog-1.1-1.el6.rf.x86_64.rpm
wget ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/extras/RPMS/perl-GD-2.45-1.el6.rfx.x86_64.rpm(perl-GD 下載好后使用 yum localinstall 安裝)
</>復(fù)制代碼
#service sendmail stop
#chkconfig sendmail off
#yum remove postfix
#userdel postfix
#groupdel postfix
[root@mail ]# groupadd -g 2525 postfix
[root@mail ]# useradd -g postfix -u 2525 -s /sbin/nologin -M postfix
[root@mail ]# groupadd -g 2526 postdrop
[root@mail ]# useradd -g postdrop -u 2526 -s /bin/false -M postdrop
tar -zxvf postfix-2.6.5.tar.gz
cd postfix-2.6.5
make makefiles CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS AUXLIBS=-L/usr/lib64/mysql -lmysqlclient -lz -lm -L/usr/lib64/sasl2 -lsasl2 -lssl -lcrypto
</>復(fù)制代碼
make && make install
</>復(fù)制代碼
#newaliases
</>復(fù)制代碼
tempdir: [/home/soft/postfix-2.6.5]
config_directory: [/etc/postfix]
command_directory: [/usr/sbin]
daemon_directory: [/usr/libexec/postfix]
data_directory: [/var/lib/postfix]
html_directory: [no]
mail_owner: [postfix]
mailq_path: [/usr/bin/mailq.postfix]
manpage_directory: [/usr/share/man]
newaliases_path: [/usr/bin/newaliases.postfix]
queue_directory: [/var/spool/postfix]
readme_directory: [/usr/share/doc/postfix-2.6.6/README_FILES]
sendmail_path: [/usr/sbin/sendmail.postfix]
setgid_group: [postdrop]
</>復(fù)制代碼
vim /etc/postfix/main.cf
mynetworks = 127.X.X.1
</>復(fù)制代碼
# postconf -a
cyrus <---- 出現(xiàn)此提示說明支持 sasl 認(rèn)證
dovecot
</>復(fù)制代碼
#vim /etc/postfix/main.cf
############################CYRUS-SASL############################
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_unknown_sender_domain,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
vim /usr/lib/sasl2/smtpd.conf
</>復(fù)制代碼
pwcheck_method: authdaemond
log_level: 3
mech_list:PLAIN LOGIN
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
</>復(fù)制代碼
#!/bin/bash
#
# postfix Postfix Mail Transfer Agent
#
# chkconfig: 2345 80 30
# description: Postfix is a Mail Transport Agent, which is the program
# that moves mail from one machine to another.
# processname: master
# pidfile: /var/spool/postfix/pid/master.pid
# config: /etc/postfix/main.cf
# config: /etc/postfix/master.cf
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ $NETWORKING = "no" ] && exit 3
[ -x /usr/sbin/postfix ] || exit 4
[ -d /etc/postfix ] || exit 5
[ -d /var/spool/postfix ] || exit 6
RETVAL=0
prog="postfix"
start() {
# Start daemons.
echo -n $"Starting postfix: "
/usr/bin/newaliases >/dev/null 2>&1
/usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure $"$prog start"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix
echo
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down postfix: "
/usr/sbin/postfix stop 2>/dev/null 1>&2 && success || failure $"$prog stop"
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix
echo
return $RETVAL
}
reload() {
echo -n $"Reloading postfix: "
/usr/sbin/postfix reload 2>/dev/null 1>&2 && success || failure $"$prog reload"
RETVAL=$?
echo
return $RETVAL
}
abort() {
/usr/sbin/postfix abort 2>/dev/null 1>&2 && success || failure $"$prog abort"
return $?
}
flush() {
/usr/sbin/postfix flush 2>/dev/null 1>&2 && success || failure $"$prog flush"
return $?
}
check() {
/usr/sbin/postfix check 2>/dev/null 1>&2 && success || failure $"$prog check"
return $?
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
abort)
abort
;;
flush)
flush
;;
check)
check
;;
status)
status master
;;
condrestart)
[ -f /var/lock/subsys/postfix ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|abort|flush|check|status|condrestart}"
exit 1
esac
exit $?
</>復(fù)制代碼
[root@mail postfix]# chmod +x /etc/init.d/postfix
[root@mail postfix]# chkconfig --add postfix
[root@mail postfix]# chkconfig postfix on
[root@mail postfix]# chown postfix.postfix -R /var/lib/postfix/
[root@mail postfix]# chown postfix.postfix /var/spool/ -R
</>復(fù)制代碼
#wget http://jaist.dl.sourceforge.net/project/courier/authlib/0.70.0/courier-authlib-0.70.0.tar.bz2
# tar xf courier-authlib-0.70.0.tar.bz2
# cd courier-authlib-0.70.0
# ./configure
--prefix=/usr/local/courier-authlib
--sysconfdir=/etc
--without-authpam
--without-authshadow
--without-authvchkpw
--without-authpgsql
--with-authmysql
--with-mysql-libs=/usr/lib64/mysql
--with-mysql-includes=/usr/include/mysql
--with-redhat
--with-authmysqlrc=/etc/authmysqlrc
--with-authdaemonrc=/etc/authdaemonrc
--with-mailuser=postfix
# make && make install
# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
# cp /etc/authdaemonrc.dist /etc/authdaemonrc
# cp /etc/authmysqlrc.dist /etc/authmysqlrc
</>復(fù)制代碼
# vim /etc/authdaemonrc
authmodulelist="authmysql" # 會支持很多認(rèn)證方式,只保留authmysql即可。
authmodulelistorig="authmysql"
daemons=10 # 開戶認(rèn)證的進(jìn)程數(shù),也可以不用改,根據(jù)自己的情況。
</>復(fù)制代碼
[root@mail ~]# vim /etc/authmysqlrc
[root@mail ~]# cat /etc/authmysqlrc|grep -v "^#"|grep -v "^$"
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD postfix
MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
DEFAULT_DOMAIN ebarafoodssh.cn
MYSQL_UID_FIELD 2525
MYSQL_GID_FIELD 2525
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD concat(/var/mailbox/,homedir)
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD concat(/var/mailbox/,homedir)
# cd /home/soft/courier-authlib-0.66.1/
# cp courier-authlib.sysvinit /etc/rc.d/init.d/courier-authlib
# chmod 755 /etc/init.d/courier-authlib
# chkconfig --add courier-authlib
# chkconfig --level 2345 courier-authlib on
# echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf.d/courier-authlib.conf
# ldconfig -v
# service courier-authlib start (啟動服務(wù))
# chkconfig courier-authlib on
</>復(fù)制代碼
# mkdir –p /var/mailbox
# chown -R postfix /var/mailbox
</>復(fù)制代碼
# vi /usr/lib64/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list:PLAIN LOGIN
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
</>復(fù)制代碼
# vim /etc/postfix/main.cf
########################Virtual Mailbox Settings########################
virtual_mailbox_base = /var/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:2525
virtual_gid_maps = static:2525
virtual_transport = virtual
maildrop_destination_recipient_limit = 10
maildrop_destination_concurrency_limit = 10
##########################QUOTA Settings########################
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the users maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later.
virtual_overquota_bounce = yes
</>復(fù)制代碼
# vim /etc/dovecot/dovecot.conf
protocols = imap pop3 lmtp
disable_plaintext_auth = no
# vim /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:/var/mailbox/%d/%n/Maildir
# cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf
# vim /etc/dovecot/conf.d/auth-sql.conf
passdb {
driver = sql
args = /etc/dovecot-mysql.conf
}
userdb {
driver = sql
args = /etc/dovecot-mysql.conf
}
# vim /etc/dovecot-mysql.conf
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=postfix
default_pass_scheme = CRYPT
password_query = SELECT username AS user,password AS password FROM mailbox WHERE username = %u
user_query = SELECT maildir, uidnumber AS uid, gidnumber AS gid FROM mailbox WHERE username = %u
# service dovecot start
# chkconfig dovecot on
</>復(fù)制代碼
# tar zxvf extmail-1.2.tar.gz
# mkdir -p /var/www/extsuite
# mv extmail-1.2 /var/www/extsuite/extmail
# cp /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf
</>復(fù)制代碼
# vim /var/www/extsuite/extmail/webmail.cf
部分修改選項(xiàng)的說明:
SYS_SESS_DIR = /tmp/extmail 用戶的session保存的位置。
</>復(fù)制代碼
SYS_UPLOAD_TMPDIR = /tmp/extmail/upload
SYS_USER_LANG = en_US
</>復(fù)制代碼
SYS_USER_LANG = zh_CN
SYS_MIN_PASS_LEN = 7 最短密碼長度
SYS_MAILDIR_BASE = /home/domains
</>復(fù)制代碼
SYS_MAILDIR_BASE = /var/mailbox
</>復(fù)制代碼
SYS_MYSQL_USER = db_user
SYS_MYSQL_PASS = db_pass
</>復(fù)制代碼
SYS_MYSQL_USER = postfix
SYS_MYSQL_PASS = postfix
</>復(fù)制代碼
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
SYS_MYSQL_HOST = localhost
</>復(fù)制代碼
SYS_MYSQL_TABLE = mailbox
SYS_MYSQL_ATTR_USERNAME = username
SYS_MYSQL_ATTR_DOMAIN = domain
SYS_MYSQL_ATTR_PASSWD = password
</>復(fù)制代碼
SYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socket
</>復(fù)制代碼
SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket
</>復(fù)制代碼
# mkdir -p /tmp/extmail/upload
# chown postfix.postfix -R /tmp/extmail/
</>復(fù)制代碼
# vim /etc/httpd/conf/httpd.conf
User postfix
Group postfix
#LoadModule suexec_module modules/mod_suexec.so # 注釋掉,關(guān)閉suexec
#DocumentRoot "/var/www/html" # 關(guān)閉中心主機(jī),開戶虛擬主機(jī)
</>復(fù)制代碼
# vim /etc/httpd/conf.d/extmail.conf
80 >
ServerName mail.ebarafoodssh.cn
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
# service httpd restart
# chkconfig httpd on
</>復(fù)制代碼
# tar zxvf extman-1.1.tar.gz
# mv extman-1.1 /var/www/extsuite/extman
</>復(fù)制代碼
# cp /var/www/extsuite/extman/webman.cf.default /var/www/extsuite/extman/webman.cf
</>復(fù)制代碼
# vim /var/www/extsuite/extman/webman.cf
SYS_MAILDIR_BASE = /home/domains
</>復(fù)制代碼
SYS_MAILDIR_BASE = /var/mailbox
</>復(fù)制代碼
SYS_DEFAULT_UID = 1000
SYS_DEFAULT_GID = 1000
</>復(fù)制代碼
SYS_DEFAULT_UID = 2525
SYS_DEFAULT_GID = 2525
</>復(fù)制代碼
SYS_MYSQL_USER = webman
SYS_MYSQL_PASS = webman
</>復(fù)制代碼
SYS_MYSQL_USER = postfix
SYS_MYSQL_PASS = postfix
SYS_MYSQL_DB = postfix
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
</>復(fù)制代碼
# chown -R postfix.postfix /var/www/extsuite/extman/cgi/
# chown -R postfix.postfix /var/www/extsuite/extmail/cgi/
</>復(fù)制代碼
# cd /var/www/extsuite/extman/docs
# sed -i "s/extmail/postfix/" mysql_virtual_*
# service mysqld start
# p
</>復(fù)制代碼
# mysql -u root -p < extmail.sql
# mysql -u root -p < init.sql
# cp mysql_virtual_* /etc/postfix/
</>復(fù)制代碼
# mysql -u root -p
mysql> GRANT all privileges on postfix.* TO postfix@localhost IDENTIFIED BY postfix;
mysql> GRANT all privileges on postfix.* TO postfix@% IDENTIFIED BY postfix;
</>復(fù)制代碼
# mkdir /tmp/extman
# chown postfix.postfix -R /tmp/extman/
</>復(fù)制代碼
admin
extmail*123*
</>復(fù)制代碼
# yum install cairo-devel libxml2-devel pango-devel pango
libpng-devel freetype freetype-devel libart_lgpl-devel
rrdtool* perl-Time-HiRes.x86_64 perl-File-Tail(見下一步)
</>復(fù)制代碼
yum -y install perl-ExtUtils-MakeMaker
tar -zxvf File-Tail-1.2.tar.gz
cd File-Tail-1.2
perl Makefile.PL
make test
make install
</>復(fù)制代碼
# cp -r /var/www/extsuite/extman/addon/mailgraph_ext/ /usr/local/mailgraph_ext/
# /usr/local/mailgraph_ext/mailgraph-init start
# /var/www/extsuite/extman/daemon/cmdserver -daemon
# echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local
# echo "/var/www/extsuite/extman/daemon/cmdserver -v -d" >> /etc/rc.d/rc.local
</>復(fù)制代碼
# vim /etc/logrotate.d/maillog
/var/log/maillog {
daily
missingok
compress
rotate 365
nocompress
copytruncate
notifempty
create 0600 root root
olddir /data/maillog/
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
</>復(fù)制代碼
perl -e use MIME::Base64; print encode_base64("test@ebarafood.com")
</>復(fù)制代碼
perl -e use MIME::Base64; print encode_base64(" Abcd1234")
telnet mail.zzc.com 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is ^].
220 Welcome to our mail.zzc.com ESMTP,Warning: Version not Available!
ehlo mail.zzc.com
250-mail.zzc.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
emhvdXp1bmNoaUB6emMuY29t
334 UGFzc3dvcmQ6
MTIzcXdlIQ==
235 2.7.0 Authentication successful (提示成功)
</>復(fù)制代碼
# ln -sv /usr/local/courier-authlib/bin/courierauthconfig /usr/bin
# ln -sv /usr/local/courier-authlib/include/* /usr/include
</>復(fù)制代碼
# tar jxvf pcre-7.3.tar.bz2
# cd pcre-7.3
# ./configure
# make
# make check
# make install
# tar jxvf maildrop-2.0.2.tar.bz2
# cd maildrop-2.0.2
# ./configure --enable-sendmail=/usr/sbin/sendmail --enable-trusted-users=root vuser --enable-syslog=1 --enable-maildirquota --enable-maildrop-uid=1000 --enable-maildrop-gid=1000 --with-trashquota --with-dirsync
# make
# make install
</>復(fù)制代碼
# maildrop -v
maildrop 2.0.2 Copyright 1998-2005 Double Precision, Inc.
GDBM extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.
</>復(fù)制代碼
# vi /etc/maildroprc
</>復(fù)制代碼
logfile "/var/log/maildrop.log"
# touch /var/log/maildrop.log
# chown vuser.vgroup /var/log/maildrop.log
</>復(fù)制代碼
# vi /etc/postfix/master.cf
</>復(fù)制代碼
maildrop unix - n n - - pipe
flags=DRhu user=vuser argv=/usr/local/bin/maildrop -d ${recipient}
</>復(fù)制代碼
# echo "/usr/sbin/postfix start">>/etc/rc.local
</>復(fù)制代碼
Undefined subroutine &Ext::Utils::sort2name called at
/var/www/extsuite/extmail/libs/Ext/App/Folders.pm line 387.
</>復(fù)制代碼
[root@node1 Ext]# cd /var/www/extsuite/extmail/libs/Ext
[root@node1 Ext]# cp Utils.pm /var/www/extsuite/extman/libs/
[root@node1 Ext]# cd /var/www/extsuite/extman/libs/Ext
[root@node1 Ext]# mv Utils.pm ManUtils.pm
[root@node1 Ext]# /var/www/extsuite/extmail/dispatch-init stop
[root@node1 Ext]# /var/www/extsuite/extmail/dispatch-init start
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://m.specialneedsforspecialkids.com/yun/129437.html
摘要:打包工具是眾多的開發(fā)工具之一,下面千鋒重慶的小編來進(jìn)行打包工具的介紹打包工具的介紹開源是一個安裝程序制作工具,能夠制作一些簡單的安裝程序。是全球領(lǐng)先的安裝開發(fā)解決方案。通過上述介紹相信大家對打包工具已經(jīng)有所了解 Java打包工具是眾多的Java開發(fā)工具之一,下面千鋒重慶Java的小編來進(jìn)行Java打包工具的介紹:Java打...
摘要:安裝包老是失敗,今天發(fā)現(xiàn)一個更好的包安裝工具,可以用這個來管理我們的包。是最近發(fā)布的一款依賴包安裝工具。在官方介紹里有這么一句話關(guān)鍵意思就是,快速安全可靠。如同聲稱,快速,可靠,安全。原文地址的安裝與使用詳細(xì)介紹 npm安裝包老是失敗,今天發(fā)現(xiàn)一個更好的包安裝工具Yarn,可以用這個來管理我們的包。不知道大家有沒有覺察到Facebook近年大招頻出。Yarn是Facebook最近發(fā)布的...
摘要:相關(guān)鏈接官方文檔安裝推薦使用安裝,命令如下運(yùn)行完畢之后即可完成的安裝。上一篇文章網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)數(shù)據(jù)庫的安裝下一篇文章網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)庫的安裝 上一篇文章:Python3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)---4、數(shù)據(jù)庫的安裝:MySQL、MongoDB、Redis下一篇文章:Python3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)---6、Web庫的安裝:Flask、Tornado 在前面一節(jié)我們介紹了幾個數(shù)據(jù)庫的安裝方式,但這僅僅是用來存...
摘要:介紹說明的包管理器,用于插件管理包括安裝卸載管理依賴等使用安裝插件命令提示符執(zhí)行插件名稱。總結(jié)安裝新建文件全局和本地安裝安裝插件新建文件通過命令提示符運(yùn)行任務(wù)。 showImg(https://segmentfault.com/img/remote/1460000010873466); 前言 眾所周知目前比較火的工具就是gulp和webpack,但webpack和gulp卻有所不同,本...
閱讀 1357·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1907·2023-01-11 13:20
閱讀 4165·2023-01-11 13:20
閱讀 2758·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3673·2023-01-11 13:20