diff -Nru isync-1.4.4/debian/changelog isync-1.4.4/debian/changelog --- isync-1.4.4/debian/changelog 2022-01-15 14:38:06.000000000 +0000 +++ isync-1.4.4/debian/changelog 2022-11-17 00:00:37.000000000 +0000 @@ -1,3 +1,11 @@ +isync (1.4.4-3ubuntu0.22.04.1) jammy; urgency=medium + + * d/p/0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch: + Work around "unexpected EOF" error messages at end of SSL + connections. (LP: #1995690) + + -- Sergio Durigan Junior Wed, 16 Nov 2022 19:00:37 -0500 + isync (1.4.4-3) unstable; urgency=medium * Update the VCS info diff -Nru isync-1.4.4/debian/control isync-1.4.4/debian/control --- isync-1.4.4/debian/control 2022-01-15 14:38:03.000000000 +0000 +++ isync-1.4.4/debian/control 2022-11-17 00:00:37.000000000 +0000 @@ -1,7 +1,8 @@ Source: isync Section: mail Priority: optional -Maintainer: Pierre-Elliott Bécue +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Pierre-Elliott Bécue Standards-Version: 4.6.0 Build-Depends: debhelper-compat (= 13), libdb-dev, diff -Nru isync-1.4.4/debian/patches/0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch isync-1.4.4/debian/patches/0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch --- isync-1.4.4/debian/patches/0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch 1970-01-01 00:00:00.000000000 +0000 +++ isync-1.4.4/debian/patches/0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch 2022-11-17 00:00:37.000000000 +0000 @@ -0,0 +1,76 @@ +From: Oswald Buddenhagen +Date: Mon, 6 Jun 2022 11:55:37 +0200 +Subject: work around "unexpected EOF" error messages at end of SSL + connections + +gmail apparently doesn't send a close notification (SSL_shutdown()) +before closing the TCP socket. + +Origin: upstream, https://sourceforge.net/p/isync/isync/ci/b6c36624 +Bug-ArchLinux: https://bugs.archlinux.org/task/76467 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/isync/+bug/1995690 +--- + src/drv_imap.c | 7 +++++-- + src/socket.c | 9 +++++++++ + src/socket.h | 1 + + 3 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/drv_imap.c b/src/drv_imap.c +index c5a7aed..e1a8219 100644 +--- a/src/drv_imap.c ++++ b/src/drv_imap.c +@@ -1620,6 +1620,7 @@ imap_socket_read( void *aux ) + error( "IMAP error: unexpected BYE response: %s\n", cmd ); + /* We just wait for the server to close the connection now. */ + ctx->expectEOF = 1; ++ socket_expect_eof( &ctx->conn ); + } else { + /* We still need to wait for the LOGOUT's tagged OK. */ + } +@@ -1882,10 +1883,12 @@ static void + imap_cleanup_p2( imap_store_t *ctx, + imap_cmd_t *cmd ATTR_UNUSED, int response ) + { +- if (response == RESP_NO) ++ if (response == RESP_NO) { + imap_cancel_store( &ctx->gen ); +- else if (response == RESP_OK) ++ } else if (response == RESP_OK) { + ctx->expectEOF = 1; ++ socket_expect_eof( &ctx->conn ); ++ } + } + + /******************* imap_open_store *******************/ +diff --git a/src/socket.c b/src/socket.c +index ac3c847..892cece 100644 +--- a/src/socket.c ++++ b/src/socket.c +@@ -810,6 +810,15 @@ socket_expect_activity( conn_t *conn, int expect ) + conf_wakeup( &conn->fd_timeout, expect ? conn->conf->timeout : -1 ); + } + ++void ++socket_expect_eof( conn_t *sock ) ++{ ++#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF // implies HAVE_LIBSSL ++ if (sock->ssl) ++ SSL_set_options( sock->ssl, SSL_OP_IGNORE_UNEXPECTED_EOF ); ++#endif ++} ++ + int + socket_read( conn_t *conn, char *buf, uint len ) + { +diff --git a/src/socket.h b/src/socket.h +index 5b1edd0..af679aa 100644 +--- a/src/socket.h ++++ b/src/socket.h +@@ -142,6 +142,7 @@ void socket_start_tls(conn_t *conn, void (*cb)( int ok, void *aux ) ); + void socket_start_deflate( conn_t *conn ); + void socket_close( conn_t *sock ); + void socket_expect_activity( conn_t *sock, int expect ); ++void socket_expect_eof( conn_t *sock ); + int socket_read( conn_t *sock, char *buf, uint len ); /* never waits */ + char *socket_read_line( conn_t *sock ); /* don't free return value; never waits */ + typedef enum { KeepOwn = 0, GiveOwn } ownership_t; diff -Nru isync-1.4.4/debian/patches/series isync-1.4.4/debian/patches/series --- isync-1.4.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ isync-1.4.4/debian/patches/series 2022-11-17 00:00:37.000000000 +0000 @@ -0,0 +1 @@ +0001-work-around-unexpected-EOF-error-messages-at-end-of-.patch