[PATCH 1/2] wmbiff: Close mailbox before we call status on it.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Additional patch by Nye Liu <[email protected]> to fix Debian bug #830889 [1].

[1] https://bugs.debian.org/830889
---
 wmbiff/wmbiff/Imap4Client.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/wmbiff/wmbiff/Imap4Client.c b/wmbiff/wmbiff/Imap4Client.c
index 882446d..ba12a66 100644
--- a/wmbiff/wmbiff/Imap4Client.c
+++ b/wmbiff/wmbiff/Imap4Client.c
@@ -321,6 +321,14 @@ int imap_checkmail( /*@notnull@ */ Pop3 pc)
 		return -1;
 	}
 
+	command_id++;
+	tlscomm_printf(scs, "a%03d CLOSE\r\n", command_id);
+	snprintf(examine_expect, BUF_SIZE, "a%03d OK", command_id);
+	if (tlscomm_expect(scs, examine_expect, buf, 127) == 0) {
+		tlscomm_close(unbind(scs));
+		return -1;
+	}
+
 	/* if we've got it by now, try the status query */
 	command_id++;
 	tlscomm_printf(scs, "a%03d STATUS %s (MESSAGES UNSEEN)\r\n",
-- 
2.7.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.