[Dovecot] IP in rawlog

Andreas Goertz andreas.goertz at hosteurope.de
Mon Jun 13 16:27:56 EEST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Timo,

i got a new problem :-/ Generally, this code works fine, but when using
SSL, it doesn't - it only prints 'null' in rawlog. Could you give me
another hint please?

To remind: i needed to rawlog the client's ip on connect and am using
dovecot 0.99.14.

Thanks in advance ;-)

Regards,
Andreas.

Andreas Goertz schrieb:
> Timo Sirainen schrieb:
> | On Tue, 2005-03-15 at 10:45 +0100, Andreas Goertz wrote:
> |
> |>| no - this patch doesn't seem to work, because in rawlog.c proxy is
> |>| not declared. So i looked for the call to rawlog_open() and saw that
> |>| it's only called from main.c in imap and pop3 folder. But there also
> |>| is no proxy declared. Do you have another idea? Thanks in advance.
> |
> |
> | That code was for 1.0-tests, 0.99.x has entirely different rawlog code.
> 
> ah - i see.
> 
> |>Hmm - while searching for another solution i found the function
> |>client_syslog() in imap-login/client.c. If i understand it correctly,
> |>i_info() only writes to the syslog and i have no clue, how to write into
> |>rawlog from client.c respectively client_syslog().
> |
> |
> | Only rawlog.c knows about rawlog, it's also running as separate process
> | so it's not even possible to see it in client.c code.
> |
> | Here's a patch for 0.99.14:
> 
> thank you very much Timo, i'll try this out ;-)
> 
> |
> | --- rawlog.c.old    2005-03-15 22:59:52.731934694 +0200
> | +++ rawlog.c    2005-03-15 23:01:10.535201787 +0200
> | @@ -89,6 +89,7 @@
> |  void rawlog_open(int *hin, int *hout)
> |  {
> |      struct io *io_imap, *io_client;
> | +    struct ip_addr ip;
> |      const char *home, *path, *fname;
> |      char timestamp[50];
> |      struct tm *tm;
> | @@ -131,6 +132,11 @@
> |          return;
> |      }
> |
> | +    if (net_getpeername(0, &ip, NULL) == 0) {
> | +        str = t_strdup_printf("IP: %s\n", net_ip2addr(&ip));
> | +        write_full(log_out, str, strlen(str));
> | +    }
> | +
> |      /* we need to fork the rawlog writer to separate process since
> |         imap process does blocking writes. */
> |      if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0)
> |
> 
> Regards,
> Andreas.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCrYnbpAOZWzj6viQRApfJAJ4v0X5IUghKn/kBeMIHC8xm1bgEhACgnYUp
nn5ygAfRWks2H18eeZMcNvA=
=2uvE
-----END PGP SIGNATURE-----



More information about the dovecot mailing list