Linux mail to QQ email __linux

Source: Internet
Author: User
Tags auth mkdir

Because of some security settings for QQ mailboxes, mail messages delivered by this machine mail command

The SMTP server is localhost SendMail or postfix.

So the message from IS from Localhost.localdomain Mail

QQ all refused.

and returns a 550 error


The Mail command is configured to send mail using a remote QQ SMTP server and log in with a QQ mailbox

1. Configure the sending environment

# cat/etc/mail.rc |grep-v-E "^#|^$"
set hold
set append
set ask
set CRT
set dot
set keep
se T Emptybox
set indentprefix= ">"
set quote
set Sendcharsets=iso-8859-1,utf-8
set ShowName
Set Showto
set Newmail=nopoll
set Autocollapse
ignore received
in-reply-to Message-id references Ignore mime-version content-transfer-encoding
fwdretain subject date from to
set Bsdcompat
set from= 994414615\ @qq. com  smtp=smtp.exmail.qq.com//mail from
set smtp-auth-user=994414615\ @qq. com smtp-auth-passwo Rd=youpassword smtp-auth=login//Login QQ SMTP server username and password
*********************************************************************

Note: The From item and the QQ in the user item in the configuration file can not be canceled, or the shell

The @ is treated as a special character.

*********************************************************************

2. Send command

# echo "A test mail to QQ mail server\!\!" | Mail-s Caiwenguang 994414615@qq.com

Can use QQ mailbox to receive alarm mail, so if QQ online can have mail can be prompted at any time.


After yesterday's test, you intend to apply this to the server, resulting in an error thrown in the Maillog

Mar 14:43:26 Web-server01 sendmail[30245]: s2v6hp11030245:to=eot,994414615@qq.com, Ctladdr=root (0/0), delay= 00:00:00, xdelay=00:00:00, Mailer=relay, pri=60079, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=deferred: Connection refused by [127.0.0.1]
Mar 14:46:32 Web-server01 sendmail[30255]: S2v6kwzt030255:from=root, size=77, Class=0, Nrcpts=1, msgid=< 201403310646.s2v6kwzt030255@localhost.localdomain> a relay=root@localhost.


Depressed ...


After several twists and turns found RHEL5.4 on the Mail command and SendMail have this inextricably linked

Simply unload the SendMail and mailx8.1 install the new MAILX package

Yum Remove SendMail


Install a new MAILX package

# wget HTTP://CLANG.GOOGLECODE.COM/FILES/MAILX-12.4.TAR.BZ2

# make

# Make Install Ucbinstall=/usr/bin/install


test-d/usr/local/bin | | Mkdir-p/usr/local/bin
/usr/bin/install-c MAILX/USR/LOCAL/BIN/MAILX
STRIP/USR/LOCAL/BIN/MAILX//This command
test-d/usr/local/share/man/man1 | | Mkdir-p/usr/local/share/man/man1
/usr/bin/install-c-M 644 mailx.1/usr/local/share/man/man1/mailx.1
test-d/etc | | Mkdir-p/etc
Test-f/etc/nail.rc | | \
/usr/bin/install-c-M 644 nail.rc/etc/nail.rc//This configuration file

View the modified configuration file

# cat/etc/nail.rc |grep-ve "^#|^$"
Set hold
Set Append
Set Ask
Set CRT
Set dot
Set Keep
Set Emptybox
Set indentprefix= ">"
Set Quote
Set Sendcharsets=iso-8859-1,utf-8
Set ShowName
Set Showto
Set Newmail=nopoll
Set Autocollapse
Ignore received in-reply-to Message-id references
Ignore Mime-version content-transfer-encoding
Fwdretain subject date from to
Set Bsdcompat
Set from=994414615\ @qq. com smtp=smtp.exmail.qq.com
Set smtp-auth-user=994414615\ @qq. com smtp-auth-password=youpassword smtp-auth=login

Test again

# echo ' This is a test Mail,hello cai\! ' | /usr/local/bin/mailx-s Testmail 994414615@qq.com


Successfully sent ...


############################################

An essay on the Lost Small Operation dimension

Author: John

Reprint please indicate the source

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.