Commit 37e199f
committed
Fix two bugs that misreport why a run could not connect
A TLS failure was reported as an unreachable host. ssl.SSLError is a
subclass of OSError, so the reachability handler in connect() - listed
first - caught every one of them and the TLS branch behind it was dead
code. Pointing the tool at a plaintext port (143 instead of 993), or at a
server with an expired or untrusted certificate, printed "Could not reach
host:port" and told the user to check an internet connection that was
working fine, never mentioning the port they had actually mistyped. The
"TLS handshake with ... failed" error the README documents in
Troubleshooting could not be produced at all. Catch ssl.SSLError first,
and name 993 in the hint since a wrong port is the usual cause.
A quoted .env value with a trailing comment kept its quotes. _clean_value
took the quoted branch only when the line *ended* on the closing quote, so
an ordinary annotated line - EMAIL_CLEANER_PASSWORD="abcd efgh" # gmail
app password - matched neither branch: the inline-comment strip ran
instead and left the quotes in. IMAP then got a password with two stray
'"' characters and rejected it, and the user was told their app password
was wrong. Parse the quoted case up to its closing quote and treat
whatever follows as the comment it is.
Adds regression tests for both, including that an unreachable host and a
rejected password still report as themselves.1 parent 24919d9 commit 37e199f
3 files changed
Lines changed: 89 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | | - | |
51 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
245 | 259 | | |
246 | 260 | | |
247 | 261 | | |
248 | 262 | | |
249 | 263 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 264 | | |
256 | 265 | | |
257 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
502 | 545 | | |
503 | 546 | | |
504 | 547 | | |
| |||
689 | 732 | | |
690 | 733 | | |
691 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
692 | 756 | | |
693 | 757 | | |
694 | 758 | | |
| |||
0 commit comments