dovecot 2.xのログ設定

Facebooktwittermail

CentOS 7にdovecotをインストールしました。

CentOS 7にDovecotのインストール

デフォルトでログは/var/log/maillogに記録されます。これではpostfixのログと混在して調べる時に手間になったりまします。
今回はdovecotのログを別ファイルに記録する設定です。

Dovecot Logging
https://wiki2.dovecot.org/Logging

設定ファイルは/etc/dovecot/conf.d/10-logging.confです。

  • syslog
  • デフォルトではsyslog経由でsyslog_facilityがmailなので/var/log/maillogに記録されます。

    これをsyslog_facilityをlocal5でsyslog経由で/var/log/dovecot.logに記録します。

    /etc/rsyslog.conに設定を追加します。

    dovecot reloadします。

    これで/var/log/dovecot.logに記録されるようになりました。
    logrotateはsyslog関連で既に設定されているので、保存期間などの変更が無いならこれで完了です。

    下記のlogrotateの設定を行います。

  • ログファイルの指定
  • syslogを使用したくない場合はログファイルを指定することもできます。

    info,debug情報をさらに別ファイルに記録する場合はinfo_log_path =,debug_log_path =に指定して下さい。

    dovecot reloadします。

    このままではログが肥大化するのでlogrotateの設定を行います。

  • 詳細なログ設定
  • 上記サイトから取り敢えず引用(^^;

    Logging verbosity

    There are several settings that control logging verbosity. By default they’re all disabled, but they may be useful for debugging.

    auth_verbose=yes enables logging all failed authentication attempts.
    auth_debug=yes enables all authentication debug logging (also enables auth_verbose). Passwords are logged as .
    auth_debug_passwords=yes does everything that auth_debug=yes does, but it also removes password hiding (but only if you are not using PAM, since PAM errors aren’t written to Dovecot’s own logs).
    mail_debug=yes enables all kinds of mail related debug logging, such as showing where Dovecot is looking for mails.
    verbose_ssl=yes enables logging SSL errors and warnings. Even without this setting if connection is closed because of an SSL error, the error is logged as the disconnection reason.
    auth_verbose_passwords=no|plain|sha1 If authentication fails, this setting logs the used password. If you don’t really need to know what the password itself was, but are more interested in knowing if the user is simply trying to use the wrong password every single time or if it’s a brute force attack, you can set this to “sha1” and only the SHA1 of the password is logged. That’s enough to know if the password is same or different between login attempts.

Leave a Reply