一.基于ip的认证
由于sendmail与postfix的服务端口相同,所以,必须暂停sendmail服务
,为了不受影响,一般建议直接卸载掉!
1.安装postfix

[root@mail ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@mail ~]# cd /mnt/cdrom/Server

[root@mail Server]# service postfix start
Starting postfix: [ OK ]
[root@mail Server]# chkconfig postfix on
[root@mail Server]# chkconfig --list |grep postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@mail Server]# netstat -tupln |grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5167/master
2.查看其特定参数
[root@mail postfix]# postconf –n //可被修改的参数
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
html_directory = no
inet_interfaces = localhost
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
[root@mail postfix]# postconf –d //默认参数
[root@mail postfix]# postconf //刚被生效的参数
[root@mail postfix]# man 5 postconf // 可查看配置文档
[root@mail postfix]# postconf -e “参数=值”
3. 配置postfix主配置文件
[root@mail postfix]# vim /etc/postfix/main.cf




基于ip认证

[root@mail postfix]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.163.com ESMTP Postfix
mail from:user1@163.com
250 2.1.0 Ok
rcpt to:user4@sina.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
hahaha
.
250 2.0.0 Ok: queued as 601D1BE18C
quit
221 2.0.0 Bye
Connection closed by foreign host.
接收查看:



4.发邮件测试:

接收邮件:

