Logging when proxying SMTP / IMAP / POP sessions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging when proxying SMTP / IMAP / POP sessions

Luis E. Muñoz

Hi there,

For an email proxying setup using the open source version of Nginx, I have a configuration stanza along these lines:

⋮
mail {
  server_name              mail.DOMAIN;
  auth_http                127.0.0.1:8080/auth;
  proxy_pass_error_message on;

  imap_capabilities        "IMAP4rev1" "UIDPLUS";
  imap_auth                login plain;

  server  {
    protocol imap;
    proxy on;

    ssl on;

    ssl_certificate     ⋯;
    ssl_certificate_key ⋯;

    listen [::]:993 ssl;
    listen 993 ssl;
  }
  ⋮
}
⋮

Proxying and authentication works as advertised, no issues. However, I've been unable to locate any piece of documentation indicating how to produce a suitable access log message (ie, a log tying the mail client with the backend server its connection was sent to). I've tried the access_log / error_log directives at various places in the configuration, to no avail.

HTTP/HTTPS logging works as usual.

Given how I've not seen any mention to logging in the various documents that describe SMTP/IMAP/POP proxying, I believe the functionality for this does not currently exist. This logging is very important for troubleshooting and support.

Is there something I'm overlooking? If indeed the functionality doesn't exist, would it be possible for me to write and contribute the code required to add said logging?

Thanks in advance.

-lem


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Logging when proxying SMTP / IMAP / POP sessions

Maxim Dounin
Hello!

On Tue, Jan 16, 2018 at 12:23:31PM -0800, Luis E. Muñoz wrote:

[...]

> Proxying and authentication works as advertised, no issues. However,
> I've been unable to locate any piece of documentation indicating how to
> produce a suitable access log message (ie, a log tying the mail client
> with the backend server its connection was sent to). I've tried the
> `access_log` / `error_log` directives at various places in the
> configuration, to no avail.
>
> HTTP/HTTPS logging works as usual.
>
> Given how I've not seen any mention to logging in the various documents
> that describe SMTP/IMAP/POP proxying, I believe the functionality for
> this does not currently exist. This logging is very important for
> troubleshooting and support.
>
> Is there something I'm overlooking? If indeed the functionality doesn't
> exist, would it be possible for me to write and contribute the code
> required to add said logging?

The error_log directive as available in the core module works for
mail module, too.  If needed, you can set a specific error log in
mail{} or server{} contexts.  See http://nginx.org/r/error_log for
details.

There is no access log support for mail.  Instead, basic mail
session events are logged to the error log at the "info" level.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Logging when proxying SMTP / IMAP / POP sessions

Luis E. Muñoz

On 17 Jan 2018, at 4:38, Maxim Dounin wrote:

On Tue, Jan 16, 2018 at 12:23:31PM -0800, Luis E. Muñoz wrote:

Given how I've not seen any mention to logging in the various documents
that describe SMTP/IMAP/POP proxying, [⋯]

The error_log directive as available in the core module works for
mail module, too. If needed, you can set a specific error log in
mail{} or server{} contexts. See http://nginx.org/r/error_log for
details.

There is no access log support for mail. Instead, basic mail
session events are logged to the error log at the "info" level.

Thank you very much for your response. Indeed, the error_log directive produces suitable logging that include both ends of the proxied connection.

Best regards

Luis Muñoz
Director, Registry Operations
____________________________

2161 San Joaquin Hills Road
Newport Beach, CA 92660

Office +1 949 706 2300 x 4242
[hidden email]


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx