javatgo 发表于 2013-2-7 05:43:44

Troubleshooting with Postfix Logs

refer:http://www.onlamp.com/pub/a/onlamp/2004/01/22/postfix.html
by Kyle D. Dent, author of Postfix: The Definitive Guide
01/22/2004Postfix provides a number of ways to get information that can be helpful when you are trying to diagnose a problem. The standard logging often provides more than adequate information for understanding problems and determining their cause. This article discusses Postfix logging in general, how to find all of the relevant information in the logs, and finally, how to increase the amount of logging when more information is needed. Before we get to logging, let's consider a few configuration guidelines that might help prevent problems from the start.
<!--ONJava MPU Ad --><!-- me -->Configuration Guidelines

Change One Thing at a Time

Postfix is a complex system. If you make several changes and yoursystem stops working as expected, you'll have a difficult time figuringout which change caused the problem.
Save Known Working Configurations

Be sure that you can always revert to an earlier known workingconfiguration. Either make copies of files before you work on them or,even better, use version control with your configuration files.
<!-- sidebar begins --><!-- don't move sidebars --><!-- sidebar ends -->Use the soft_bounce Parameter for Testing Changes

When trying out a configuration change you're not sure about, you can enable soft_bounce, so that mail that would bounce is kept in the queue and can still be delivered once the problem is corrected. In your   main.cf file, simply add the following:
soft_bounce = yesBesides queuing problem messages, enabling soft_bounce causes Postfix to convert permanent rejection codes (5xx) to temporary ones (4xx). When you enable soft_bounce,it's important to check your logs frequently. When you find a warningor see that a message has been rejected, you can fix your configurationproblem and successfully receive the message next time the delivery isattempted.
Use warn_if_reject with Relay Restrictions

Chapter 11 of Postfix: The Definitive Guide discussesanti-spam configuration information. As you build up your set ofblocking rules, you can preface those you're not sure about with warn_if_reject to have the rule log a warning instead of rejecting the message.
For example, a restriction such as reject_unknown_hostnamerejects too many legitimate messages, in most situations. If you wantto see what effect it will have in your environment without actuallyrejecting messages, preface it with warn_if_reject:
smtpd_helo_restrictions = permit_mynetworks
warn_if_reject reject_unknown_hostname
   ...<!-- sidebar begins -->Related Reading
http://www.onlamp.com/catalog/covers/0596002122_cat.gifPostfix: The Definitive Guide
By Kyle D.燚ent
<div class="secondary"><!-- builds links to list in sidebar --> Table of Contents
Index
Sample Chapter

Read Online--SafariSearch this book on Safari:
Only This BookAll of Safari
Code Fragments only
页: [1]
查看完整版本: Troubleshooting with Postfix Logs