Enabling Verbose Logs On Postfix and dovecot Log


The default mail log may not contain all the information you need. In that case, the next step is to enable verbose logging for Postfix and Dovecot, and to separate the Postfix and Dovecot logs into two separate files so they’re easier to sort through. The Postfix log will document messages that are relayed to or from outside servers, and the Dovecot log will record authorization attempts.

Dovecot

Follow these instructions to enable verbose logging for Dovecot and change the log location to /var/log/dovecot.log:
  1. Open the /etc/dovecot/conf.d/10-logging.conf file for editing by entering the following command:
    1
    nano /etc/dovecot/conf.d/10-logging.conf
    
  2. Add this line to set the new file path for the log:
    /etc/dovecot/conf.d/10-logging.conf
    1
    log_path = /var/log/dovecot.log
    
  3. Uncomment the auth_verbose and mail_debug lines, and then set them to yes:
    /etc/dovecot/conf.d/10-logging.conf
    1
    2
    3
    auth_verbose = yes
            
    mail_debug = yes
    
  4. Save your changes.
  5. Restart Dovecot by entering the following command:
    1
    service dovecot restart
    
The Dovecot log will now display more information about authorization attempts and inbox connections. You can view the new log at /var/log/dovecot.log. Remember to disable verbose logging when you’re done troubleshooting so your server doesn’t fill up with logs.

Postfix

Follow these instructions to enable verbose logging for Postfix:
  1. Open the /etc/postfix/master.cf files for editing by entering the following command:
    1
    nano /etc/postfix/master.cf
    
  2. Add a -v to the smtp line to enable verbose logging:
    /etc/postfix/master.cf
    1
    2
    3
    4
    5
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd -v
    
  3. Save your changes.
  4. Restart Postfix by entering the following command:

    service postfix restart
    
The Postfix log will now display more information about messages that are coming from or going to outside servers. You can still view the log at /var/log/mail.log. Remember to disable verbose logging when you’re done troubleshooting so your server doesn’t fill up with logs.