搭建postfix邮箱服务器
来源:互联网 发布:coreldraw x6软件下载 编辑:程序博客网 时间:2024/05/16 11:23
1:修改hostname(先关闭防火墙)
修改教程http://blog.csdn.net/weeknd/article/details/74202118
格式是mail.xxx.com
2:解析DNS[root@mail ~]# hostname
mail.fa.com[root@mail ~]# more /proc/sys/kernel/hostname
mail.fa.com[root@mail ~]# host fa.com
fa.com has address 178.77.89.28fa.com mail is handled by 10 ds178-77-89-8.dedicated.hosteurope.de.
3:卸载sendmail[root@mail ~]# service sendmail stop
[root@mail ~]# yum remove sendmail
4:安装postfix
[root@mail Packages]# rpm -ivh postfix-2.6.6-6.el6_5.x86_64.rpmwarning: postfix-2.6.6-6.el6_5.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ########################################### [100%]
package postfix-2:2.6.6-6.el6_5.x86_64 is already installed
[root@mail Packages]# rpm -qa|grep postfix
postfix-2.6.6-6.el6_5.x86_64
5:备份main.cf
[root@mail Packages]# cd /etc/postfix/
[root@mail postfix]# ls
access canonical generic header_checks main.cf master.cf relocated transport virtual
[root@mail postfix]# cp main.cf main.cf.bak
6:修改main.cf[root@mail postfix]# vi mail.cf
修改的信息(核对修改)
[root@mail mail]# /usr/sbin/postconf -n
alias_database = hash:/etc/aliasesalias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/ -----419行设置邮件路径(home_mailbox=Mailbox也需要开启)
html_directory = no
inet_interfaces = all -----116行postfix监听端口
inet_protocols = ipv4 -----119行postfix支持的协议类型
mail_owner = postfix
mail_spool_directory = /data/mail -----425行邮件存储路径
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ----164行接收邮件的主机名和域名
mydomain = fa.com -----83行填写域名
myhostname = mail.fa.com -----75行填写配置的hostname
mynetworks = 127.0.0.0/8 -----264行设置网络可以转发的地址(此项填写的值表示无需smtp认证)
myorigin = $mydomain -----99行引用域名
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
7:重启postfix
[root@mail mail]# service iptables stop[root@mail mail]# service iptables start
设置开机自动启动
[root@mail mail]# chkconfig postfix on8:测试发送邮件是否成功
[root@mail postfix]# echo 'txt body'|mail -s 'txt tile' xxx@163.com查看日志
[root@mail mail]# tail -f /var/log/maillogSep 18 16:12:02 mail postfix/pickup[3305]: 2E117180878: uid=0 from=<root>
Sep 18 16:12:02 mail postfix/cleanup[3311]: 2E117180878: message-id=<20170918081202.2E117180878@mail.fa.com>
Sep 18 16:12:02 mail postfix/qmgr[3306]: 2E117180878: from=<root@fa.com>, size=420, nrcpt=1 (queue active)
Sep 18 16:12:27 mail postfix/smtp[3313]: 2E117180878: to=<xxx@163.com>, relay=163mx03.mxmail.netease.com[220.181.14.160]:25, delay=25, delays=0.07/0.01/25/0.17, dsn=2.0.0, status=sent (250 Mail OK queued as mx45,X8CowEBJw0ztf79ZGX91JA--.8118S2 1505722349)
Note:250 mail ok表示邮件已经发送成功
检查邮箱邮件收到
- 搭建postfix邮箱服务器
- Ubuntu搭建简易Postfix邮箱服务器
- Postfix + Openssl + Dovecot + Squirrelmail 搭建安全WEB邮箱服务器
- CentOS 7使用Postfix、Dovecot及MariaDB搭建邮箱服务器
- centos7+postfix+devocot+cycus-sasl搭建邮箱服务器
- Ubuntu 14.04搭建邮箱服务器(Postfix, Dovecot)
- 搭建postfix邮件服务器
- Postfix搭建邮件服务器
- postfix邮件服务器搭建
- postfix邮件服务器搭建
- postfix邮件服务器搭建
- POSTFIX邮件服务器搭建
- linux 邮件服务器搭建-postfix
- Postfix公网邮件服务器搭建
- Postfix,dovecot邮件服务器搭建
- Linux--搭建postfix邮件服务器
- 搭建 Postfix、Dovecot 邮件服务器
- postfix邮件服务器搭建笔记
- CXF2.2.4版本升级到2.5.2+配置问题
- CComboBox::ShowDropDown光标消失的问题
- 数据结构 -- 树
- 【学习摘记】马士兵bbs初级版_课时8-9_最简单的敏捷开发案例:reply和replyOK(含中文乱码问题)
- java 实现将图片低端,添加文字.并压缩打包,提供给前端下载到本地.
- 搭建postfix邮箱服务器
- 多线程的介绍及创建方式
- spring boot 学习笔记(二):项目属性配置
- solor的字段属性+复制域字段+动态域字段
- JavaScript中For循环和Map循环耗时比较
- myeclipseweb项目导入第三方包
- GSON解析传入泛型T,出现类型转换异常
- js中const,var,let区别
- vue-cli input输入框 enter键或失去焦点传数据