Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

postfix邮件服务器

来源: 奔跑的男孩 分享至:

Postfix. 1

安装postfix. 1

dns 1

开启postfix. 3

邮件的收发... 4

身份验证sasl... 4

启用sasl认证... 4

更改postfix配置文件添加验证... 5

通过验证发送邮件... 5

接收邮件... 6

限定用户的安全认证... 6

Postfix

安装postfix

[root@linuxso.com ~]# cd /mnt/cdrom/Server/

[root@linuxso.com ~]# cd /var/named/chroot/etc

[root@linuxso.com ~]# service named start

[root@linuxso.com ~]# chkconfig named on

[root@linuxso.com ~]# service postfix restart

Shutting down postfix:                                     [  OK  ]

Starting postfix:                                          [  OK  ]

[root@linuxso.com ~]# stat.html' target='_blank'>netstat -tupnl |grep 25

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      4269/master        

[root@linuxso.com ~]#

 

Main.cf

Man 5 配置脚本

Man 1 用户命令

man 8 x系统管理

man postconf

man 5 postconf

[root@linuxso.com ~]# vim /etc/postfix/main.cf

110 inet_interfaces = all

[root@linuxso.com ~]# service postfix restart

Shutting down postfix:                                     [  OK  ]

Starting postfix:                                          [  OK  ]

[root@linuxso.com ~]# netstat -tupln |grep 25

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

 

[root@linuxso.com ~]#netstat --倒数第一个最近使用的netstat命令

 

[root@linuxso.com ~]# vim /etc/postfix/main.cf

70 myhostname = mail.bj.com

77 mydomain = bj.com

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

--按地址段的中继

257 mynetworks = 168.100.101.0/24, 127.0.0.0/8  --接收mail的网段

[root@linuxso.com ~]# service postfix restart

Shutting down postfix:                                     [  OK  ]

Starting postfix:                                          [  OK  ]

[root@linuxso.com ~]#  dd.html' target='_blank'>useradd user1

[root@linuxso.com ~]#  useradd user2

[root@linuxso.com ~]# passwd user1

[root@linuxso.com ~]# passwd user2

邮件的收发

[root@linuxso.com ~]# mail user1@linuxso.com ~]$ mail

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

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

>N  1 root@linuxso.com ~]# rpm -qa |grep sasl

cyrus-sasl-2.1.22-4

cyrus-sasl-lib-2.1.22-4

cyrus-sasl-plain-2.1.22-4

cyrus-sasl-devel-2.1.22-4

[root@linuxso.com ~]# service saslauthd start

Starting saslauthd:                                        [  OK  ]

[root@linuxso.com ~]# cd /usr/lib/sasl2/

更改postfix配置文件添加验证

[root@linuxso.com ~]# echo -n "user1@linuxso.com ~]# echo -n "123"|openssl base64

MTIz

 

[root@linuxso.com ~]# su - user2

[user2@linuxso.com ~]$ mail

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

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

>N  1 user1@linuxso.com ~]# vim /etc/postfix/main.cf

257 mynetworks = 192.168.101.0/24 127.0.0.0/8

671 broken_sasl_auth_clients = yes

672 smtpd_sasl_auth_enable = yes

673 smtpd_sasl_security_options = noanonymous

674 smtpd_sasl_application_name = smtpd

676 smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,

677  reject_unauth_destination

678 smtpd_client_restrictions = permit_sasl_authenticated,reject

--所有用户都要验证的,验证的通过 ,不验证的拒绝发送邮件。

[root@linuxso.com ~]# service postfix restart

 

[root@linuxso.com ~]# echo -n "user1@linuxso.com ~]# echo -n "123"|openssl base64

MTIz

[root@linuxso.com ~]# telnet mail.bj.com 25

Trying 192.168.101.9...

Connected to mail.bj.com (192.168.101.9).

Escape character is '^]'.

220 mail.bj.com ESMTP Postfix

mail from:user1@linuxso.com ~]$ mail

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

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

>N  1 user1@linuxso.com ~]# mail user1@linuxso.com ~]# tail /var/log/maillog

Aug 27 19:59:43 mail postfix/cleanup[5974]: BA6164ADADF: message-id=<20110827115917.BA6164ADADF@linuxso.com ~]#

 

 


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史