Linux服务器---邮件服务postfix安装

安装postfix

postfix 是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。

1 、安装postfix 

[root@localhost ~]#  rpm -qa | grep postfix

[root@localhost ]#  yum install -y postfix

Loaded plugins: fastestmirror, refresh-packagekit, security                                                 

Complete!

[root@localhost]#

 

2 、配置postfix,编辑配置文件“/etc/postfix/main.cf”

[root@localhost ~]#  gedit /etc/postfix/main.cf

mydomain = david.cn      //dns 中的域名

myhostname = mailsrv.david.cn  //dns 中的域名

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

inet_interfaces = all   // 允许处理所有网路信息

inet_protocols = all    // 允许 ipv4 ipv6

mynetworks = 192.168.0.0/24, 127.0.0.0/8     // 允许接入的 ip

 

3 、设置防火墙,postfix使用25端口 

[root@localhost ~]#  gedit /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT

 

[root@localhost ~]#  service iptables restart

iptables :将链设置为政策  ACCEPT filter nat                [ 确定 ]

iptables :清除防火墙规则:                                  [ 确定 ]

iptables :正在卸载模块:                                    [ 确定 ]

iptables :应用防火墙规则:                                  [ 确定 ]

iptables :载入额外模块: nf_conntrack_ftp                   [ 确定 ]

 

4 、启动服务

[root@localhost ~]#  service postfix start

启动 postfix                                              [ 确定 ]

[root@localhost ~]#

 

5 、连接测试

[root@localhost ~]#  telnet 192.168.0.113 25    //ip 是本机地址, 25 是端口号

Trying 192.168.0.113...

Connected to 192.168.0.113.

Escape character is '^]'.

220 mailsrv.david.cn ESMTP Postfix

 

6 、发信

[root@localhost ~]#  mail david     // david 发信,确保此用户存在 Linux 系统中。发信人是当前登录的用户 root

Subject: test04       // 标题

hello david           // 内容

.                       // 结束

EOT

[root@localhost ~]#  mail -u david      // 查看用户 david 的信件

Heirloom Mail version 12.4 7/29/08.  Type ? for help.

"/var/mail/david": 5 messages 1 new

    1 root                  Thu Aug 16 17:07  21/692   "test"

    2 root                  Thu Aug 16 17:08  20/631   "test"

    3 root                  Thu Aug 16 17:10  20/602   "test"

    4 root                  Fri Aug 17 08:15  20/570   "test3"

>N  5 root                  Fri Aug 17 09:46  18/539   "test04"    // 此信件是刚才收到的,由 root 用户发出

&

 


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29270124/viewspace-2286340/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29270124/viewspace-2286340/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值