summaryrefslogtreecommitdiffhomepage
path: root/src/mail/ngx_mail_smtp_handler.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-03-05Mail: added missing event handling after reading data.Maxim Dounin1-1/+15
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.
2021-03-05Mail: added missing event handling after blocking events.Maxim Dounin1-0/+6
As long as a read event is blocked (ignored), ngx_handle_read_event() needs to be called to make sure no further notifications will be triggered when using level-triggered event methods, such as select() or poll().
2019-08-01Mail: fixed duplicate resolving.Maxim Dounin1-0/+43
When using SMTP with SSL and resolver, read events might be enabled during address resolving, leading to duplicate ngx_mail_ssl_handshake_handler() calls if something arrives from the client, and duplicate session initialization - including starting another resolving. This can lead to a segmentation fault if the session is closed after first resolving finished. Fix is to block read events while resolving. Reported by Robert Norris, http://mailman.nginx.org/pipermail/nginx/2019-July/058204.html.
2017-01-12Mail: make it possible to disable SASL EXTERNAL.Sergey Kandaurov1-2/+6
2016-10-08Mail: support SASL EXTERNAL (RFC 4422).Rob N ★1-0/+11
This is needed to allow TLS client certificate auth to work. With ssl_verify_client configured, the auth daemon can choose to allow the connection to proceed based on the certificate data. This has been tested with Thunderbird for IMAP only. I've not yet found a client that will do client certificate auth for POP3 or SMTP, and the method is not really documented anywhere that I can find. That said, its simple enough that the way I've done is probably right.
2016-03-30Style.Ruslan Ermilov1-1/+1
2014-08-05Mail: discard pipelined commands after SMTP STARTTLS.Maxim Dounin1-0/+3
The bug had appeared in nginx 1.5.6 (04e43d03e153). Reported by Chris Boulton.
2014-05-21Mail: added a check for the number of arguments in MAIL/RCPT.Maxim Dounin1-0/+10
Missed during introduction of the SMTP pipelining support (04e43d03e153, 1.5.6). Previously, the check wasn't needed as s->buffer was used directly and the number of arguments didn't matter. Reported by Svyatoslav Nikolsky.
2013-12-09Resolver: implemented IPv6 name to address resolving.Ruslan Ermilov1-1/+0
2013-12-06Changed resolver API to use ngx_addr_t.Ruslan Ermilov1-20/+23
2013-09-30Mail: smtp pipelining support.Maxim Dounin1-57/+26
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).
2013-09-30Mail: added session close on smtp_greeting_delay violation.Maxim Dounin1-0/+1
A server MUST send greeting before other replies, while before this change in case of smtp_greeting_delay violation the 220 greeting was sent after several 503 replies to commands received before greeting, resulting in protocol synchronization loss. Moreover, further commands were accepted after the greeting. While closing a connection isn't strictly RFC compliant (RFC 5321 requires servers to wait for a QUIT before closing a connection), it's probably good enough for practial uses.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-50/+23
2009-11-09*) fix resolving an empty name ("."),Igor Sysoev1-14/+1
*) add quotes in an error message, *) backout r3299 in ngx_mail_smtp_handler.c
2009-11-09fix "PTR ." case in address resolverIgor Sysoev1-0/+13
2009-05-18mail proxy listen IPv6 supportIgor Sysoev1-0/+6
2009-02-09compatibility with Microsoft'sIgor Sysoev1-1/+9
AUTH LOGIN [base64 encoded user name ] patch by Maxim Dounin
2009-01-31avoid deep nested calls, flatten call treeIgor Sysoev1-3/+20
2008-12-09use "!= NGX_OK" instead of "== NGX_ERROR"Igor Sysoev1-3/+3
2008-11-13smtp_auth noneIgor Sysoev1-4/+149
patch by Maxim Dounin
2008-06-17*) back out r2040Igor Sysoev1-1/+1
*) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
2008-02-16do not resolve SMTP clients by defaultIgor Sysoev1-2/+8
2008-02-13resolver in smtp proxy moduleIgor Sysoev1-0/+166
2007-12-21fix STARTTLS prompt in SMTPIgor Sysoev1-0/+3
2007-12-10move condition declarations inside blocks where they are usedIgor Sysoev1-3/+2
2007-09-21use "_" instead of " " as new line substitute, do not delete trailing new lineIgor Sysoev1-9/+1
2007-09-15ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_moduleIgor Sysoev1-17/+25
2007-09-14style fix: remove trailing spacesIgor Sysoev1-4/+4
2007-09-14create salt just before it will be usedIgor Sysoev1-7/+6
2007-09-14fix r1482Igor Sysoev1-0/+2
2007-09-14ngx_mail_smtp_create_buffer()Igor Sysoev1-15/+36
2007-09-14optimizationsIgor Sysoev1-2/+2
2007-09-14smtp_client_buffer and smtp_greeting_delayIgor Sysoev1-49/+158
2007-09-14move event handling to protocol specific code,Igor Sysoev1-1/+7
it is required to support SMTP greeting delay
2007-09-13optimizationsIgor Sysoev1-60/+22
2007-09-13style fix and optimizationsIgor Sysoev1-3/+3
2007-09-13split pop3, imap, and smtp handlersIgor Sysoev1-0/+449