duesee/imap-next

bug: Investigate timeout before greeting when using TLS

Closed this issue · 0 comments

See this example https://github.com/duesee/imap-next/blob/84e9a6ad7f351749fe0b4e67459775892f9c2d02/examples/greeting_timeout.rs

This is the output of a successful iteration:

-------------------- next iteration ------------------------------
2024-09-07T11:51:45.868671Z TRACE imap_next::stream: io/read/plain data=""
2024-09-07T11:51:45.868710Z TRACE imap_next::stream: io/write/plain data=""
2024-09-07T11:51:45.879298Z TRACE imap_next::stream: io/read/raw data=[23, 3, 3, 0, 184, 0, 0, 0, 0, 0, 0, 0, 1, 36, 99, 3, 43, 1, 231, 60, 223, 31, 245, 157, 253, 130, 207, 10, 5, 46, 65, 211, 52, 5, 179, 4, 212, 60, 235, 204, 19, 31, 199, 255, 244, 2, 247, 138, 153, 71, 222, 111, 180, 151, 237, 98, 180, 155, 238, 96, 31, 87, 53, 211]
2024-09-07T11:51:45.879363Z TRACE imap_next::stream: io/read/plain data=""
2024-09-07T11:51:45.879377Z TRACE imap_next::stream: io/write/plain data=""
2024-09-07T11:51:45.879384Z TRACE imap_next::stream: io/read/raw data=[44, 136, 37, 188, 45, 180, 74, 186, 33, 178, 52, 161, 72, 101, 115, 76, 242, 242, 97, 92, 150, 194, 96, 59, 154, 182, 56, 147, 253, 225, 65, 69, 238, 95, 193, 154, 1, 87, 229, 142, 9, 154, 187, 147, 206, 246, 219, 166, 193, 116, 115, 113, 71, 179, 217, 115, 162, 45, 47, 14, 23, 17, 63, 24]
2024-09-07T11:51:45.879397Z TRACE imap_next::stream: io/read/plain data=""
2024-09-07T11:51:45.879402Z TRACE imap_next::stream: io/write/plain data=""
2024-09-07T11:51:45.879411Z TRACE imap_next::stream: io/read/raw data=[214, 63, 200, 82, 63, 164, 96, 243, 165, 75, 41, 159, 139, 22, 200, 3, 29, 61, 19, 8, 110, 133, 82, 224, 133, 145, 130, 146, 171, 102, 37, 131, 191, 70, 13, 115, 75, 116, 37, 246, 88, 9, 13, 7, 228, 83, 22, 42, 20, 64, 171, 160, 208, 58, 221, 20, 40, 133, 145, 124, 155]
2024-09-07T11:51:45.879477Z TRACE imap_next::stream: io/read/plain data="* OK The Microsoft Exchange IMAP4 service is ready. [QgBFADEAUAAyADgAMQBDAEEAMAA0ADcANgAuAEQARQBVAFAAMgA4ADEALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]\\r\\n"
evt: Ok(GreetingReceived { greeting: Greeting { kind: Ok, code: None, text: Text("The Microsoft Exchange IMAP4 service is ready. [QgBFADEAUAAyADgAMQBDAEEAMAA0ADcANgAuAEQARQBVAFAAMgA4ADEALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]") } })
=====> 5

And this the output of an iteration with a timeout:

-------------------- next iteration ------------------------------
2024-09-07T11:55:09.210038Z TRACE imap_next::stream: io/read/plain data=""
2024-09-07T11:55:09.210075Z TRACE imap_next::stream: io/write/plain data=""
2024-09-07T11:56:09.654709Z TRACE imap_next::stream: io/read/raw data=[23, 3, 3, 0, 56, 0, 0, 0, 0, 0, 0, 0, 2, 220, 167, 204, 138, 158, 10, 219, 203, 130, 40, 169, 26, 208, 4, 13, 167, 195, 116, 29, 88, 124, 209, 58, 44, 211, 176, 242, 200, 219, 96, 240, 78, 68, 98, 245, 223, 189, 8, 22, 0, 210, 52, 86, 26, 142, 39, 60, 75]
2024-09-07T11:56:09.654754Z TRACE imap_next::stream: io/read/plain data=""
2024-09-07T11:56:09.654770Z TRACE imap_next::stream: io/write/plain data=""
2024-09-07T11:56:09.655439Z TRACE imap_next::stream: io/read/raw data=[]
evt: Err(Closed)
=====> 353

See the time gap before the first read byte.

This was reported by @soywod.