postfix实验

postfix实验

检查安装

是否安装主程序postfix
[root@mail ~]# rpm -qa postfix
postfix-2.10.1-6.el7.x86_64

没有请使用yum -y installl postfix

是否支持 cyrus dovecot 功能
[root@mail ~]# postconf -a
cyrus
dovecot

备份主配置文件

[root@mail ~]# cp /etc/postfix/main.cf{,_bak}

修改主配置文件

[root@mail ~]# vim /etc/postfix/main.cf
注:前面的数字是行号
76 myhostname = mail.testmail.com
85 mydomain = testmail.com
100 myorigin = $mydomain
114 inet_interfaces = all
252 mynetworks_style = host
265 mynetworks = 172.16.1.0/24, 127.0.0.0/8
297 relay_domains = $mydestination
420 home_mailbox = Maildir/


检查配置

[root@mail ~]# postfix check
[root@mail ~]#

重启服务

[root@mail ~]# systemctl restart postfix
[root@mail ~]# ss -lntu |grep 25
tcp    LISTEN     0      100    127.0.0.1:25                    *:*                  
tcp    LISTEN     0      100     ::1:25                   :::* 

邮件简单外发测试

添加用户

[root@mail ~]# useradd zxa
[root@mail ~]# echo '123456' |passwd --stdin zxa
Changing password for user zxa.
passwd: all authentication tokens updated successfully.

安装 Telnet 服务

[root@mail ~]# yum -y install telnet

测试

[root@mail ~]# telnet mail.testmail.com 25
Trying 172.16.1.27...
Connected to mail.testmail.com.
Escape character is '^]'.
220 mail.testmail.com ESMTP Postfix
mail from:zxz^Ha
250 2.1.0 Ok
rcpt to:2803894114@qq.com
250 2.1.5 Ok
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值