Dies ist eine alte Version des Dokuments!


Logging und Fehlersuche

Dovecot unterstützt uns bei der Fehlersuche mit aussagekräftigen Einträgen im Maillog unseres Servers. Zum Feinjustieren und individuellen Loggingverhalten bietet uns Dovecot mehrere Optionen.

Rufen wir die Prozessliste auf, sehen wir je nach Auslastung unseres Servers einen oder mehrere Dovecot-Prozesse.

 USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 dovecot  19666  0.0  0.0  19204  2072 ?        S    18:40   0:00 dovecot/imap

Zieht jetzt ein Client mehr Ressourcen, als wir diesem zugestehen wollen, können wir so leider nicht ohne weiteres herausfinden, wer das ist.

Über den Konfigurationsparameter verbose_proctitle können wir definieren, dass uns neben den üblichen ps-Werten zusätzlich noch der Login-Name, die Client-IP-Adresse und auch noch der ausgeführte IMAP-Befehl angezeigt wird.

 USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
 dovecot  19907 66.6  0.0  18860  1684 ?        S    18:45   0:00 dovecot/imap [django@mailserver.guru 10.0.0.20]
 dovecot  19971  0.0  0.0  19204  2088 ?        S    18:46   0:00 dovecot/imap [django@nausch.org 109.43.1.83 IDLE]

Zum Aktivieren dieser Option tragen wir nun einfach ein verbose_proctitle=yes in der Konfigurationsdatei /etc/dovecot/dovecot.conf ein.

 # vim /etc/dovecot/dovecot.conf
/etc/dovecot/dovecot.conf
## Dovecot configuration file                                                                                                                                                    
 
# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration                                                                                                          
 
# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.
 
# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
# value inside quotes, eg.: key = "# char and trailing whitespace  "
 
# Most (but not all) settings can be overridden by different protocols and/or
# source/destination IPs by placing the settings inside sections, for example:
# protocol imap { }, local 127.0.0.1 { }, remote 10.0.0.0/8 { }
 
# Default values are shown for each setting, it's not required to uncomment
# those. These are exceptions to this though: No sections (e.g. namespace {})
# or plugin settings are added by default, they're listed only as examples.
# Paths are also just examples with the real defaults being based on configure
# options. The paths listed here are for configure --prefix=/usr
# --sysconfdir=/etc --localstatedir=/var
 
# Protocols we want to be serving.
#protocols = imap pop3 lmtp
 
# A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::
 
# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/
 
# Name of this instance. In multi-instance setup doveadm and other commands
# can use -i <instance_name> to select which instance is used (an alternative
# to -c <config_path>). The instance name is also added to Dovecot processes
# in ps output.
#instance_name = dovecot
 
# Greeting message for clients.
#login_greeting = Dovecot ready.
 
# Space separated list of trusted network ranges. Connections from these
# IPs are allowed to override their IP addresses and ports (for logging and
# for authentication checks). disable_plaintext_auth is also ignored for
# these networks. Typically you'd specify your IMAP proxy servers here.
#login_trusted_networks =
 
# Space separated list of login access check sockets (e.g. tcpwrap)
#login_access_sockets = 
 
# With proxy_maybe=yes if proxy destination matches any of these IPs, don't do
# proxying. This isn't necessary normally, but may be useful if the destination
# IP is e.g. a load balancer's IP.
#auth_proxy_self =
 
# Show more verbose process titles (in ps). Currently shows user name and
# IP address. Useful for seeing who are actually using the IMAP processes
# (eg. shared mailboxes or if same uid is used for multiple accounts).
# Django : 2014-07-21
# In der Prozessliste bei den POP3/IMAP-Prozessen zusätzlich den Usernamen, 
# die Client-IP-Adresse und den ausgeführten IMAP-Befehl anzeigen. 
# default: #verbose_proctitle = no
verbose_proctitle = yes
 
# Should all processes be killed when Dovecot master process shuts down.
# Setting this to "no" means that Dovecot can be upgraded without
# forcing existing client connections to close (although that could also be
# a problem if the upgrade is e.g. because of a security fix).
#shutdown_clients = yes
 
# If non-zero, run mail commands via this many connections to doveadm server,
# instead of running them directly in the same process.
#doveadm_worker_count = 0
# UNIX socket or host:port used for connecting to doveadm server
#doveadm_socket_path = doveadm-server
 
# Space separated list of environment variables that are preserved on Dovecot
# startup and passed down to all of its child processes. You can also give
# key=value pairs to always set specific settings.
#import_environment = TZ
 
##
## Dictionary server settings
##
 
# Dictionary can be used to store key=value lists. This is used by several
# plugins. The dictionary can be accessed either directly or though a
# dictionary server. The following dict block maps dictionary names to URIs
# when the server is used. These can then be referenced using URIs in format
# "proxy::<name>".
 
