Why cannot I send emails via external SMTP in mail \ mailx in LINUX?

Source: Internet
Author: User


In LINUX, why does mail \ mailx fail to use external SMTP to send mails? Sometimes, to meet certain requirements, a single SMTP server is used as the mail report. Generally, disable the sendmail service on the local machine, modify/etc/mail. rc, and add two lines to specify the external smtp server address and account password. Www.2cto.com # vi/etc/mail. rc set from = demo@qq.com smtp = smtp.qq.com set smtp-auth-user = demo smtp-auth-password = ithf smtp-auth = login and then send the email echo hello word | mail- s "demo title" demo@qq.com but found in RHEL6 running is no problem, in RHEL5, the mail command always calls the local sendmail service to send emails. What is the relationship between mail and mailx in RHEL6 and RHEL5? RHEL6 mail link to mailx command, mailx version is 12.4 # rpm-qa | grep mailx mailx-12.4-6.el6.x86_64 # ll/bin/mail * www.2cto.com lrwxrwxrwx. 1 root 5 October 2011/bin/mail-> mailx-rwxr-xr-x. 1 root 390424 February 16 2010/bin/mailx # mail-V 12.4 7/29/08 RHEL5, some different mailx links to the mail command are found, mailx version 8.1 # rpm-qa | grep mailx mailx-8.1.1-44.2.2 # ll/bin/mail *-rwxr-xr-x 1 root mail 84856 Jun 6 2007/bin/mail lrwxrwx Rwx 1 root 4 Apr 12/bin/mailx-> mail # mail-V this operation will cause an error. If the-V parameter is not specified, that is, in RHEL6 \ 5, running mail and mailx is actually a command, but different mail versions make the mail command under RHEL5 unable to call the external SMTP server. Installing the new version of mailx solves this problem. Mailx official site http://heirloom.sourceforge.net/Download latest mailx-12.4.tar.bz2 (271.5 kB) http://sourceforge.net/projects/heirloom/files/latest/download? Source = files decompress and install. The downloaded package contains the installation instructions (see the INSTALL file ). The default installation method is make; make install www.2cto.com. The installation instructions are also described. If the make install error occurs, use the make install UCBINSTALL =/usr/bin/install command. Command: # tar jxvf mailx-12.4.tar.bz2 # cd mailx-12.4 # make install UCBINSTALL =/usr/bin/install I did not respond for a long time in make install, only Ctrl + C interrupted, enter make install UCBINSTALL =/usr/bin/install to check the default installation location and version of mailx. # whereis mailx: /usr/local/bin/mailx/usr/share/man/man1p/mailx.1p.gz # mailx-V 12.4 7/29/08 after installation, mailx uses/etc/nail. rc configuration, not/etc/mail. rc. Use the mailx command to test the mail sent by www.2cto.com # echo hello word | mailx-v-s "demo title" if the demo@qq.com is successfully sent, you can see a similar message 235 2.7.0 Authentication successful> mail from: <demo@qq.com> 250 2.1.0 OK> RCPT: <xxxxx@qq.com> 250 2.1.5 OK> DATA 354 End data with <CR> <LF>. <CR> <LF >>>>. 250 2.0.0 OK: queued as 9291963494 >>> QUIT 221 2.0.0 Bye author islandstar

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.