<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/mail/ngx_mail_smtp_handler.c, branch release-1.30.0</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Mail: host validation.</title>
<updated>2026-03-24T14:46:08+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2026-02-26T07:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=6f3145006b41a4ec464eed4093553a335d35e8ac'/>
<id>6f3145006b41a4ec464eed4093553a335d35e8ac</id>
<content type='text'>
Now host name resolved from client address is validated to only contain
the characters specified in RFC 1034, Section 3.5.  The validation allows
to avoid injections when using the resolved host name in auth_http and
smtp proxy.

Reported by Asim Viladi Oglu Manizada, Colin Warren,
Xiao Liu (Yunnan University), Yuan Tan (UC Riverside), and
Bird Liu (Lanzhou University).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now host name resolved from client address is validated to only contain
the characters specified in RFC 1034, Section 3.5.  The validation allows
to avoid injections when using the resolved host name in auth_http and
smtp proxy.

Reported by Asim Viladi Oglu Manizada, Colin Warren,
Xiao Liu (Yunnan University), Yuan Tan (UC Riverside), and
Bird Liu (Lanzhou University).
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: reset stale auth credentials with "smtp_auth none;".</title>
<updated>2025-08-13T14:20:34+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2025-07-07T19:48:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=9c02c84a7443f3d736a1a5eb3f596de9af8a0c9c'/>
<id>9c02c84a7443f3d736a1a5eb3f596de9af8a0c9c</id>
<content type='text'>
They might be reused in a session if an SMTP client proceeded
unauthenticated after previous invalid authentication attempts.
This could confuse an authentication server when passing stale
credentials along with "Auth-Method: none".

The condition to send the "Auth-Salt" header is similarly refined.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They might be reused in a session if an SMTP client proceeded
unauthenticated after previous invalid authentication attempts.
This could confuse an authentication server when passing stale
credentials along with "Auth-Method: none".

The condition to send the "Auth-Salt" header is similarly refined.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: added missing event handling after reading data.</title>
<updated>2021-03-05T14:16:17+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-03-05T14:16:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=065a1641b242538073e92065e20fd788203108ab'/>
<id>065a1641b242538073e92065e20fd788203108ab</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: added missing event handling after blocking events.</title>
<updated>2021-03-05T14:16:16+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-03-05T14:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=8ed63c936c1493a25bdcb351a812de1ebac8b976'/>
<id>8ed63c936c1493a25bdcb351a812de1ebac8b976</id>
<content type='text'>
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().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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().
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: fixed duplicate resolving.</title>
<updated>2019-08-01T10:50:07+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-08-01T10:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=abe660636c93315b4acb8531b83aec8d309d2eca'/>
<id>abe660636c93315b4acb8531b83aec8d309d2eca</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: make it possible to disable SASL EXTERNAL.</title>
<updated>2017-01-12T16:22:03+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2017-01-12T16:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=b5a3cc3781e95068cd8d0d8c84a7d8296b6682e6'/>
<id>b5a3cc3781e95068cd8d0d8c84a7d8296b6682e6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: support SASL EXTERNAL (RFC 4422).</title>
<updated>2016-10-08T07:05:00+00:00</updated>
<author>
<name>Rob N ★</name>
<email>robn@fastmail.com</email>
</author>
<published>2016-10-08T07:05:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=66c23edf6308867572d5c4b8341e7a3fe7e97864'/>
<id>66c23edf6308867572d5c4b8341e7a3fe7e97864</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Style.</title>
<updated>2016-03-30T08:52:16+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2016-03-30T08:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=7ad57da59821294255610545b2b5ce07e74124a5'/>
<id>7ad57da59821294255610545b2b5ce07e74124a5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: discard pipelined commands after SMTP STARTTLS.</title>
<updated>2014-08-05T08:22:07+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2014-08-05T08:22:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=44f45a54667275878236991afab0472c209dac78'/>
<id>44f45a54667275878236991afab0472c209dac78</id>
<content type='text'>
The bug had appeared in nginx 1.5.6 (04e43d03e153).

Reported by Chris Boulton.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The bug had appeared in nginx 1.5.6 (04e43d03e153).

Reported by Chris Boulton.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mail: added a check for the number of arguments in MAIL/RCPT.</title>
<updated>2014-05-21T17:56:20+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2014-05-21T17:56:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=ca02a1020c41cc771d4ed6f854213edf594b4480'/>
<id>ca02a1020c41cc771d4ed6f854213edf594b4480</id>
<content type='text'>
Missed during introduction of the SMTP pipelining support (04e43d03e153,
1.5.6).  Previously, the check wasn't needed as s-&gt;buffer was used directly
and the number of arguments didn't matter.

Reported by Svyatoslav Nikolsky.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Missed during introduction of the SMTP pipelining support (04e43d03e153,
1.5.6).  Previously, the check wasn't needed as s-&gt;buffer was used directly
and the number of arguments didn't matter.

Reported by Svyatoslav Nikolsky.
</pre>
</div>
</content>
</entry>
</feed>
