1. In root account, first edit hostname:
nano /etc/hosts
2. Edit the hostname to DNS name, find the one starts with IP or 127.0.0.1 (hostname)
#127.0.0.1 mail-svr
127.0.0.1 mail.benfy95.net mail
3. Change hostname
echo "mail" > /etc/hostname
hostname -F /etc/hostname
4. Check output:
hostname
hostname -f

5. Download iRedMail via git
git clone https://github.com/iredmail/iRedMail.git
6. Launch the installer, install additional components if asked
cd iRedMail
bash iRedMail.sh
7. Follow on-screen instructions
a. Mail storage path

b. Desired web-server

c. Preferred DB backend, use MariaDB

d. Set DB password

e. Set domain name xxx@domain.com

f. Install optional tools, default is good enough

g. Review settings and type “y” to start installation.

8. Use firewall rules by iRedMail, then restart the server.

9. Edit SSL certificate location and reload service.
nano /etc/nginx/templates/ssl.tmpl

service nginx reload
10. Edit postfix SSL location and reload service.
nano /etc/postfix/main.cf

service postfix reload
11. Edit dovecot SSL location and reload service.
nano /etc/dovecot/dovecot.conf

service dovecot reload
12. Check DKIM keys
amavisd-new testkeys

Delete the ” symbol and put it into DNS settings.

13. SPF settings
v=spf1 ip4:(ipaddr) -all
14. DMARC settings
v=DMARC1; p=quarantine; pct=100; rua=mailto:postmaster@benfy95.net
15. PTR record settings
<Need to contact ISP to configure reverse lookup the DNS address to your mail server IP address>
16. Check if DKIM, SPF, DKIM is configured correctly
https://mxtoolbox.com/dkim.aspx
https://mxtoolbox.com/dmarc.aspx
https://mxtoolbox.com/spf.aspx
DKIM selector, enter: dkim, if all tests passed, it will display as shown:
a. DKIM:

b. SPF

c. DMARC
