Emos Postfix log operations

Source: Internet
Author: User

The MTA: postfix of the emos mail system has a strong log function. Any login, email sending, delivery, and other information will be recorded in the log. Therefore, it is necessary for us to understand the operations related to the Postfix log: view logs and clear logs.

1. log storage directory

Log storage directory:/etc/syslog. conf, where you can find the mail log storage directory.

Postfix daemon processes run in the background, and log problems and normal activity to the Syslog daemon. the syslogd process sorts events by class and severity, and appends them to logfiles. the logging classes, levels and logfile names are usually specified in/etc/syslog. conf. at the very least you need something like:

/Etc/syslog. conf:

Mail. Err/dev/console

Mail. debug/var/log/maillog

After changing the syslog. conf file, send a "Hup" signal to the syslogd process.

 

2. View logs

You can use commands such as more, tail, and head to view the Postfix log information, usually the/var/log/maillog file.

Tail-F/var/log/maillog

Head-num/var/log/maillog, view the first num row of the log

Tail-num/var/log/maillog, And the num line after the log is viewed

 

3. Log check

Run the command egrep '(reject | warning | error | fatal | panic):'/var/log/maillog to extract logs by level.

 

4. Log clearing

You can clear logs without restarting the machine. CP/dev/null/var/log/maillog can be cleared.

 

5. Log Analysis

Third-party tools are required for log analysis.

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.