[Dovecot] %{session} does not work with deliver_log_format
Timo Sirainen
tss at iki.fi
Mon Feb 25 09:56:23 EET 2013
On 25.2.2013, at 0.53, Daniel Parthey <daniel.parthey at informatik.tu-chemnitz.de> wrote:
> # 2.1.10: /etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-45-server x86_64 Ubuntu 10.04.4 LTS
> deliver_log_format = mailbox: deliver: session=<%{session}> msgid=%m from=%f: %$
>
> produces log messages always containing "session=<session}>", like this one:
>
> Feb 24 09:22:09 10.129.3.233 dovecot: lmtp(3484, user at example.org): mbnWK6/NKVGcDQAAiWCYmA: sieve: mailbox: deliver: session=<session}> msgid=<20130224082208.8A807C0CF at mx01.example.org> from=postmaster at example.org: stored mail into mailbox 'INBOX/postmaster'
>
> http://wiki2.dovecot.org/Variables leads me to the assumption
> that %{session} works "everywhere" and for deliver_log_format too.
Added "(almost)" :)
> Is deliver_log_format variable expansion handled differently
> from login_log_format_elements and mail_log_prefix?
Very differently. Hmm.
The idea behind imap/pop3 session IDs is to track the session through proxies, authentication, etc.
LMTP has a completely different session ID currently, which gets reset for each mail delivery and is written to the Received: header that it writes. It doesn't traverse through proxies, because each delivery gets a different ID anyway.
So .. Why is it that you want this? For matching a log line with a Received: header? I guess that could be done, but the name should probably be different from %{session} so it won't get mixed up with what IMAP/POP3 uses it for.
More information about the dovecot
mailing list