秀米云香港服务器

一、先卸载sendmain[root@ser ~]#yum remove sendmail二、安装postfix ,dovecot,cyrus-sasl[root@ser ~]#yum -y install postfix[root@ser ~]#yum -y install dovecot[root@ser ~]#yum -y install cyrus-sasl四、 修改postfix的配置文件[root@ser ~]# vim /etc/postfix/main.cf

myhostname = mail.yjw.commydomain = yjw.commyorigin = yjw.cominet_interfaces =allmynetworks = 192.168.1.0/24relay_domains = yjw.com, $mydomainmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain,www.$mydomain,ftp.$mydomain重启 postfix 服务

序列号 CPU RAM HDD 带宽 售价(美元) 免费试用
香港服务器1 E5-2620 32G 1T HDD 50M/无限流量 $196.00 立即申请
香港服务器2 E5-2650 32G 1T HDD 50M/无限流量 $256.00 立即申请
香港服务器3 E5-2680 32G 1T HDD 50M/无限流量 $316.00 立即申请
香港服务器4 E5-2690 32G 1T HDD 50M/无限流量 $336.00 立即申请
香港服务器5 E5-2697 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器6 E5-2620*2 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器7 E5-2650*2 32G 1T HDD 50M/无限流量 $436.00 立即申请
香港服务器8 E5-2680*2 32G 1T HDD 50M/无限流量 $476.00 立即申请
香港服务器9 E5-2690*2 32G 1T HDD 50M/无限流量 $556.00 立即申请
香港服务器10 E5-2697*2 32G 1T HDD 50M/无限流量 $596.00 立即申请
香港服务器11 E5-2680v4*2 32G 1T HDD 50M/无限流量 $696.00 立即申请
香港服务器12 E5-2698v4*2 32G 1T HDD 50M/无限流量 $796.00 立即申请

[root@ser ~]# service postfix restartShutting down postfix: [OK]Starting postfix: [OK][root@ser ~]# chkconfigpostfix on[root@ser ~]# chkconfigdovecot on修改dovecot的配置文件vim /etc/dovecot.confprotocols = imap imapspop3 pop3slisten = *在iptables 里开放25,110,143端口[root@ser ~]# vim /etc/sysconfig/iptables-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT重启iptables[root@ser ~]# service iptables restartFlushing firewall rules: [OK]Setting chains to policy ACCEPT: filter [OK]Unloading iptables modules: [OKApplying iptables firewall rules: [OK]Loading additional iptables modules: ip_conntrack_netbios_n[OK]ntrack_ftp[root@ser ~]# yum -y install cyrus-sasl[root@ser ~]# chkconfigsaslauthd on修改 /etc/sysconfig/saslauthd[root@ser ~]# vim /etc/sysconfig/saslauthd

# Directory in which to place saslauthd's listening socket, pid file, and so# on.This directory must already exist.SOCKETDIR=/var/run/saslauthd

# Mechanism to use when checking passwords.Run "saslauthd -v" to get a list# of which mechanism your installation was compiled with the ablity to use.MECH=shadow

# Additional flags to pass to saslauthd on the command line.See saslauthd(8)# for the list of accepted flags.FLAGS=修改 /usr/lib/sasl2/smtpd.conf[root@ser ~]# vim /usr/lib/sasl2/smtpd.confpwcheck_method: saslauthd测试 saslauthd[root@ser ~]# service saslauthdrestart[root@ser ~]# testsaslautd-u yjw -p '020304'0: OK "Success."在postfix 的配置文件中,添加以下内容,使其支持SMTP认证[root@ser ~]#vim /etc/postfix/main.cfmessage_size_limit = 1073741824 # 邮件的大小为10Mdefault_process_limit = 50default_destination_concurrency_limit = 20

smtpd_sasl_auth_enable = yessmtpd_sasl_local_domain =$myhostname

smtpd_sasl_application_name = smtpd

broken_sasl_auth_clients = yessmtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,reject_unauth_destinationsmtpd_client_restrictions = permit_sasl_authenticatedsmtpd_sasl_security_options = noanonymous测试 25端口[root@ser ~]#telnet mail.yjw.com 25Trying 192.168.1.2...Connected to mail.yjw.com (192.168.1.2).Escape character is '^]'.220 mail.yjw.com ESMTP PostfixEHLO163.com250-mail.yjw.com250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSNquit221 2.0.0 ByeConnection closed by foreign host.[root@ser ~]#五、安装openwebmail[root@ser ~]# vim /etc/yum.repos.d/openwebmail.repo[openwebmail]## Thomas Chung## 2008.05.29name=Openwebmail for Fedora or Enterprise Linuxbaseurl=http://openwebmail.org/openwebmail/download/redhat/rpm/release/enabled=1gpgcheck=1gpgkey=http://openwebmail.org/openwebmail/download/redhat/rpm/release/RPM-GPG-KEY-openwebmail#metadata_expire=0若这样安装不成功,先安装 perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm[root@ser ~]#yum -yinstall openwebmail[root@ser ~]# cd /var/www/cgi-bin/openwebmail/[root@ser openwebmail]# ./openwebmail-tool.pl--init#出现Y/N时 ,按N.修改openwebmail 的一些配置文件[root@ser etc]# vim dbm.confdbm_ext .dbdbmopen_ext .dbdbmopen_haslock no[root@ser etc]]# cd defaults/[root@ser defaults]#vim dbm.confdbm_ext .dbdbmopen_ext .dbdbmopen_haslock yessmtpserver192.168.1.2[root@ser defaults]#vim openwebmail.confdomainnames yjw.comsmtpserver 192.168.1.2authpop3_server 192.168.1.2再次初始化openwebmail[root@ser defaults]# cd../../openwebmail-tool.pl--init出现Y/N 时,按Y。

