Recipe 21.3. Safely Testing New UBE Controls in Postfix

 < Day Day Up > 

21.3.1 Problem

You want to try some new unsolicited bulk email (UBE) controls in Postfix, because you want to reject as much noxious traffic as possible at the SMTP level, to minimize the load on your server. But you're concerned about bouncing the wrong messages and losing mail you want to receive.

21.3.2 Solution

Postfix has two ways of turning off bounces during testing: globally, and per configuration item. To disable rejects globally, add this line to /etc/postfix/main.cf:

soft_bounce = yes

This converts 5xx error codes to 4xx. Then you must monitor your logs to see exactly what happens. (See Recipe 20.19 for a description of SMTP response codes.)

To configure individual configuration items, use the warn_if_reject qualifier:

smtpd_recipient_restrictions =     reject_invalid_hostname,     reject_non_fqdn_hostname,     warn_if_reject  reject_non_fqdn_sender,

Again, read your logs Postfix will log a warning, but still deliver the message.

Always run postfix reload after making changes to main.cf.

21.3.3 Discussion

Postfix's log files are must-reads for the mail admin at all times, and especially during testing.

Fending off unwanted traffic at the SMTP level is efficient, but it's also error-prone, because there are so many misbehaving and misconfigured mail servers. The chances are good that you'll reject mail that you want to keep, so keep an eagle eye on the logs so you know what's going on. This is a quick, easily modifiable regexp to help search for specific messages:

# egrep '(reject|warning|error|fatal|panic):' /var/log/maillog

21.3.4 See Also

  • RFC 2821 Simple Mail Transfer Protocol

  • Postfix's SMTPD_ACCESS_README and access(5)

  • Postfix: The Definitive Guide, by Kyle D. Dent (O'Reilly)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net