1. Configure the epel source (the exim package is located in the EPEL software source)
CentOS7
# Cat>/etc/yum. repos. d/epel. repo <EOF
[Epel]
Name = Extra Packages for Enterprise Linux 7-\ $ basearch
# Baseurl = http://download.fedoraproject.org/pub/epel/7/\$basearch
Using list = https://mirrors.fedoraproject.org/metalink? Repo = epel-7 & arch =\$ basearch
Failovermethod = priority
Enabled = 1
Gpgcheck = 0
EOF
CentOS6
# Cat>/etc/yum. repos. d/epel. repo <EOF
[Epel]
Name = Extra Packages for Enterprise Linux 6-\ $ basearch
# Baseurl = http://download.fedoraproject.org/pub/epel/6/\$basearch
Using list = https://mirrors.fedoraproject.org/metalink? Repo = epel-6 & arch =\$ basearch
Failovermethod = priority
Enabled = 1
Gpgcheck = 0
EOF
2. Disable postfix
# Service postfix stop
# Chkconfig postfix off
3. Install exim
# Yum-y install exim
4. Set exim as the default MTA
# Alternatives -- set mta/usr/sbin/sendmail. exim
5. Modify the exim configuration file
# Vi/etc/exim. conf # Several parameters
Primary_hostname = mail.linuxeye.com # The Received ed: from mail.linuxeye.com command is displayed when you view the source email. If you do not specify the hostname of the operating system
Domainlist local_domains = @ localhost: localhost. localdomain: mail.linuxeye.com
Domainlist relay_to_domains = linuxeye.com # The domain name that allows you to send emails by modifying the host
Hostlist relay_from_hosts = 127.0.0.1: 192_32G: 192.168.0.0/16: # allow the client hosts to send emails. If you use this server to send emails locally, you need to add a local egress IP address (public IP address)
6. Test
# Yum-y install mailx
# Date | mail-r no-reply@linuxeye.com-s 'exim test' lj2007331@163.com
# Tail-f/var/log/exim/main. log # exim log file
Ps:
If-r is not specified and your host name is not xxx.com, the following error may be reported:
SMTP error from remote mail server after mail from:
The error is 550 MI: The IMF sender's email address is invalid.
Experience:
We strongly recommend that you use NetEase enterprise mail. If you set up an email server and set up QQ Enterprise mail as the local sending and receiving server, the address is not verified.