Configuring SMTP under CentOS

Source: Internet
Author: User
Tags metalink

Configuring an SMTP mail service on a server can be a common need in daily work, such as when doing some simple testing.

The configuration step is extremely simple, nonsense does not say:

1,yum-y Install Mail

2, edit/etc/mail.rc, configure some SMTP related content

3, no more ...

Install Mail

Detailed output process, recorded as follows

[[email protected] ~]# yum-y install mail loaded plugin: Fastestmirror set installation process loading mirror speeds from cached hostfilecould n OT get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error Was14:peer cert cannot be Verified or Peer cert invalid* base:mirrors.yun-idc.com* epel:mirror.lzu.edu.cn* extras:mirrors.yun-idc.com* updates:m Irrors.yun-idc.combase | 3.7 KB 00:00extras | 3.4 KB 00:00updates | 3.4 KB 00:00 Resolving dependencies--Performing transaction Checks---> Package mailx.x86_64 0:12.4-8.el6_6 'll be installed--complete dependency calculation dependency resolution ============== =============================================================================================================== ================================================================== Package schema version warehouse size ================================= =============================================================================================================== =============================================== Installing: Mailx x86_64 12.4-8.el6_6 base 235 k Transaction Summary ==================================================================================================================================== ===========================================================install 1 package (s) Total downloads: 235 kinstalled size:452 k Download Packages: mailx-12.4-8.el6_6.x86_64.rpm | 235 KB 00:00 running Rpm_check_debug performing a transaction test transaction test successful execution of the transaction is being installed: mailx-12.4-8.el6_6.x86_64 1/1warning:/etc/mail.rc created as/etc/ mail.rc.rpmnewverifying:mailx-12.4-8.el6_6.x86_64 1/1 installed: mailx.x86_64 0:12.4-8.el6_6 finished!   [[email protected] ~]#
Configure SMTP
[Email protected] ~]# vim/etc/mail.rc[[email protected] ~]# cat/etc/mail.rcset [email protected]set smtp=smtp.163.coms ET smtp-auth-user=my_test_mail_addressset smtp-auth-password=passwd_of_my_test_mail_address123set smtp-auth=login [Email protected] ~]#
Test
[Email protected] ~]# echo "hehe" | Mailx-v-S "Test" [email protected]resolving host smtp.163.com ... done. Connecting to 220.181.12.16 ... connected.220 163.com anti-spam GT for Coremail System (163com[20141201]) >>> EH LO Thatsit250-mail250-pipelining250-auth LOGIN Plain250-auth=login plain250-coremail 1uxr2xkj7kg0xki17xgru7i0s8fy2u3uj8cz28x1uuuuu7ic2i0y2urkfwhduca0xdruuuuj250-starttls250 8BITMIME>>> AUTH LOGIN334 dxnlcm5hbwu6>>> dGhhdHNtYWls334 ugfzc3dvcmq6>>> IUAjdGhhdHNtYWlsMTIz235 Authentication successful>>> mail from:<[email protected]>250 mail ok>>> RCPT TO:<[email protected]>250 Mail ok>>> DATA354 End data with <CR><LF>.<CR><LF>>>>. 250 Mail OK queued as Smtp12,emcowadx78nadypyg6vqda--. 33888s2 1479178081>>> QUIT221 bye[[email protected] ~]#

  

The relationship between Mailx and mail

As you may see here, the above test commands use MAILX, unlike the mail commands used in some documents, what is the relationship between the two? Let's take a look:

[[email protected] ~]# which mail/bin/mail[[email protected] ~]# ll/bin/maillrwxrwxrwx 1 root root 22 November 10:47/bin/m AIL-/etc/alternatives/mail[[email protected] ~]# ll/etc/alternatives/maillrwxrwxrwx 1 root root 10 November 10:47/et C/alternatives/mail,/bin/mailx[[email protected] ~]#

We also see, in fact, mail is MAILX soft chain of soft chain. So on the use, these two commands are the same:

 

The following two test messages

Done

Configuring SMTP under CentOS

Related Article

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.