[dovecot/core] a8b750: lib-smtp: client: Fix memory issue caused when rec...

GitHub noreply at github.com
Wed Oct 10 13:30:07 EEST 2018


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: a8b750ef4e88a08c3e685e53f54de012e7e031f2
      https://github.com/dovecot/core/commit/a8b750ef4e88a08c3e685e53f54de012e7e031f2
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-connection.c
    M src/lib/connection.c

  Log Message:
  -----------
  lib-smtp: client: Fix memory issue caused when reconnecting.


  Commit: 24f9503896b2947d445fe8244866767d3a7cd796
      https://github.com/dovecot/core/commit/24f9503896b2947d445fe8244866767d3a7cd796
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-command.c
    M src/lib-smtp/smtp-client-private.h

  Log Message:
  -----------
  lib-smtp: client: Add smtp_client_command_drop_callback().


  Commit: 3743378198d726336c3929654c643e3bd1bb0af7
      https://github.com/dovecot/core/commit/3743378198d726336c3929654c643e3bd1bb0af7
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-command.c

  Log Message:
  -----------
  lib-smtp: client: Clear command callback early to prevent mishaps.


  Commit: 887b2096a2bc1523d17d7b2219b7305825e462ae
      https://github.com/dovecot/core/commit/887b2096a2bc1523d17d7b2219b7305825e462ae
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Set the number of expected DATA replies > 1 only for LMTP.

This was already OK for when all recipients were added at the time the data
command was to be sent. However, for more dynamic transactions involving
pipelining, this was not handled correctly.


  Commit: e6c9e368d438a3f11c3aaeebe12417c0579f6a40
      https://github.com/dovecot/core/commit/e6c9e368d438a3f11c3aaeebe12417c0579f6a40
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-command.c
    M src/lib-smtp/smtp-client-connection.c

  Log Message:
  -----------
  lib-smtp: client: Properly manage command timeout during transaction.


  Commit: 51c917f8e3a1c5353e87dc3359b1be70bdec92c3
      https://github.com/dovecot/core/commit/51c917f8e3a1c5353e87dc3359b1be70bdec92c3
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-server-cmd-mail.c

  Log Message:
  -----------
  lib-smtp: server: MAIL command: Reliably start the transaction when several MAIL commands are pipelined.


  Commit: 46a6901cd14512db2455c9562beecb9f857dbbb6
      https://github.com/dovecot/core/commit/46a6901cd14512db2455c9562beecb9f857dbbb6
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-server-command.c
    M src/lib-smtp/smtp-server-private.h
    M src/lib-smtp/smtp-server-reply.c
    M src/lib-smtp/smtp-server.h

  Log Message:
  -----------
  lib-smtp: server: Add ability to determine whether command reply was created using smtp_server_reply_create_forward().


  Commit: 6406c30c908ab84d4a928f3680fba976b2d04bcc
      https://github.com/dovecot/core/commit/6406c30c908ab84d4a928f3680fba976b2d04bcc
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-server-cmd-mail.c

  Log Message:
  -----------
  lib-smtp: server: MAIL command: Improve replacement of (forwarded) specific error reply with generic state error.

Predictable transaction state errors were not always replaced reliably when
commands were pipelined, leading to a mix of proxy and remote errors.


  Commit: e255197476ed8b43f08b466b936be6f6622dc154
      https://github.com/dovecot/core/commit/e255197476ed8b43f08b466b936be6f6622dc154
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-server-cmd-rcpt.c

  Log Message:
  -----------
  lib-smtp: server: RCPT command: Improve replacement of (forwarded) specific error reply with generic state error.

Predictable transaction state errors were not always replaced reliably when
commands were pipelined, leading to a mix of proxy and remote errors.


  Commit: a2cbf003b701884a0edca46fdadaa1a9c8a9937f
      https://github.com/dovecot/core/commit/a2cbf003b701884a0edca46fdadaa1a9c8a9937f
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-connection.c

  Log Message:
  -----------
  lib-smtp: client: connection: Add debug messages for transaction handling.


  Commit: 2ddbfc7e717b3994be38f598d944cdf22b68aa17
      https://github.com/dovecot/core/commit/2ddbfc7e717b3994be38f598d944cdf22b68aa17
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Make sure the transaction is finished/aborted after smtp_client_connection_destroy().

Otherwise, the transaction could be dereferenced several times too often.


  Commit: 5457f5a8e7a64a10660e94dd227371ed6e5ef80a
      https://github.com/dovecot/core/commit/5457f5a8e7a64a10660e94dd227371ed6e5ef80a
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Add debug message for when smtp_client_transaction_abort() is called during smtp_client_transaction_fail*().


  Commit: 4bee7b2225ee791f9a4135b4f33249b7126dbb87
      https://github.com/dovecot/core/commit/4bee7b2225ee791f9a4135b4f33249b7126dbb87
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Annotate sub-parts of smtp_client_transaction_fail_reply() with comments.


  Commit: cc9d4ca924b1648964b5d651509580d57bc302ad
      https://github.com/dovecot/core/commit/cc9d4ca924b1648964b5d651509580d57bc302ad
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Prevent calling callbacks after smtp_client_transaction_destroy().


  Commit: 479f191070891f2555be5cd3f954b19c4e019623
      https://github.com/dovecot/core/commit/479f191070891f2555be5cd3f954b19c4e019623
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Don't trigger next transaction unless all RCPT replies are received and DATA is submitted.

Triggering the next transaction when DATA submitted while not all RCPT replies
are received (as it was before) is problematic when commands are submitted
immediately by the transaction (which is added in a later commit).


  Commit: b1f36abdf4512c81c237545e74a1c52994f5b6fa
      https://github.com/dovecot/core/commit/b1f36abdf4512c81c237545e74a1c52994f5b6fa
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Move the code executed at the completion of the transaction to a separate shared function.

