首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

邮件服务器

技术前沿 | Exchange | Domino | Sendmail | Postfix | Qmail | IMail | MDaemon | Foxmail | James | Kerio | JavaMail | WinMail | Winwebmail | Merak | CMailServer | 金笛 | 其它 | 邮件与开发 |
首页 > 邮件服务器 > Postfix > Postfix电子邮局的配置步骤 > 正文
金笛邮件系统

Postfix电子邮局的配置步骤

出处:51CTO论坛 作者:ankey 时间:2006-10-24 21:12:00
简单三步解决企业垃圾邮件难题
 

环境:RedHat Linux+Postfix+Cyrus-sasl+Dovecot+Stunnel

在安装Linux时,如果选择全部安装的话,Postfix与Dovecot以及Stunnel将会自动给予安装上去,查看是否已安装,可以执行如下命令:

rpm –qa | grep postfix或dovecot或stunnel

如果没有的话,请直接在光盘里找出来,并给予安装。这里以RPM包安装为列,安装命令如下:

rpm –ivh postfix-*.rpm  或

rpm –ivh cyrus-sasl-*.rpm 或

rpm –ivh dovecot-*.rpm 或

rpm-ivh stunnel-*.rpm
这里的*代表的是相关的版本号。

在确认这些安装包已安装到系统里后,现在开始配置Mail服务。

首先,请停止系统内自带的Mail服务-Sendmail,执行如下命令:
/etc/init.d/sendmail stop      //先停止sendmail进程

chkconfig sendmail off       //再把自启动服务去掉


一:配置Cyrus-sasl

确定已安装完Cyrus-sasl后,启动该服务:
/etc/init.d/saslauthd start     //启动Cyrus-sasl服务。

chkconfig saslauthd on      //把Cyrus-sasl设置为开机自启动。
测试一下是否成功:
testsaslauthd –u 系统用户名 –p ‘对应的密码’或

/usr/sbin/testsaslauthd –u 系统用户名 –p ‘对应的密码’



如果提示:

0: OK "Success."

则说明已安装成功!

注:Cyrus-sasl的功能就是实现密码验证机制。

二:配置SMTP

现在,开始配置Postfix,Postfix的功能就是实现SMTP服务,也即信件发送服务。Postfix的主要配置文档是/etc/postfix/main.cf,如果没看到mail.cf文档则请执行:
cp /etc/postfix/main.cf.default /etc/postfix/main.cf
然后修改main.cf的相关内容。具体内容如下:
alias_database = hash:/etc/aliases

alias_maps = hash:/etc/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/libexec/postfix

debug_peer_level = 2

header_checks = regexp:/etc/postfix/header_checks

html_directory = no

mailbox_size_limit = 102400000

mailq_path = /usr/bin/mailq.postfix

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

mydomain = 域名

myhostname = mail.域名

mynetworks = 192.168.1.0/24, 127.0.0.0/8, 192.168.1.100/32

myorigin = $mydomain

newaliases_path = /usr/bin/newaliases.postfix

readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES

relay_domains = nanoconcept.net

sample_directory = /usr/share/doc/postfix-1.1.11/samples

sendmail_path = /usr/sbin/sendmail.postfix

setgid_group = postdrop

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain= ''

smtpd_recipient_restrictions =

permit_sasl_authenticated

permit_auth_destination

permit_mynetworks

check_relay_domain

reject_rbl_client yahoo.com.tw

reject_rbl_client cbl.anti-spam.org.cn

reject_rbl_client cdl.anti-spam.org.cn

reject_rbl_client cblplus.anti-spam.org.cn

reject_non_fqdn_sender

reject_non_fqdn_recipient

reject_unknown_sender_domain

reject_unknown_recipient_domain

reject

broken_sasl_auth_clients = yes

smtpd_client_restrictions = permit_sasl_authenticated

smtpd_recipient_restrictions = permit_sasl_authenticated

smtpd_sasl_security_options=noanonymous

unknown_local_recipient_reject_code = 550



Postfix配置文件默认情况下,没有启用SMTP认证机制,所以,需要修改postfix的主配置main.cf文件,也即上面以smtpd开头的,这些就是实现SMTP功能的配置内容!

现在可以启动postfix服务:
/etc/init.d/postfix start       //启动postfix服务

chkconfig postfix on//设置postfix开机自启动。


可以通过netstat –ntl进行查看SMTP的端口(25)是否起来。

然后就可以进行测试是否能发信,如果不行的话,请查看一下:

/usr/lib/sasl2下是否存在着smtpd.conf与Sendmail.conf两个文件,其内容为:


[root@xtmail sasl2]# cat Sendmail.conf

pwcheck_method:saslauthd

与:

[root@xtmail sasl2]# cat smtpd.conf

pwcheck_method: saslauthd


但有时候,Postfix无法自动找到saslauthd的路径,所以需要在smtpd.conf里添加一条:


saslauthd_path:/var/run/saslauthd/mux


三:配置POP3

Dovecot的功能就是实现收信功能,即POP3功能。在安装Dovecot的RPM包后,Dovecot的配置文件是在/etc/下的dovecot.conf

为了能让Dovecot正常使用,需要修改一下dovecot.conf的些配置。具体如下:


protocols = pop3

pop3_listen = [::]

login = imap

login = pop3

mbox_locks = fcntl

auth = default

auth_mechanisms = plain

auth_userdb = passwd

auth_user = root


完后,请运行以下命令:
/etc/init.d/dovecot start           //启动Dovecot服务

chkconfig dovecot on            //设置开机自启动
四:端口加密

现在就把一台具有SMTP与POP3功能的邮局配置完毕。当然了,这台只具备简单的SMTP与POP3功能的邮局,现在要对其进行端口加密。也就是提到的 Stunnel。Stunnel的配置文件是在/etc/stunnel/stunnel.conf,里面已有SMTP与POP3的进行端口加密。一般只要直接启动起来就可以了。具体形式如下:

/etc/init.d/stunnel      //启动stunnel

如果是用tar.gz进行编译的话,有时在启动stunnel时,需要带上stunnel.conf的绝对路径!

五:检查端口是否正常开启

现在一套完整的Postfix邮局已配置完毕,可以投入正常使用。可以通过 netstat –ntl进行查看到25、110、465、995这几个端口的存在。其中25端口加密后就是465,110加密后就是995,110端口只是一个与客户端连接的,可以禁止掉。25端口不可以屏蔽掉,因为Mail服务器之间在互相传输时,还是使用25端口的。

相关文章 热门文章
  • 9.4 启动和停止Postfix服务
  • 9.3.1 postfix服务的基本配置
  • 9.2 Postfix邮件服务的安装
  • 18.16 Postfix邮件系统
  • 正确配置Postfix来阻止垃圾邮件
  • Postfix 电子邮件系统精要
  • Postfix配置Step By Step(完成篇)
  • Postfix配置Step By Step(三)
  • Postfix配置Step By Step(二)
  • Postfix配置Step By Step(一)
  • Postfix邮件系统的安装与配置
  • 用Postfix架设FreeBSD下中小规模邮件系统
  • Install and configure Postfix with Cyrus-SASL+Cyrus-IMAP+MySQL
  • 在FreeBSD上建立一个功能完整的邮件服务器
  • postfix 邮件病毒过滤
  • 在Fedora上建立自己的邮件服务器
  • Postfix + SpamAssassin 安裝手冊
  • Postfix + Courier-IMAP + Cyrus-SASL + MySQL + IMP完全指南(新版)
  • Postfix + Cyrus-SASL + Cyrus-IMAPD + PgSQL HOWTO
  • 在FreeBSD5.1簡單安裝Postfix+Qpopper+Openwebmail
  • 在RHEL 4 上配置全功能的Postfix 服务器
  • Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP 完全指南
  • 我的POSTFIX安装笔记
  • Postfix电子邮局的配置步骤
  • 自由广告区
     
     
    WINMAIL 让您轻松架设邮件系统
    eqmail
    最新软件下载
  • ORF Enterprise Edition 3.01
  • ORF Enterprise Edition 4.2 正式版
  • IMail Server 10.01
  • WinWebMail 3.7.7.1 企业版
  • WinWebMail 3.7.7.1 标准版
  • GmailStore网络邮盘 3.1.7 简体中文版
  • POP Peeper 3.2
  • GcMail 4.1.7.1
  • The Bat! Pro 4.0.18 多国语言特别版
  • Advanced Emailer 4.2 特别版
  • CheckMail 5.0.1 特别版
  • SPAMfighter Pro 6.2.41 多国语言版
  • 今日邮件技术文章
  • Exchange Server 2007 连续复制深度解析
  • 垃圾邮件喜欢什么样的邮箱?
  • 微软阿里软件共推企业邮局服务
  • Websense在中国正式启动反垃圾邮件计划
  • 发邮件也玩代理!妙用转发器发匿名邮件
  • 菜鸟变高手:加密最安全解密最潇洒
  • Windows 2008之PKI实战1:管理
  • Windows 2008之PKI实战2:注册和漫游
  • Windows 2008之PKI实战3:证书服务
  • Windows 2008之PKI实战4:吊销
  • 新希望之旅 Windows EBS 2008体验
  • 思科收购企业电子邮件厂商死磕微软
  • 最新专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • 移动电子邮件专题
  • Apache James 专题
  • IMail Server 操作指南
  • ISA Server 2004 使用专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2007 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号