手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux下架构安全邮件服务器之Postfix(认证)

[日期:2012-09-14] 来源:Linux社区  作者:gjp0731 [字体:大 中 小]

一.基于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.发邮件测试:

接收邮件:

linux
相关资讯       邮件服务器  Postfix 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款