当前位置:网站首页 / Linux / 正文

Linux运维实战——Centos安装Postfix用于发送提醒邮件

时间:2017年02月05日 | 作者 : liuhui | 分类 : Linux | 浏览: 7607次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

1. 卸载sendmail,没有安装sendmail的跳过

yum remove sendmail


2. 安装 Postfix

yum install postfix


3. 更改默认MTA为Postfix

/usr/sbin/alternatives --set mta /usr/sbin/sendmail.postfix


4. 检查是否将MTA改为Postfix

alternatives --display mta


5. 配置Postfix,修改main.cf

vi /etc/postfix/main.cf


查找以下各项,去掉最前面的#,参考说明修改

myhostname = www.ifshow.com
mydomain = ifshow.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relay_domains =
home_mailbox = Maildir/


myhostname是服务器的主机名,mydomain是域名,myorigin定义邮箱后缀,inet_interfaces是指定使用的网络接口,relay_domains是转发域留空,home_mailbox是指定邮箱格式。

6. 启动Postfix并设为开机自启

Centos7

systemctl start postfix.service
systemctl enable postfix.service


Centos6.x

chkconfig --add postfix
chkconfig postfix on

service postfix restart

到此完成配置,其它服务已经能够通过postfix发送提醒邮件。
由于只发邮件,所以防火墙不必开启POP3、SMTP等服务端口。

本文转自 极客FAN

本文链接:http://geekfan.top/post/65.html


推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信