Hi, I am not yet completely happy with the logging behavior of the lmtp. It logs informative messages like 'lmtp: Info: Connection closed' or 'lmtp: Info: Disconnected for inactivity'. Hm, which server was connected to the lmtp? Who was disconnected for inactivity? I think it would be useful if the lmtp would also log new connections. For example: a) TCP connections: lmtp: Info: Connection: rip=10.1.2.3, lip=10.1.2.5, cid=1255555555.12345 b) Socket connections: lmtp: Info: Connection: via socket, cid=1255555777.10452 rip: There may be multiple SMTP servers in front the IMAP server(s) lip: The lmpt may listen to more than one address cid: The 'connection ID', consists of the current unix time and the pid of the lmtp process. (Or some other values in some other format) The cid should be used in the 'saved' messages. So the delivering MTA would see something like '250 2.0.0 OK: 1255555555.12345 Saved', instead of a message like '250 2.0.0 <jdoe at example.com> Saved'. The lmtp should also write the cid to the log. For example: 'lmtp(jdoe): Info: msgid=123, cid=1255555555.12345: saved mail to INBOX' (or discarded because of a matching sieve rule). With this connection ID it would be possible to trace the route which the e-mail has taken. Regards, Pascal -- The trapper recommends today: c01dcafe.0929623 at localdomain.org
On Sat, 2009-10-24 at 00:02 +0200, Pascal Volk wrote:> I think it would be useful if the lmtp would also log new connections. > For example: > a) TCP connections: > lmtp: Info: Connection: rip=10.1.2.3, lip=10.1.2.5, cid=1255555555.12345 > b) Socket connections: > lmtp: Info: Connection: via socket, cid=1255555777.10452Maybe this could be merged somehow with login_log_format* settings, since they're pretty similar..> cid: > The 'connection ID', consists of the current unix time and the pid > of the lmtp process. (Or some other values in some other format) > > The cid should be used in the 'saved' messages. So the delivering MTA > would see something like '250 2.0.0 OK: 1255555555.12345 Saved', > instead of a message like '250 2.0.0 <jdoe at example.com> Saved'. > The lmtp should also write the cid to the log. For example: > 'lmtp(jdoe): Info: msgid=123, cid=1255555555.12345: saved mail to INBOX' > (or discarded because of a matching sieve rule). > > With this connection ID it would be possible to trace the route which > the e-mail has taken.Sounds like the ESMTP id that SMTP servers add to Received: header. Perhaps LMTP should also be adding the header? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20091023/d245c617/attachment-0002.bin>
On 10/24/2009 12:34 AM Timo Sirainen wrote:> On Sat, 2009-10-24 at 00:02 +0200, Pascal Volk wrote: >> I think it would be useful if the lmtp would also log new connections. >> For example: >> a) TCP connections: >> lmtp: Info: Connection: rip=10.1.2.3, lip=10.1.2.5, cid=1255555555.12345 >> b) Socket connections: >> lmtp: Info: Connection: via socket, cid=1255555777.10452 > > Maybe this could be merged somehow with login_log_format* settings, > since they're pretty similar..Call them connect_log_format and disconnect_log_format, because there is no login/logout w/o LMTPA(S).>> cid: >> The 'connection ID', consists of the current unix time and the pid >> of the lmtp process. (Or some other values in some other format) >> ? >> would see something like '250 2.0.0 OK: 1255555555.12345 Saved', >> ? > > Sounds like the ESMTP id that SMTP servers add to Received: header. > Perhaps LMTP should also be adding the header?Yes, because LMTP is identical to ESMTP, except the few points from RFC2033. Regards, Pascal -- The trapper recommends today: 5e1f1e55.0929701 at localdomain.org