1. 配置epel源(exim包位于EPEL软件源中) # 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 mirrorlist=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 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=\$basearch failovermethod=priority enabled=1 gpgcheck=0 EOF 2. 禁止postfix # service postfix stop # chkconfig postfix off 3. 安装exim
# yum -y install exim
4. 将exim设为默认的MTA
# alternatives --set mta /usr/sbin/sendmail.exim
5. 修改exim配置文件 primary_hostname = mail.linuxeye.com #查看源邮件时显示Received: from mail.linuxeye.com,如果不指定直接去操作系统的hostname domainlist local_domains = @ localhost : localhost.localdomain :mail.linuxeye.com domainlist relay_to_domains = linuxeye.com #允许通过改主机发送邮件的域名 hostlist relay_from_hosts = 127.0.0.1 : 192_32G : 192.168.0.0/16 : #允许那些客户端主机发送邮件,如本地使用这台服务器发送邮件时,即需要添加本地出口ip地址(公网地址) 6. 测试 # 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日志文件
ps:
经验: 转载请保留固定链接: https://linuxeye.com/Linux/2402.html |