lefcha / imapfilter

IMAP mail filtering utility
MIT License
844 stars 93 forks source link

Infinite loop when server crashes: imapfilter: reading data through SSL; the connection has been closed cleanly #213

Closed igorakkerman closed 3 years ago

igorakkerman commented 3 years ago

Imapfilter ran into an infinite loop and wasn't able to recover. It kept outputting this message over and over:

imapfilter: reading data through SSL; the connection has been closed cleanly

It took me a whole day to pinpoint the issue. The IMAP server had received a specific spam email. A contain_body call in my Imapfilter script caused Dovecot to crash when passed a specific query argument. The crash of the server got Imapfilter into the infinite loop.

Here's a minimal Imapfilter script to reproduce the issue, followed by the logs of Imapfilter and Dovecot and the email that causes Dovecot to crash when queried by Imapfilter.

Imapfilter script:

myserver = IMAP { 
    server = '**********',
    username = '**********',
    password = '**********', 
    ssl = 'tls1.2'
}

myserver["_TEST"]:contain_body("ord") 
print("Done")
Imapfilter output:

``` # /bin/imapfilter -v -d ./debug.log -c ./config.lua S (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. C (4): 1000 NOOP S (4): 1000 OK NOOP completed. C (4): 1001 CAPABILITY S (4): 1001 OK Pre-login capabilities listed, post-login capabilities have more. C (4): 1002 LOGIN "**********" * S (4): 1002 OK Logged in C (4): 1003 CAPABILITY S (4): 1003 OK Capability completed (0.001 + 0.000 secs). C (4): 1004 NAMESPACE S (4): 1004 OK Namespace completed (0.001 + 0.000 secs). C (4): 1005 SELECT "_TEST" S (4): 1005 OK [READ-WRITE] Select completed (0.001 + 0.000 secs). C (4): 1006 UID SEARCH ALL BODY "ord" imapfilter: reading data through SSL; the connection has been closed cleanly S (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. C (4): 1007 NOOP S (4): 1007 OK NOOP completed. C (4): 1008 CAPABILITY S (4): 1008 OK Pre-login capabilities listed, post-login capabilities have more. C (4): 1009 LOGIN "**********" * S (4): 1009 OK Logged in C (4): 100A CAPABILITY S (4): 100A OK Capability completed (0.001 + 0.000 secs). C (4): 100B NAMESPACE S (4): 100B OK Namespace completed (0.001 + 0.000 secs). C (4): 100C SELECT "_TEST" S (4): 100C OK [READ-WRITE] Select completed (0.001 + 0.000 secs). C (4): 100D UID SEARCH ALL BODY "ord" imapfilter: reading data through SSL; the connection has been closed cleanly ... ```

