Configure the exim sending server in CentOS 6 and 7

Source: Internet
Author: User
Tags smtp error from remote mail server metalink

Configure the exim sending server in CentOS 6 and 7
1. Configure the epel source (the exim package is located in the EPEL software source)

CentOS7

  1. #cat>/etc/yum.repos.d/epel.repo<<EOF[epel]name=ExtraPackagesforEnterpriseLinux7-\$basearch#baseurl=http://download.fedoraproject.org/pub/epel/7/\$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=\$basearchfailovermethod=priorityenabled=1gpgcheck=0EOF

CentOS6

  1. #cat>/etc/yum.repos.d/epel.repo<<EOF[epel]name=ExtraPackagesforEnterpriseLinux6-\$basearch#baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=\$basearchfailovermethod=priorityenabled=1gpgcheck=0EOF
2. Disable postfix
  1. # Servicepostfixstop

  2. # Chkconfigpostfixoff

3. Install exim
  1. # Yum-yinstallexim

4. Set exim as the default MTA
  1. # Alternatives -- setmta/usr/sbin/sendmail. exim

5. Modify the exim configuration file
  1. # Vi/etc/exim. conf # several parametersprimary_hostname=mail.flying.com# When viewing the source email, the message "Received ed: frommail.flying.com" is displayed. If you do not specify the Host Name of the operating systemdomainlistlocal_domains=@localhost:localhost.localdomain:mail.flying.comdomainlistrelay_to_domains=flying.com# Domain name that allows email sending by host Modificationhostlistrelay_from_hosts=127.0.0.1:192_32G:10.168.0.0/16:
  2. <br>
  3. # 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 network address)

6. Test
  1. # Yum-yinstallmailx

  2. # Date | mail-rno-reply@flying.com-s 'eximtest' uttflying @ foxmail.com

  3. # 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.

Use files to send Emails:

date|mail-rflying@yflying.com-s'SN_IPinfoTEXT'uttflying@163.comwanglei@flying.com</root/cobbler/sn.logThe syntax of the mail command is as follows:Usage:mail[-iInv][-ssubject][-ccc-addr][-bbcc-addr]to-addr...[--sendmail-options...]mail[-iInNv]-f[name]mail[-iInNv][-uuser]

Test successful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.