把Postfix+Dovecot+Openwebmail 三者个格式统一下就行了1.postfix 配置 main.cfmail_spool_directory = /var/spool/mail2.Dovecot 配置 Dovecot.confmail_location = mbox:~/mail:INBOX=/var/spool/mail/%u3.Openwebmail.confmailspooldir /var/spool/mail

六、安装httpd[root@ser ~]# yum y install httpd[root@ser ~]# chkconfig httpd on[root@ser ~]# service httpd restartStopping httpd: [OK]Starting httpd: [OK][root@ser ~]# vim /etc/httpd/conf/httpd.confServerAdminroot@yjw.comServerNamemail.yjw.com:80AddHandler cgi-script .cgi .pl七、登陆openwebmail.在IE 中输入mail.yjw.com/cgi-bin/openwebmail/openwebmail.pl,这个地址是不是很长,那么我们来点短点的在httpd的 配置文件中添加 下面 内容:ScriptAlias/mail /var/www/cgi-bin/openwebmail/openwebmail.pl这样在IE 中直接输入mail.yjw.com/mail八、安装反垃圾邮件软件,MailScanner到MailScanner .org 上下载MailScanner-4.75.11-1.rpm.tar.gz[root@ser ~]#tar zxvfMailScanner-4.75.11-1.rpm.tar.gz[root@ser ~]#cdMailScanner-4.75.11[root@ser MailScanner-4.75.11-1]# ./install.sh # 安装安装 spamassassin先检查您的系统内是否已经安装SpamAssassin软件包。在文本终端中输入:[root@ser ~]# rpm -qa | grep spamassassinspamassassin-3.1.9-1.el5下载Mail-SpamAssassin-3.2.5.tar.gz[root@ser ~]#tar-zxvf Mail-SpamAssassin-3.2.5.tar.gz[root@ser ~]# cd Mail-SpamAssassin-3.2.5[root@ser ~]# perl Makefile.PL[root@ser ~]# make[root@ser ~]#make install打开/etc/MailScanner/目录中的MailScanner.conf文件,主要说明修改的关键部分:%org-name%= yjw.com%org-long-name% = yjwweb-site% = mail.yjw.comRun As User = postfixRun As Group = postfixIncoming Queue Dir = /var/spool/postfix/holdOutgoing Queue Dir = /var/spool/postfix/incomingMTA = postfixIncoming Work Group = postfixQuarantine User = postfixQuarantine Group = postfixAlways Include SpamAssassin Report = yesSpamAssassin User State Dir = /var/spool/MailScanner/spamassassinSpamAssassin Install Prefix = /usr/binLog Speed = yesLog Spam = yesLog Silent Viruses = yesPhishing Modify Subject = yes更改incoming,quarantine 两个2个目录[root@ser ~]# service spamassassin restart[root@ser ~]# service spamassassin on[root@ser ~]# service MailScannerrestart[root@ser ~]# service MailScanneron[root@ser ~]# chown -R postfix:postfix /var/spool/MailScanner/*[root@ser ~]# cd /var/spool/MailScanner/[root@ser MailScanner]# lldrwxr-xr-x 4 postfix postfix 4096 Apr 30 16:56 incomingdrwxr-xr-x 3 postfix postfix 4096 Apr 29 19:10 quarantinedrwx-----2 postfix postfix 4096 Apr 30 15:58 spamassassin在/etc/postfix/header_checks 中增加一句话:[root@ser ~]# vi/etc/postfix/header_checks/^Received:/ HOLD设置中文邮件过滤规则[root@ser ~]# wget -N -Phttp://www.ccert.edn.cn/spam/sa/Chiese_rules.cf/usr/share/spamassassin使用计划任务来更新规则[root@ser ~]#crontab-e0 0 1 * * wget N-P /usr/share/spamassassinhttp://www.ccert.edu.cn/spam/sa/Chiness_rules.cf;/etc/init.d/spamassassin restart九、登陆openwebmail, 测试 收信,发信是否正常[root@ser ~]# useraddtom[root@ser ~]# passwdtomtomtom[root@ser ~]# useradd yjw[root@ser ~]# passwdyjw

标题:CentOS系统中安装配置Postfix+dovecot+openwebmail邮件服务器

地址: https://www.yunhk.xyz/25325.html