aboutsummaryrefslogtreecommitdiff
path: root/src/mail/ngx_mail_proxy_module.c
Commit message (Collapse)AuthorAge
* Mail: handling of LOGIN IMAP command untagged response.Sergey Kandaurov2024-11-26
| | | | | | | In particular, an untagged CAPABILITY response as described in the interim RFC 3501 internet drafts was seen in various IMAP servers. Previously resulted in a broken connection, now an untagged response is proxied to client.
* Mail: fixed handling of blocked client read events in proxy.Maxim Dounin2023-03-24
| | | | | | | | | | | | | | When establishing a connection to the backend, nginx blocks reading from the client with ngx_mail_proxy_block_read(). Previously, such events were lost, and in some cases this resulted in connection hangs. Notably, this affected mail_imap_ssl.t on Windows, since the test closes connections after requesting authentication, but without waiting for any responses (so the connection close events might be lost). Fix is to post an event to read from the client after connecting to the backend if there were blocked events.
* Increased maximum read PROXY protocol header size.Roman Arutyunyan2022-11-02
| | | | | | | | Maximum size for reading the PROXY protocol header is increased to 4096 to accommodate a bigger number of TLVs, which are supported since cca4c8a715de. Maximum size for writing the PROXY protocol header is not changed since only version 1 is currently supported.
* Mail: IMAP pipelining support.Maxim Dounin2021-05-19
| | | | | | | | | | The change is mostly the same as the SMTP one (04e43d03e153 and 3f5d0af4e40a), and ensures that nginx is able to properly handle or reject multiple IMAP commands. The s->cmd field is not really used and set for consistency. Non-synchronizing literals handling in invalid/unknown commands is limited, so when a non-synchronizing literal is detected at the end of a discarded line, the connection is closed.
* Mail: POP3 pipelining support.Maxim Dounin2021-05-19
| | | | | | | The change is mostly the same as the SMTP one (04e43d03e153 and 3f5d0af4e40a), and ensures that nginx is able to properly handle or reject multiple POP3 commands, as required by the PIPELINING capability (RFC 2449). The s->cmd field is not really used and set for consistency.
* Mail: fixed SMTP pipelining to send the response immediately.Maxim Dounin2021-05-19
| | | | | | | | | | | | | Previously, if there were some pipelined SMTP data in the buffer when a proxied connection with the backend was established, nginx called ngx_mail_proxy_handler() to send these data, and not tried to send the response to the last command. In most cases, this response was later sent along with the response to the pipelined command, but if for some reason client decides to wait for the response before finishing the next command this might result in a connection hang. Fix is to always call ngx_mail_proxy_handler() to send the response, and additionally post an event to send the pipelined data if needed.
* Mail: sending of the PROXY protocol to backends.Maxim Dounin2021-03-05
| | | | | | Activated with the "proxy_protocol" directive. Can be combined with "listen ... proxy_protocol;" and "set_real_ip_from ...;" to pass client address provided to nginx in the PROXY protocol header.
* Mail: added missing event handling after reading data.Maxim Dounin2021-03-05
| | | | | | | | | | | | | If we need to be notified about further events, ngx_handle_read_event() needs to be called after a read event is processed. Without this, an event can be removed from the kernel and won't be reported again, notably when using oneshot event methods, such as eventport on Solaris. For consistency, existing ngx_handle_read_event() call removed from ngx_mail_read_command(), as this call only covers one of the code paths where ngx_mail_read_command() returns NGX_AGAIN. Instead, appropriate processing added to the callers, covering all code paths where NGX_AGAIN is returned.
* Mail: proxy_smtp_auth directive.Maxim Dounin2020-10-03
| | | | | | | | | The proxy_smtp_auth directive instructs nginx to authenticate users on backend via the AUTH command (using the PLAIN SASL mechanism), similar to what is normally done for IMAP and POP3. If xclient is enabled along with proxy_smtp_auth, the XCLIENT command won't try to send the LOGIN parameter.
* Fixed worker_shutdown_timeout in various cases.Maxim Dounin2017-11-20
| | | | | | | | | | | | | | | | | | The ngx_http_upstream_process_upgraded() did not handle c->close request, and upgraded connections do not use the write filter. As a result, worker_shutdown_timeout did not affect upgraded connections (ticket #1419). Fix is to handle c->close in the ngx_http_request_handler() function, thus covering most of the possible cases in http handling. Additionally, mail proxying did not handle neither c->close nor c->error, and thus worker_shutdown_timeout did not work for mail connections. Fix is to add c->close handling to ngx_mail_proxy_handler(). Also, added explicit handling of c->close to stream proxy, ngx_stream_proxy_process_connection(). This improves worker_shutdown_timeout handling in stream, it will no longer wait for some data being transferred in a connection before closing it, and will also provide appropriate logging at the "info" level.
* Fixed logging.Sergey Kandaurov2016-03-31
|
* Removed the deprecated "so_keepalive" directive.Ruslan Ermilov2015-04-29
|
* Mail: fixed passing of IPv6 client address in XCLIENT.Ruslan Ermilov2014-01-17
|
* Mail: handle smtp multiline replies.Maxim Dounin2013-09-30
| | | | | | | | See here for details: http://nginx.org/pipermail/nginx/2010-August/021713.html http://nginx.org/pipermail/nginx/2010-August/021784.html http://nginx.org/pipermail/nginx/2010-August/021785.html
* Mail: smtp pipelining support.Maxim Dounin2013-09-30
| | | | | | | | | | | Basically, this does the following two changes (and corresponding modifications of related code): 1. Does not reset session buffer unless it's reached it's end, and always wait for LF to terminate command (even if we detected invalid command). 2. Record command name to make it available for handlers (since now we can't assume that command starts from s->buffer->start).
* Copyright updated.Maxim Konovalov2012-01-18
|
* Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse.Sergey Budnevitch2011-11-14
|
* ngx_str_set() and ngx_str_null()Igor Sysoev2010-05-14
|
* Zimbra IMAP server may return only 4 bytes: "+ \r\n"Igor Sysoev2010-04-23
|
* rename ngx_peer_addr_t to ngx_addr_tIgor Sysoev2009-11-02
|
* return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev2009-06-02
|
* send HELO/EHLO after XCLIENTIgor Sysoev2009-02-10
| | | | patch by Maxim Dounin
* update r2439: make clear nameIgor Sysoev2009-01-13
|
* fix r2312Igor Sysoev2009-01-12
|
* use "!= NGX_OK" instead of "== NGX_ERROR"Igor Sysoev2008-12-09
|
* do not close session if SMTP backend returned an error on RCPT TOIgor Sysoev2008-11-13
| | | | patch by Maxim Dounin
* smtp_auth noneIgor Sysoev2008-11-13
| | | | patch by Maxim Dounin
* *) back out r2040Igor Sysoev2008-06-17
| | | | | | *) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
* reset messageIgor Sysoev2008-04-29
|
* resolver in smtp proxy moduleIgor Sysoev2008-02-13
|
* ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_moduleIgor Sysoev2007-09-15
|
* fix case when client has closed connection but upstream buffer is not emptyIgor Sysoev2007-07-24
|
* style fix: remove tabsIgor Sysoev2007-04-18
|
* Many changes:Igor Sysoev2007-03-19
*) rename imap to mail, sort pop3/imap functions *) smtp auth support *) pop3 starttls only *) fix segfault if cram-md5 was used without apop