Chinaunix首页 | 论坛 | 博客
  • 博客访问: 487716
  • 博文数量: 82
  • 博客积分: 3003
  • 博客等级: 中校
  • 技术积分: 1285
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-11 15:27
文章分类

全部博文(82)

文章存档

2011年(1)

2010年(5)

2009年(63)

2008年(13)

我的朋友

分类: LINUX

2008-11-12 19:25:02

PDF下载

文件:安装postfix并配置发信验证功能.pdf
大小:125KB
下载:下载


安装postfix并配置发信验证功能


撰写者信息

Alin Fang (Fang Yunlin)

MSN:

G Talk:

Blog: http://www.alinblog.cn/


修改日期

12 Nov, 2008

1次修改



版权

GNU


声明

本人实验笔记,非权威文档。如有错误请告知。十分感谢!


重要声明


所有环境同搭建 smtp + pop3 服务器实验笔记(sendmail + dovecot)


这次实验笔记只是记录把sendmail换成postfix的操作方法


不讲理论,只有操作步骤。


如果想从头看起,请先看搭建 smtp + pop3 服务器实验笔记(sendmail + dovecot)



实验步骤

mail.apple.com上操作


安装postfix,停止sendmail提供服务,改用postfix

[root@mail ~]# cd /misc/cd/Server

[root@mail Server]# rpm -ivh postfix-2.3.3-2.i386.rpm

warning: postfix-2.3.3-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:postfix ########################################### [100%]

[root@mail Server]# service sendmail stop

Shutting down sm-client: [ OK ]

Shutting down sendmail: [ OK ]

[root@mail Server]# service postfix start

Starting postfix: [ OK ]

[root@mail Server]# chkconfig --level 35 sendmail off

[root@mail Server]# chkconfig --level 35 postfix on

[root@mail Server]# alternatives --config mta


There are 2 programs which provide 'mta'.


Selection Command

-----------------------------------------------

*+ 1 /usr/sbin/sendmail.sendmail

2 /usr/sbin/sendmail.postfix


Enter to keep the current selection[+], or type selection number: 2

[root@mail Server]# alternatives --config mta


There are 2 programs which provide 'mta'.


Selection Command

-----------------------------------------------

* 1 /usr/sbin/sendmail.sendmail

+ 2 /usr/sbin/sendmail.postfix


Enter to keep the current selection[+], or type selection number:

[root@mail Server]#



配置postfix,允许监听所有网段和IP


[root@mail Server]# cd /etc/postfix/

[root@mail postfix]# ls

access header_checks makedefs.out post-install virtual

bounce.cf.default LICENSE master.cf relocated

canonical main.cf postfix-files TLS_LICENSE

generic main.cf.default postfix-script transport

[root@mail postfix]#


postfix的主要配置文件是main.cf

修改main.cf

inet_interfaces = localhost

改成

inet_interfaces = all


#myhostname = host.domain.tld

改成

myhostname = mail.apple.com


#mydomain = domain.tld

改成

mydomain = apple.com


mydestination = $myhostname, localhost.$mydomain, localhost

改成

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


保存退出。

重启postfix使新配置生效。

[root@mail postfix]# service postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail postfix]# netstat -ntpal | grep :25

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 4096/master

[root@mail postfix]# ps -ef | grep postfix

root 4096 1 0 02:37 ? 00:00:00 /usr/libexec/postfix/master

postfix 4098 4096 0 02:37 ? 00:00:00 pickup -l -t fifo -u

postfix 4099 4096 0 02:37 ? 00:00:00 qmgr -l -t fifo -u

root 4103 3331 0 02:37 pts/0 00:00:00 grep postfix

[root@mail postfix]#


测试发送邮件

[root@mail postfix]# telnet mail.apple.com 25

Trying 127.0.0.1...

Connected to localhost.localdomain (127.0.0.1).

Escape character is '^]'.

220 mail.apple.com ESMTP Postfix

helo mail.apple.com

250 mail.apple.com

mail from:

250 2.1.0 Ok

rcpt to:

250 2.1.5 Ok

data

354 End data with .

From: alin

To: alin

Subject: Hello


Red Hat

.

250 2.0.0 Ok: queued as 8ADDB1638B1

quit

221 2.0.0 Bye

Connection closed by foreign host.



查收邮件

You have mail in /var/spool/mail/root

[root@mail postfix]# mail

Mail version 8.1 6/6/93. Type ? for help.

"/var/spool/mail/root": 1 message 1 new

>N 1 alin@mail.apple.com Thu Nov 13 02:41 15/494 "Hello"

&

Message 1:

From root@mail.apple.com Thu Nov 13 02:41:48 2008

X-Original-To: root@apple.com

Delivered-To: root@apple.com

From: alin@mail.apple.com

To: alin@mail.apple.com

Subject: Hello

Date: Thu, 13 Nov 2008 02:41:03 +0800 (CST)


Red Hat


&


main.cf配置文件里面添加相关参数开启发信验证功能

[root@mail postfix]# ls

access header_checks makedefs.out post-install virtual

bounce.cf.default LICENSE master.cf relocated

canonical main.cf postfix-files TLS_LICENSE

generic main.cf.default postfix-script transport

[root@mail postfix]# grep smtpd_sasl main.cf.default

smtpd_sasl_auth_enable = no

smtpd_sasl_authenticated_header = no

smtpd_sasl_exceptions_networks =

smtpd_sasl_local_domain =

smtpd_sasl_path = smtpd

smtpd_sasl_security_options = noanonymous

smtpd_sasl_tls_security_options = $smtpd_sasl_security_options

smtpd_sasl_type = cyrus

[root@mail postfix]# grep smtpd_sasl main.cf.default >> main.cf

[root@mail postfix]#

修改main.cf配置文件

smtpd_sasl_auth_enable = no

改为

smtpd_sasl_auth_enable = yes


重启postifx使配置生效

[root@mail postfix]# service postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail postfix]#


开启slsa验证服务

[root@mail postfix]# service saslauthd restart

Stopping saslauthd: [FAILED]

Starting saslauthd: [ OK ]

[root@mail postfix]# chkconfig --level 35 saslauthd on

[root@mail postfix]#


mail.orange.com上操作

mail.orange.com上同mail.apple.com一样配置postfix

操作步骤省略。




阅读(2473) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~