[Dovecot] lmtp proxy logging

Jack Bates jbates at brightok.net
Thu Oct 18 06:48:42 EEST 2012


Timo,

How do you feel about parent pointers in child structures? I'm curious 
as the proxy structure is passed the input channel, but it doesn't know 
much else about the input client. Rather than pass additional 
information in the structure, I think it'd be better to just place a 
pointer back to the input client so we can access all it's details.

I ask, as that might solve the problem of lack of information in logging 
from some of the various functions in the proxy code. I know I was 
limited in the quick patch I did below for my own use. I'm afraid to 
change it too much. You have already started xclient work in v2.2 which 
would necessitate a lot of changes to the lmtp/proxy code. I've actually 
debated backporting it to 2.1 for my own use. :)


Jack

On 10/15/2012 3:10 PM, Jack Bates wrote:
> On 10/15/2012 2:07 PM, Jack Bates wrote:
>> On 10/12/2012 2:40 AM, Timo Sirainen wrote:
>>>   would probably complicate the code.
>>> I don't think this would be difficult to implement. Probably just a 
>>> few lines of code. Yeah, could be useful.
>>>
>>>
>>
>
> If there's no argument over the last email, confirm and check this 
> patch. It's not the overall logging I would like, but the lmtp code 
> isn't as mature as pop3/imap and the proxy is a quick and dirty on the 
> lmtp code. Both need a good revamp, preferably with x-session support 
> and perhaps logging rip/lip similar to how we do pop3/imap logins.
>
> I think we should also work on adjusting all logging for services 
> using x-session to also log the proxy ip. rip,lip,pip. As I get time 
> I'll look at it.
>
> This patch is just to keep us from having no useful logging in lmtp 
> proxy. Based on lmtp pid, one can at least follow the connect, the 
> proxy replies, and the disconnect of a session.
>
> --- dovecot-2.1.10/src/lmtp/lmtp-proxy.c        2012-10-12 
> 19:46:49.688952484 +0000
> +++ dovecot-2.1.10/src/lmtp/lmtp-proxy.c-new    2012-10-12 
> 19:48:51.751932325 +0000
> @@ -160,6 +160,8 @@ static bool lmtp_proxy_send_data_replies
>                         break;
>                 o_stream_send_str(proxy->client_output,
>                                   t_strconcat(rcpt[i]->reply, "\r\n", 
> NULL));
> +               i_info("proxy(%s): proxy host=%s: 
> status=%s",rcpt[i]->address,
> + rcpt[i]->conn->set.host,rcpt[i]->reply);
>         }
>         o_stream_uncork(proxy->client_output);
>         proxy->next_data_reply_idx = i;
>
>




More information about the dovecot mailing list