Imapfilter debug log ``` getting response (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. sending command (4): 1000 NOOP getting response (4): 1000 OK NOOP completed. sending command (4): 1001 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN getting response (4): 1001 OK Pre-login capabilities listed, post-login capabilities have more. sending command (4): 1002 LOGIN "**********" * getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1002 OK Logged in sending command (4): 1003 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1003 OK Capability completed (0.001 + 0.000 secs). sending command (4): 1004 NAMESPACE getting response (4): * NAMESPACE (("" "/")) (("Shared/" "/")) NIL 1004 OK Namespace completed (0.001 + 0.000 secs). namespace (4): '' '/' conversion: '_TEST' -> '_TEST' sending command (4): 1005 SELECT "_TEST" getting response (4): * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk \*)] Flags permitted. * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1549758610] UIDs valid * OK [UIDNEXT 3] Predicted next UID 1005 OK [READ-WRITE] Select completed (0.001 + 0.000 secs). sending command (4): 1006 UID SEARCH ALL BODY "ord" recovering connection: imaps://**********@**********:993/_TEST getting response (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. sending command (4): 1007 NOOP getting response (4): 1007 OK NOOP completed. sending command (4): 1008 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN getting response (4): 1008 OK Pre-login capabilities listed, post-login capabilities have more. sending command (4): 1009 LOGIN "**********" * getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1009 OK Logged in sending command (4): 100A CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 100A OK Capability completed (0.001 + 0.000 secs). sending command (4): 100B NAMESPACE getting response (4): * NAMESPACE (("" "/")) (("Shared/" "/")) NIL 100B OK Namespace completed (0.001 + 0.000 secs). namespace (4): '' '/' conversion: '_TEST' -> '_TEST' sending command (4): 100C SELECT "_TEST" getting response (4): * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk \*)] Flags permitted. * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1549758610] UIDs valid * OK [UIDNEXT 3] Predicted next UID 100C OK [READ-WRITE] Select completed (0.001 + 0.000 secs). sending command (4): 100D UID SEARCH ALL BODY "ord" recovering connection: imaps://**********@**********:993/_TEST ... ``` Dovecot log: ``` Oct 23 17:48:45 mx1 dovecot: imap-login: Login: user=<**********>, method=PLAIN, rip=52.28.249.204, lip=172.22.1.250, mpid=142, TLS, TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits) Oct 23 17:48:45 mx1 dovecot: imap(**********)<142>: Panic: file message-parser.c: line 174 (message_part_finish): assertion failed: (ctx->nested_parts_count > 0) Oct 23 17:48:45 mx1 dovecot: imap(**********)<142>: Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(backtrace_append+0x3d) [0x7f37fc843eed] -> /usr/lib/dovecot/libdovecot.so.0(backtrace_get+0x1e) [0x7f37fc84400e] -> /usr/lib/dovecot/libdovecot.so.0(+0xf465b) [0x7f37fc84d65b] -> /usr/lib/dovecot/libdovecot.so.0(+0xf46f1) [0x7f37fc84d6f1] -> /usr/lib/dovecot/libdovecot.so.0(+0x514a6) [0x7f37fc7aa4a6] -> /usr/lib/dovecot/libdovecot.so.0(+0x4e0af) [0x7f37fc7a70af] -> /usr/lib/dovecot/libdovecot.so.0(message_parser_parse_next_block+0x104) [0x7f37fc831814] -> /usr/lib/dovecot/libdovecot.so.0(message_search_msg+0xa8) [0x7f37fc833c38] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0xcf23e) [0x7f37fc9df23e] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_search_args_foreach+0x45) [0x7f37fc962975] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0xd00d4) [0x7f37fc9e00d4] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0xd18e3) [0x7f37fc9e18e3] -> /usr/lib/dovecot/libdovecot-storage.so.0(index_storage_search_next_nonblock+0x105) [0x7f37fc9e1ab5] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_search_next_nonblock+0x22) [0x7f37fc96bfc2] -> dovecot/imap(+0x27271) [0x558099d8a271] -> dovecot/imap(imap_search_start+0xdc) [0x558099d8aaec] -> dovecot/imap(cmd_search+0xcf) [0x558099d7b8ef] -> dovecot/imap(command_exec+0x64) [0x558099d83654] -> dovecot/imap(+0x1eaa2) [0x558099d81aa2] -> dovecot/imap(+0x1eb44) [0x558099d81b44] -> dovecot/imap(client_handle_input+0x1b5) [0x558099d81f05] -> dovecot/imap(client_input+0x72) [0x558099d82402] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x69) [0x7f37fc863989] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x131) [0x7f37fc864ed1] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x4c) [0x7f37fc863a2c] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x40) [0x7f37fc863ba0] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f37fc7dd9c3] -> dovecot/imap(main+0x32d) [0x558099d73ddd] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f37fc5b809b] -> dovecot/imap(_start+0x2a) [0x558099d73f8a] Oct 23 17:48:45 mx1 dovecot: imap(**********)<142>: Fatal: master: service(imap): child 142 killed with signal 6 (core dumped) ... ``` Imapfilter debug log: ``` getting response (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. sending command (4): 1000 NOOP getting response (4): 1000 OK NOOP completed. sending command (4): 1001 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN getting response (4): 1001 OK Pre-login capabilities listed, post-login capabilities have more. sending command (4): 1002 LOGIN "**********" * getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1002 OK Logged in sending command (4): 1003 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1003 OK Capability completed (0.001 + 0.000 secs). sending command (4): 1004 NAMESPACE getting response (4): * NAMESPACE (("" "/")) (("Shared/" "/")) NIL 1004 OK Namespace completed (0.001 + 0.000 secs). namespace (4): '' '/' conversion: '_TEST' -> '_TEST' sending command (4): 1005 SELECT "_TEST" getting response (4): * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk \*)] Flags permitted. * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1549758610] UIDs valid * OK [UIDNEXT 3] Predicted next UID 1005 OK [READ-WRITE] Select completed (0.001 + 0.000 secs). sending command (4): 1006 UID SEARCH ALL BODY "ord" recovering connection: imaps://**********@**********:993/_TEST getting response (4): * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. sending command (4): 1007 NOOP getting response (4): 1007 OK NOOP completed. sending command (4): 1008 CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN getting response (4): 1008 OK Pre-login capabilities listed, post-login capabilities have more. sending command (4): 1009 LOGIN "**********" * getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 1009 OK Logged in sending command (4): 100A CAPABILITY getting response (4): * CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk 100A OK Capability completed (0.001 + 0.000 secs). sending command (4): 100B NAMESPACE getting response (4): * NAMESPACE (("" "/")) (("Shared/" "/")) NIL 100B OK Namespace completed (0.001 + 0.000 secs). namespace (4): '' '/' conversion: '_TEST' -> '_TEST' sending command (4): 100C SELECT "_TEST" getting response (4): * FLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Junk \*)] Flags permitted. * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1549758610] UIDs valid * OK [UIDNEXT 3] Predicted next UID 100C OK [READ-WRITE] Select completed (0.001 + 0.000 secs). sending command (4): 100D UID SEARCH ALL BODY "ord" recovering connection: imaps://**********@**********:993/_TEST ``` Spam email: ``` Return-Path: Delivered-To: ********* Received: from ********** ([**********]) by ******** with LMTP id aeAxClSzkl+LdQAAF2N1fQ (envelope-from ) for <**********>; Fri, 23 Oct 2020 12:41:24 +0200 X-Envelope-To: X-Envelope-From: Received: from smtp.cloudcity.fi (smtp.cloudcity.fi [185.220.76.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ********** with ESMTPS id D07243E98E for ; Fri, 23 Oct 2020 12:41:23 +0200 (CEST) Received: from fcda.fi (unknown [123.162.133.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.cloudcity.fi (Postfix) with ESMTPSA id E6863C274E1; Fri, 23 Oct 2020 13:41:07 +0300 (EEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.cloudcity.fi E6863C274E1 Subject: =?UTF-8?Q?=EF=BB=BFRE=3A__=F0=9F=98=A7_{8}?= From: Reb Reply-To: Reb Content-Type: multipart/alternative; boundary=-=Apple-Mail-0FF08EB6-722C-4568-B791-8C9E04C04A81=- Message-Id: <5B907F82-5CC3-4FF0-BB6E-8112509882F0@fcda.fi> To: "directv" , "directv" , "Dlong004" , "dlrele" , "memocy" , "NextMilleniumVisa" Date: Fri, 23 Oct 2020 01:42:38 -0600 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Authentication-Results: **********; none X-Spamd-Result: default: False [0.00 / 15.00] X-Rspamd-Queue-Id: D07243E98E ---=Apple-Mail-0FF08EB6-722C-4568-B791-8C9E04C04A81=- Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable =0D=0A=0D=0A=0D=0Ahttps://bit.ly/2FwcLBl =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A10/23/2020 10:42:38 AM =0D=0A =0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A =0D=0A =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A"Well, they= call him Violets M'Gee," I said. "On ac=97count of he chews little throat= pastilles that smell of violets. He's a big man with soft silvery hair and= a cute little mouth made to kiss babies with. When last seen he was= wearing a neat blue suit, wide-toed brown shoes, gray homburg hat, and he= was smoking opium in a short briar pipe."=0D=0A"That's what I thought,"= Degarmo said. "So I wasn't going to bother you. You get the idea?" He took= his shield out of his pocket and held it so that the light glinted on the= gold and the blue enameL "I'm a police lieutenant." The clerk shrugged.= "Very well. I hope there isn't going to be any trouble. I'd better= announce you then. What names?"=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0A=0D=0A=0D=0A"In the basement garage." ---=Apple-Mail-0FF08EB6-722C-4568-B791-8C9E04C04A81=- Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable








=



10/23/2020 10:42:38= AM
=





=





<= /div>

























=





<= div>













=
=





=





<= /div>

























=





<= div>



















=




<= br>













=





<= /div>

























=





<= div>



















=




<= br>













=





<= /div>

























=





<= div>













"Well, they= call him Violets M'Gee," I said. "On ac=97count of he chews little throat= pastilles that smell of violets. He's a big man with soft silvery hair and= a cute little mouth made to kiss babies with. When last seen he was= wearing a neat blue suit, wide-toed brown shoes, gray homburg hat, and he= was smoking opium in a short briar pipe."
"That's what I= thought," Degarmo said. "So I wasn't going to bother you. You get the= idea?" He took his shield out of his pocket and held it so that the light= glinted on the gold and the blue enameL "I'm a police lieutenant." The= clerk shrugged. "Very well. I hope there isn't going to be any trouble.= I'd better announce you then. What= names?"










"In the basement garage."
---=Apple-Mail-0FF08EB6-722C-4568-B791-8C9E04C04A81=--- ```
lefcha commented 3 years ago

It looks like imapfiter's recover mechanism is triggered:

recovering connection: imaps://**********@**********:993/_TEST

By default this mechanism is enabled, as it was useful for people that had random network failures once in a while. Possibly you want to disable this with options.recover = false?

For more info on how it works, and relevant options, have a look at the imapfilter_config(5) man page.

igorakkerman commented 3 years ago

Thanks for explaining. This happened for the first time in 3 years or so. Not sure if I should change the option value.

Am I able to see in the regular logs if the connection has been recovered before?

Any way for Imapfilter to recognize whether the server crashed on a specific operation, especially if the crash is repeatable, and not repeat that operation?

lefcha commented 3 years ago

Am I able to see in the regular logs if the connection has been recovered before?

Not in the regular log file, just in the debug log. I just added logging for these cases: https://github.com/lefcha/imapfilter/commit/3fd2553b6758b37f14ffd1d3b6f32f756f979fd3

Any way for Imapfilter to recognize whether the server crashed on a specific operation, especially if the crash is repeatable, and not repeat that operation?

The only differentiation is if there was a network error or a IMAP BYE, nothing more fine-grained at the moment.

igorakkerman commented 3 years ago

Awesome, the logging will help in the future for sure. Thanks!