一、准备工作
1、最小化安装centos 7.6
2、添加epel数据源(为了提高安装速度,将centosBase源、eple源配置为国内源,可选ustc、aliyun)
3、配置FQDN
#hostnamectl set-hostname mail.example.com
#vi /etc/hosts
127.0.0.1 mail.example.com mail localhost localhost.localdomain
4、配置SElinux
#setenforce 0
#sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
5、下载最新iReadmail
#yum -y install wget bzip2
#wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2
二、开始安装iRedmail
#tar xjf iRedMail-0.9.9.tar.bz2
#cd iRedMail-0.9.9
#bash iRedmail.sh
三、安装过程截屏
1、欢迎界面
2、指定 mailboxes路径。缺省 /var/vmail/
3、选择mail账户后台,可选MySQL、PostgreSQL、OpenLDAP。
4、选择OpenLDAP,填写root dn
5、添加第一个domain name
6、填写admin账户口令
7、选择可选组件
8、进入review界面,type y+enter,开始自动安装
四、后继工作
重要信息存储在iRedMail.tips
配置DNS服务器
mail.mydomain.com. 1800 A 192.168.1.5
mydomain.com. 10 mx mail.mydomain.com
mydomain.com. 3600 IN TXT "v=spf1 mx mx:mydomain.com -all"
或
mydomain.com. 3600 IN TXT "v=spf1 ip4:192.168.1.100 -all"
执行以下命令显示 DKIM keys:
# amavisd showkeys
dkim._domainkey.mydomain.com. 3600 TXT (
"v=DKIM1; p="
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYArsr2BKbdhv9efugByf7LhaK"
"txFUt0ec5+1dWmcDv0WH0qZLFK711sibNN5LutvnaiuH+w3Kr8Ylbw8gq2j0UBok"
"FcMycUvOBd7nsYn/TUrOua3Nns+qKSJBy88IWSh2zHaGbjRYujyWSTjlPELJ0H+5"
"EV711qseo/omquskkwIDAQAB")
复制上述命令输出内容到一行,we just need strings inside the ()
block,去掉“”,
v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYArsr2BKbdhv9efugBy...
添加TXT
类型 DNS record ,domain name "dkim._domainkey.mydomain.com
", value 是: v=DKIM1; p=...
.
dkim._domainkey.mydomain.com. 600 IN TXT "v=DKIM1\;p=..."
用dig
or nslookup核对
:
$ dig -t txt dkim._domainkey.mydomain.com
$ nslookup -type=txt dkim._domainkey.foodmall.com
And verify it with Amavisd:
# amavisd testkeys
TESTING: dkim._domainkey.mydomain.com => pass
五、option,注册mail domain
Google Postmaster Tools web site: https://postmaster.google.com, and Postmaster Tools FAQs.
参考:https://docs.iredmail.org/install.iredmail.on.rhel.html