]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib-lda: smtp-client: Make sure only the first error determines the tempfail status.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 1 Mar 2017 23:03:50 +0000 (00:03 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 27 Mar 2017 09:39:36 +0000 (12:39 +0300)
commit14a37c403acfe3e7f040f1aab37f70a2b3cc1379
tree02b4033cefb449016386918111b39a6222fec2e3
parent077b350ebf3542424b31693ccc6f2fc7d4524f98
lib-lda: smtp-client: Make sure only the first error determines the tempfail status.

The client is supposed to stop running the moment the first error occurs. However, there is a (very unlikely) possiblity that the encapsulated LMTP client issues both an RCPT and DATA error callback in sequence.
In that case, the second callback should not override the tempfail status of the first (the second likely is a tempfail).
If the server disconnects right after failing the last of at least two recipients, the lmtp-client would issue a DATA callback with a disconnection error.
The disconnect error would set the client->tempfail flag, which caused smtp_client_deinit*() to always return -1 in this scenario.
src/lib-lda/smtp-client.c