CentOS-boot automatically send IP to designated mailbox-smtp.163.com

Source: Internet
Author: User

1. Introduction:

Server is sometimes through the DHCP to obtain IP, the general server with a network cable and power is good, if each boot also have to connect a monitor and keyboard to see how much IP is inconvenient. Lazy people let it send a message automatically. Here use centos,163 mailbox, mail and so on.

2. Guarantee 163 mailbox Open Pop3/smtp/imap Service

3. Configure the CentOS Mail

#vim/etc/mail.rcsetfrom [email protected]163. com smtp=smtp. 163. com [email protected]163. com smtp-auth-password=password smtp-auth=login

Note: password refers to 163 mailbox Authorization code, sometimes password can also, password is clear way, so I specifically applied for a new 163 mailbox.

4. Boot from boot

# vim  /etc/rc.d//root/autoexecofleaf &
# vim/root/autoexecofleaf#!/bin/bashsleep  1mifconfig"  New IP address of T420"2@qq. comifconfig"new IP address of T420"1@qq. com

Note: Use Rc.local to set up the boot script, but the log output is unable to parse the host at the beginning of the test, it is estimated that the system has not initialized the network, so the script is run in the background, script hibernation 1minutes (forced bypass the START process = =)

5. Notes

Post-Boot related log view:

Change the first line of the rc.local to #!/bin/bash-x, and then/var/log/messages the file with the corresponding output (VIM, search rc.local)

Also, 163 of servers focus on check for new mailboxes and are likely to be considered junk e-mail.

CentOS-boot automatically send IP to designated mailbox-smtp.163.com

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.