In the future please attempt to mentally parse a bug report before
marking it as invalid.  Yes I do understand how syslog works.  Note that
reporting a bug != to fixing a bug.  If I have to download .src packages
and sift through source files and postinst scripts in order to describe
precisely what the problem is, I might as well fix the bug myself.  Most
users are not going to go to these lengths. Yes, in working on this I've
discovered  a number of problems with the default rsyslog.conf
configuration file which I will log against that package.  Here are the
issues which remain with dovecot-postfix and which should have been
easily read from my not-quite-precise bug report:

1. Because the installation of postfix/dovecot-postfix makes some minor
changes to the rsyslog configuration, I believe the postinst script for
postfix should probably restart the rsyslog daemon -- currently it
doesn't do this.  This might be the reason why mail logs weren't logging
properly initially to /var/log/mail.*.

2. Part of the confusion is that smtp traffic is logged to both /var/log/mail.* 
and /var/log/syslog; this is a bug (in my opinion) in the default rsyslog 
configuration file /etc/rsyslog.d/50-default.conf
   *.*;auth,authpriv.none   -/var/log/syslog
        --should be--
   *.*;auth,authpriv,mail.none     -/var/log/syslog

The unreconcilable problem has to do with trying to log IMAP traffic to
yet a different log file, say /var/log/dovecot.  If in fact there is no
way to make this work, then that option should not appear in the file
/etc/dovecot/dovecot-postfix.conf.  In that file, one finds the
following text:

   # Log file to use for error messages, instead of sending them to syslog.
   # /dev/stderr can be used to log into stderr.
   #log_path =

If I add the line
   log_path = /var/log/dovecot
and restart dovecot, postfix, and rsyslog (for good measure), the system is no 
longer able to accept incoming smtp traffic, with the following appearing in 
the /var/log/mail.log and/or /var/log/syslog when a message arrives from 
another system:

Oct 12 17:12:48 ibis postfix/local[470]: 96D8941012:
to=<pgo...@internetbs.com>, relay=local, delay=0.34,
delays=0.24/0.01/0/0.09, dsn=4.3.0, status=deferred (temporary failure.
Command output: Can't open log file /var/log/dovecot: Permission denied
)

The only way to make this work is to
   sudo chmod 777 /var/log/dovecot

which I think we all agree is not appropriate for system logs on a
multiuser system.  The following configuration:

/etc/dovecot/dovecot-postfix.conf:  (only sections with changes to default 
shown)
--------------------------------
# Log file to use for error messages, instead of sending them to syslog.
# /dev/stderr can be used to log into stderr.
#log_path =
log_path = /var/log/dovecot

# Log file to use for informational and debug messages.
# Default is the same as log_path.
#info_log_path =

# Prefix for each line written to log file. % codes are in strftime(3)
# format.
#log_timestamp = "%b %d %H:%M:%S "
log_timestamp = "%Y-%m-%d %H:%M:%S "

# 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
syslog_facility = local0
--------------------------------

/etc/rsyslog.d/50-default.conf:  (only sections with changes to default shown)
--------------------------------
#
# First some standard log files.  Log by facility.
#
auth,authpriv.*                 /var/log/auth.log
# ORIG *.*;auth,authpriv.none   -/var/log/syslog
*.*;auth,authpriv,mail,local0.none    -/var/log/syslog
#cron.*                         /var/log/cron.log
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log
local0.*                      -/var/log/dovecot.log
--------------------------------

results in exactly the same problem with deferred incoming SMTP traffic.
I looked through the dovecot source code and frankly the way logging is
handled seems to be a bit of a mess.  However, the use of dovecot
deliver by postfix must be the reason that trying to enable IMAP logging
results in the failure of delivery of SMTP traffic.  This is fine, I can
live with having both SMTP and IMAP traffic logging to /var/log/mail.*,
but in this case these comments/options should be removed from the
default /etc/dovecot/dovecot-postfix.conf file to avoid confusing the
hapless user who tries to use options mentioned in the comments which
don't actually work.

Since beginning this investigation I've done a dist-upgrade to karmic
beta; of course I can't speak to any changes in the default config
files, as mine have been modified.

-- 
postfix ignores the rsyslog configuration directives
https://bugs.launchpad.net/bugs/434986
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to