dict {
  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
 
# Most of the actual configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
!include conf.d/*.conf
 
# A config file can also tried to be included without giving an error if
# it's not found:
!include_try local.conf

Zum Aktivieren unserer Änderungen führen wir einen Reload unseres Daemon durch.

 # systemctl reload dovecot.service

Im Maillog unseres Servers wird dieser Reload entsprechend vermerkt.

 Jul 21 19:53:45 vml000070 dovecot: master: Warning: SIGHUP received - reloading configuration
 # vim /etc/dovecot/conf.d/10-logging.conf
/etc/dovecot/conf.d/10-logging.conf
##
## Log destination.
##
 
# Log file to use for error messages. "syslog" logs to syslog,
# /dev/stderr logs to stderr.
#log_path = syslog
 
# Log file to use for informational messages. Defaults to log_path.
#info_log_path = 
# Log file to use for debug messages. Defaults to info_log_path.
#debug_log_path = 
 
# Syslog facility to use if you're logging to syslog. Usually if you don't
# want to use "mail", you'll use local0..local7. Also other standard
# facilities are supported.
#syslog_facility = mail
 
##
## Logging verbosity and debugging.
##
 
# Log unsuccessful authentication attempts and the reasons why they failed.
#auth_verbose = no
# Django : 2014-07-21
# Detaillierte Loginformationen zum positiven Authentifizierungsprozess 
# bzw. im Fehlerfall mit Details zu den Fehlern
# default: auth_verbose = no
auth_verbose = no
 
# In case of password mismatches, log the attempted password. Valid values are
# no, plain and sha1. sha1 can be useful for detecting brute force password
# attempts vs. user simply trying the same password over and over again.
# You can also truncate the value to n chars by appending ":n" (e.g. sha1:6).
#auth_verbose_passwords = no
 
# Even more verbose logging for debugging purposes. Shows for example SQL
# queries.
#auth_debug = no
# Django : 2014-07-21
# Detaillierte Debug-Loginformationen zum Authentifizierungsprozess inkl.
# der SQL-Abfragen und deren Ergebnisse ins Logfile schreiben
 
# In case of password mismatches, log the passwords and used scheme so the
# problem can be debugged. Enabling this also enables auth_debug.
#auth_debug_passwords = no
# Django : 2014-07-21
# Passwort zum Debuggen mitloggen? 
 
# Enable mail process debugging. This can help you figure out why Dovecot
# isn't finding your mails.
#mail_debug = no
# Django : 2014-07-21
# Detailierte Loginformationen zur Verarbeitung der eMails durch Dovecot.
 
# Show protocol level SSL errors.
#verbose_ssl = no
# Django : 2014-07-21
# SSL-Debugmode aktivieren. 
 
# mail_log plugin provides more event logging for mail processes.
plugin {
  # Events to log. Also available: flag_change append
  #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  # Available fields: uid, box, msgid, from, subject, size, vsize, flags
  # size and vsize are available only for expunge and copy events.
  #mail_log_fields = uid box msgid size
}
 
##
## Log formatting.
##
 
# Prefix for each line written to log file. % codes are in strftime(3)
# format.
#log_timestamp = "%b %d %H:%M:%S "
# Django : 2014-07-21
# default: unset
log_timestamp  = "%Y-%m-%d %H:%M:%S "
 
# Space-separated list of elements we want to log. The elements which have
# a non-empty variable value are joined together to form a comma-separated
# string.
#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c
# Django : 2014-07-21
# default: unset
# Folgende Parameter wurden aktiviert:
# %u         : User/Login-Namen 
# %m         : Authentication-Pethode
# %r         : Remote IP Adress
# %e         : Mail-Process-ID (imap/pop3) der post-login Verbindung
# %c         : "secured" String "SSL", "TLS" 
# %k         : SSL Protokoll und Cipher-Information  
# %{session} : Session-ID der Client-Verbindung
login_log_format_elements = user=<%u> method=%m rip=%r mpid=%e %c %k session=<%{session}>
 
# Login log format. %s contains login_log_format_elements string, %$ contains
# the data we want to log.
#login_log_format = %$: %s
 
# Log prefix for mail processes. See doc/wiki/Variables.txt for list of
# possible variables you can use.
#mail_log_prefix = "%s(%u): "
 
# Format to use for logging mail deliveries. You can use variables:
#  %$ - Delivery status message (e.g. "saved to INBOX")
#  %m - Message-ID
#  %s - Subject
#  %f - From address
#  %p - Physical size
#  %w - Virtual size
#deliver_log_format = msgid=%m: %$

Die benutzen Variablen in der Konfigurationsdatei /etc/dovecot/conf.d/10-logging.conf sind im Dovecot Wiki ausführlich beschrieben.

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
  • centos/mail_c7/dovecot_3.1407182635.txt.gz
  • Zuletzt geändert: 04.08.2014 20:03.
  • von django