The transaction is complete when all RCPT replies are received and either a DATA
or a RSET command is submitted.


  Commit: 5db6074a8c6c4f9a71c6ad9a23a363fa6cf36a5a
      https://github.com/dovecot/core/commit/5db6074a8c6c4f9a71c6ad9a23a363fa6cf36a5a
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Rename smtp_client_transaction_send_rcpts() to smtp_client_transaction_submit_more().


  Commit: 42fd1786dddcece2ef020f3e1f59e605ed3fea18
      https://github.com/dovecot/core/commit/42fd1786dddcece2ef020f3e1f59e605ed3fea18
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Move initiation of command submission after starting the transaction timeout.

This is a precaution against the emergence of segfaults when command submission
somehow terminates the transaction in a future version (actually, a segfault
did emerge in an earlier version of this set of changes). Also it is a cosmetic
change: putting the most important act at the end of the function makes more
sense in this case.


  Commit: 508f855ca803e9642cb3b326a031c4475bd7db8c
      https://github.com/dovecot/core/commit/508f855ca803e9642cb3b326a031c4475bd7db8c
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Move smtp_client_transaction_submit_more().


  Commit: e1985046c8c041a541e892b07d45087244ae66f7
      https://github.com/dovecot/core/commit/e1985046c8c041a541e892b07d45087244ae66f7
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Annotate sub-parts of smtp_client_transaction_send_more() with comments.


  Commit: 1dd38f34b3f162d841cf47e1db397d09ace5cdfb
      https://github.com/dovecot/core/commit/1dd38f34b3f162d841cf47e1db397d09ace5cdfb
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Perform pipeline plug handling just once at top-level in smtp_client_transaction_submit_more().


  Commit: dee73f5359853d9ccc2d07d7a8ba1a5309de2fb9
      https://github.com/dovecot/core/commit/dee73f5359853d9ccc2d07d7a8ba1a5309de2fb9
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Move initiation of command submission to a central position.


  Commit: 7d8abb1bff2e06fe076fdf38ba1a010fbf55a4c2
      https://github.com/dovecot/core/commit/7d8abb1bff2e06fe076fdf38ba1a010fbf55a4c2
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add support for ending the transaction in a graceful RSET command.

Allows running the pending transaction until RSET, without abruptly aborting
it or issuing a DATA command.


  Commit: ac70d0d1f309a345274c1e90d4340f576e9dda37
      https://github.com/dovecot/core/commit/ac70d0d1f309a345274c1e90d4340f576e9dda37
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Use linked lists rather than arrays for recipients.


  Commit: dbf6a2120c320c4cc58d720fbc60689b09bda46d
      https://github.com/dovecot/core/commit/dbf6a2120c320c4cc58d720fbc60689b09bda46d
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Rename mail_from_callback/mail_from_context to mail_callback/mail_context.


  Commit: 095769c585772a1668289a2c775275b884e4ee20
      https://github.com/dovecot/core/commit/095769c585772a1668289a2c775275b884e4ee20
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: transaction: Add infrastructure for pipelining more than a single MAIL command.


  Commit: 3cc2a33aea3cc8521203d775c405f5db15e37dfd
      https://github.com/dovecot/core/commit/3cc2a33aea3cc8521203d775c405f5db15e37dfd
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add support for pipelining more than a single MAIL command.


  Commit: cf50fbb04dda2bc33f0a486c9ac51ae77a11221f
      https://github.com/dovecot/core/commit/cf50fbb04dda2bc33f0a486c9ac51ae77a11221f
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add support for creating an empty transaction (without MAIL FROM data).


  Commit: 75839000b5e45f3edda4c3715419781a106aa8e3
      https://github.com/dovecot/core/commit/75839000b5e45f3edda4c3715419781a106aa8e3
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add support for aborting a pending MAIL command.


  Commit: 210e323bb1f9febc67628c04470589c50270b6aa
      https://github.com/dovecot/core/commit/210e323bb1f9febc67628c04470589c50270b6aa
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add support for aborting a pending RCPT command.


  Commit: 83b435744c14a4dd6ff6cc226f3769b9ec432ef2
      https://github.com/dovecot/core/commit/83b435744c14a4dd6ff6cc226f3769b9ec432ef2
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-connection.c
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c

  Log Message:
  -----------
  lib-smtp: client: Fully disconnect the connection upon failure before triggering failure callbacks.


  Commit: be1fef356b058f1fff52455e4a7b12f80c06e594
      https://github.com/dovecot/core/commit/be1fef356b058f1fff52455e4a7b12f80c06e594
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/lib-smtp/smtp-client-private.h
    M src/lib-smtp/smtp-client-transaction.c
    M src/lib-smtp/smtp-client-transaction.h

  Log Message:
  -----------
  lib-smtp: client: transaction: Add option to submit commands immediately, rather than queueing them on a zero timeout.

Also, allow interleaving other unrelated (non-transaction) commands. This is
made possible by not locking/plugging the command pipeline.


  Commit: 9dff384d0bec102a53e5ee35918ffdebf8bea8ce
      https://github.com/dovecot/core/commit/9dff384d0bec102a53e5ee35918ffdebf8bea8ce
  Author: Stephan Bosch <stephan.bosch at dovecot.fi>
  Date:   2018-10-10 (Wed, 10 Oct 2018)

  Changed paths:
    M src/submission/submission-backend-relay.c

  Log Message:
  -----------
  submission: relay backend: Use SMTP client transaction API, rather than relaying individual commands.


Compare: https://github.com/dovecot/core/compare/94a30fa2a478...9dff384d0bec
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the dovecot-cvs mailing list