How Linux comes with sending mail

Source: Internet
Author: User

The following is a script that detects the size of the log file (catalina.out):

#!/bin/bash#author:chris Chan#written for Check catalina.outsize=$ (du-m catalina.out| awk ' {print $} ') echo The size of the catalina.out is: $sizeif [$size-gt 19000]then rm-rf catalina.out echo "Warning, the catalina.out size of the test environment CMS has exceeded 18. 5G, has been deleted. " | Mail-s "Warning" [Email protected]else Exitfi


New Point of knowledge!

The way to send e-mail with the shell is simple, in the following format:

echo "Mail Content" |mail-s "Mail Header" Destination email address


But sometimes it can be an error, such as this phenomenon:

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/8D/8F/wKioL1ihmEGwpPu-AAB9Nb9SX2M248.png "title=" 1.png "alt=" Wkiol1ihmegwppu-aab9nb9sx2m248.png "/>


Encounter such phenomenon do not panic, in fact, the Mail has been sent successfully, but the reason that there will be such an error, because the current mail service does not support IPv6, then we first #vim/etc/postfix/main.cf, the inside of the inet_ protocols = All modified to Inet_protocols = IPv4, then #/etc/init.d/postfix restart, just fine.


Effect

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8D/91/wKiom1ihmb6RuzTnAACUCXUvFqw821.png "title=" 1.png "alt=" Wkiom1ihmb6ruztnaacucxuvfqw821.png "/>


But be careful! This method to send 163 of the mailbox is possible, send QQ mailbox will be transferred by default to junk mail, need to manually trust.


This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1897416

How Linux comes with sending mail

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.