head 1.5; access; symbols pkgsrc-2026Q1:1.4.0.24 pkgsrc-2026Q1-base:1.4 pkgsrc-2025Q4:1.4.0.22 pkgsrc-2025Q4-base:1.4 pkgsrc-2025Q3:1.4.0.20 pkgsrc-2025Q3-base:1.4 pkgsrc-2025Q2:1.4.0.18 pkgsrc-2025Q2-base:1.4 pkgsrc-2025Q1:1.4.0.16 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.14 pkgsrc-2024Q4-base:1.4 pkgsrc-2024Q3:1.4.0.12 pkgsrc-2024Q3-base:1.4 pkgsrc-2024Q2:1.4.0.10 pkgsrc-2024Q2-base:1.4 pkgsrc-2024Q1:1.4.0.8 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.6 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.4 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.2 pkgsrc-2023Q2-base:1.4 pkgsrc-2021Q3:1.2.0.6 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.2.0.4 pkgsrc-2021Q2-base:1.2 pkgsrc-2021Q1:1.2.0.2 pkgsrc-2021Q1-base:1.2 pkgsrc-2020Q4:1.1.0.6 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.4 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.2 pkgsrc-2020Q2-base:1.1; locks; strict; comment @ * @; 1.5 date 2026.05.14.13.15.14; author ktnb; state dead; branches; next 1.4; commitid Fk7wJzyS5N6ZEMFG; 1.4 date 2023.05.13.08.49.27; author ryoon; state Exp; branches; next 1.3; commitid 15H5HZz2ilOYrMoE; 1.3 date 2021.10.19.11.23.17; author schmonz; state dead; branches; next 1.2; commitid SWUwcTAsRX4JEpdD; 1.2 date 2021.02.17.15.10.11; author ryoon; state Exp; branches; next 1.1; commitid UHgaFVSB2T5GK4IC; 1.1 date 2020.06.12.13.46.22; author ryoon; state Exp; branches; next ; commitid v4bALWrKPDSfkWbC; desc @@ 1.5 log @isync: update to 1.5.1 1.5.1 (2025-03-11) ================== Improvements: - mbsync-get-cert now supports STARTTLS; new option -s - Zero-sized messages from IMAP Stores are now accepted - UIDVALIDITY change recovery is now attempted even if both sides of the Channel are affected - The sync summary at the end is more concise again - Cosmetic improvements to some console output Bug Fixes: - Fixed IMAP INBOX not being properly recognized with some servers - Fixed Maildir INBOX nested into Path not being implicitly listed - Fixed crash when resuming message propagation with MaxMessages - Fixed --list-stores hanging after synchronous error - Fixed --dry-run without --debug-driver not being really dry - Fixed building from pristine git clones - Fixed building from shallow git clones 1.5.0 (2024-08-02) ================== Compatibility Concerns: - The reference point for relative local paths in the configuration file is now the file's containing directory - Maildir Path cannot be nested into Inbox anymore (this was never documented) - Renamed the ReNew/--renew/-N options to Upgrade/--upgrade/-u and Delete/--delete/-d to Gone/--gone/-g - Superseded SSLVersions option with TLSVersions, and disabled TLS v1.0 and v1.1 by default - Renamed SSLType option to TLSType - Placeholders will be now created for messages exceeding MaxSize even if they are flagged on the source side - Placeholder upgrades no longer pull flag updates along unless also requested - New messages which we are about to expunge from the source side are not propaged any more even if the target side would keep them - Tunnel is now consistently assumed to be secure, so some warnings are gone New Features: - Changed default config & state locations to follow the XDG basedir spec; the old locations remain supported - Added support for IMAP mailbox names with non-ASCII characters - Added support for Maildir Paths with suffixes (not ending with a slash) - Made the Channel side to expire with MaxMessages configurable - MaxMessages and MaxSize can be used together now - The unfiltered list of mailboxes in each Store can be printed now - A proper summary is now printed prior to exiting. This includes expunges, which are now included in the progress as well. - Added support for mirroring deletions more accurately; option ExpungeSolo - Added new sync operation 'Old' to retry previously skipped messages - Added --ext-exit option to indicate with the exit code whether Stores were modified - Added --dry-run option Improvements: - Added support for the LITERAL- IMAP extension, which improves upload performance with f.ex. GMail somewhat - Improved error handling when attempting to store too big messages on f.ex. GMail - Malformed messages with incomplete headers will be propagated now - A notice is now emitted if the server does not support race-free Trash - Improved checking for invalid command lines - Options not supported due to the build configuration are still recognized now, to make error messages more helpful - The progress indicator is rate-limited now - Various improvements to the debugging output - Vastly extended the autotest suite Bug Fixes: - Worked around "unexpected EOF" error messages at end of TLS connections; affects f.ex. GMail - Worked around protocol corruption issue with iCloud (mail.me.com) - Fixed missing CAPABILITY command after logging in if the server does not report updated capabilities automatically (affects f.ex. MS Exchange) - Fixed CopyArrivalDate failing on some date strings - Fixed propagation of new messages to non-UIDPLUS servers - Fixed Timeout being ignored by DNS host resolution - Fixed broken Tunnel potentially causing SIGPIPE - Fixed Tunnel leaving behind zombie processes - Fixed expunges not being propagated at all if the first run after they occurred did not include --delete - Fixed MaxMessages being exceeded when only --new was used - Fixed messages being instantly expired despite being important when only --new was used - Trash-ing failures now prevent expunging and cause a non-zero exit code - Fixed placeholders being needlessly trashed - Fixed TrashNewOnly and TrashRemoteNew omitting messages for which only a placeholder was synced - Fixed TrashRemoteNew omitting messages which exceed MaxSize - Fixed TrashRemoteNew not using race-free expunge - Optimized some places with unnecessarily high CPU usage - Fixed unnecessary network usage by non-selective uni-directional syncs when no placeholders are present - Fixed crash when Patterns yields nothing when built with new compilers - Fixed crash when all flag propagations to a mailbox failed - Fixed handling of errors during opening mailboxes - Removed useless "lost track of ... messages" warnings when resuming after an interruption - Fixed many minor bugs in corner cases, mostly when resuming after interruptions 1.4.4 (2021-12-03) ================== Bug Fixes: - Fixed CVE-2021-3657: multiple buffer overflows on excessively large IMAP literals - Fixed CVE-2021-44143: buffer overflow on header-less messages - Fixed crash on certain malformed messages in Maildirs - Fixed somewhat spurious notice about conflicting changes on messages marked as deleted @ text @$NetBSD: patch-src_drv__imap.c,v 1.4 2023/05/13 08:49:27 ryoon Exp $ Fix non-critical runtime error with OpenSSL 3. From: Upstream b6c36624f04cd388873785c0631df3f2f9ac4bf0 --- src/drv_imap.c.orig 2021-12-03 10:56:16.000000000 +0000 +++ 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 *******************/ @ 1.4 log @isync: Fix runtime error with OpenSSL 3. @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Update to 1.4.3. From the changelog: - limit maildir nesting depth - enable embedding arbitrarily long strings into IMAP commands - CVE-2021-3578: fix handling of unexpected APPENDUID response code - don't crash on malformed CAPABILITY responses - tolerate INBOX mis-casing in Path - make UIDVALIDITY recovery more strict about vanished messages - improve error messages about irrecoverably changed UIDVALIDITY - CVE-2021-20247: reject funny mailbox names from IMAP LIST/LSUB - be more tolerant of formally malformed response codes - fix bogus continuation of IMAP list parsing - accept unsolicited FETCH responses (without payload) after all - use correct header @ text @d1 1 a1 1 $NetBSD: patch-src_drv__imap.c,v 1.2 2021/02/17 15:10:11 ryoon Exp $ d3 2 a4 2 * Fix some runtime errors. From upstream Git: 9e3041de9367113f3b2d7d7543d2eae4c78e2c67 to 95a83c8220861185906df5b38eed589984847bfb d6 1 a6 1 --- src/drv_imap.c d8 20 a27 6 @@@@ -924,6 +924,7 @@@@ parse_imap_list( imap_store_t *ctx, char **sp, parse_list_state_t *sts ) } bail: free_list( sts->head ); + sts->level = 0; return LIST_BAD; d30 1 a30 88 @@@@ -1181,7 +1182,8 @@@@ parse_fetch_rsp( imap_store_t *ctx, list_t *list, char *s ATTR_UNUSED ) for (cmdp = ctx->in_progress; cmdp; cmdp = cmdp->next) if (cmdp->param.uid == uid) goto gotuid; - goto badrsp; + error( "IMAP error: unexpected FETCH response with BODY (UID %u)\n", uid ); + return LIST_BAD; gotuid: msgdata = ((imap_cmd_fetch_msg_t *)cmdp)->msg_data; msgdata->data = body->val; @@@@ -1208,9 +1210,8 @@@@ parse_fetch_rsp( imap_store_t *ctx, list_t *list, char *s ATTR_UNUSED ) memcpy( cur->tuid, tuid, TUIDL ); status &= ~(M_FLAGS | M_RECENT | M_SIZE | M_HEADER); } else { - badrsp: - error( "IMAP error: unexpected FETCH response (UID %u)\n", uid ); - return LIST_BAD; + // These may come in as a result of STORE FLAGS despite .SILENT. + status &= ~(M_FLAGS | M_RECENT); } if (status) { @@@@ -1252,48 +1253,53 @@@@ parse_response_code( imap_store_t *ctx, imap_cmd_t *cmd, char *s ) if (!s || *s != '[') return RESP_OK; /* no response code */ s++; - if (!(p = strchr( s, ']' ))) { - bad_resp: + if (!(arg = next_arg( &s ))) { error( "IMAP error: malformed response code\n" ); return RESP_CANCEL; } - *p++ = 0; - if (!(arg = next_arg( &s ))) - goto bad_resp; if (!strcmp( "UIDVALIDITY", arg )) { if (!(arg = next_arg( &s )) || - (ctx->uidvalidity = strtoul( arg, &earg, 10 ), *earg)) + (ctx->uidvalidity = strtoul( arg, &earg, 10 ), *earg != ']')) { error( "IMAP error: malformed UIDVALIDITY status\n" ); return RESP_CANCEL; } } else if (!strcmp( "UIDNEXT", arg )) { if (!(arg = next_arg( &s )) || - (ctx->uidnext = strtoul( arg, &earg, 10 ), *earg)) + (ctx->uidnext = strtoul( arg, &earg, 10 ), *earg != ']')) { error( "IMAP error: malformed UIDNEXT status\n" ); return RESP_CANCEL; } } else if (!strcmp( "CAPABILITY", arg )) { + if (!(p = strchr( s, ']' ))) { + error( "IMAP error: malformed CAPABILITY status\n" ); + return RESP_CANCEL; + } + *p = 0; parse_capability( ctx, s ); - } else if (!strcmp( "ALERT", arg )) { + } else if (!strcmp( "ALERT]", arg )) { /* RFC2060 says that these messages MUST be displayed * to the user */ - for (; isspace( (uchar)*p ); p++); - error( "*** IMAP ALERT *** %s\n", p ); + if (!s) { + error( "IMAP error: malformed ALERT status\n" ); + return RESP_CANCEL; + } + for (; isspace( (uchar)*s ); s++); + error( "*** IMAP ALERT *** %s\n", s ); } else if (cmd && !strcmp( "APPENDUID", arg )) { if (!(arg = next_arg( &s )) || (ctx->uidvalidity = strtoul( arg, &earg, 10 ), *earg) || !(arg = next_arg( &s )) || - (((imap_cmd_out_uid_t *)cmd)->out_uid = strtoul( arg, &earg, 10 ), *earg)) + (((imap_cmd_out_uid_t *)cmd)->out_uid = strtoul( arg, &earg, 10 ), *earg != ']')) { error( "IMAP error: malformed APPENDUID status\n" ); return RESP_CANCEL; } } else if (!strcmp( "PERMANENTFLAGS", arg )) { parse_list_init( &ctx->parse_list_sts ); - if (parse_imap_list( NULL, &s, &ctx->parse_list_sts ) != LIST_OK) { + if (parse_imap_list( NULL, &s, &ctx->parse_list_sts ) != LIST_OK || *s != ']') { error( "IMAP error: malformed PERMANENTFLAGS status\n" ); return RESP_CANCEL; } @ 1.2 log @isync: Update to 1.4.0 * Import upstream patch to fix runtime errors. Changelog: This is a feature release that comes with significant new functionality: - The IMAP '$Forwarded' / Maildir 'P' (passed) flag is supported now. - Support for configuring a TLS cipher string was added. - IMAP mailbox subscriptions are supported now. - The IMAP user query can be scripted now. - Added built-in support for the macOS Keychain. - Messages excluded by MaxSize will now result in placeholders. Compatibility concerns: - The 'isync' compatibility wrapper was removed. - A C11 compiler is required for building now. - The validity of the config file is checked more stricly now, including: - Appearance of options in unexpected places - The capitalization of INBOX - The new TLSv1.3 flag must be added to SSLVersions if the option is used, unless disabling that version is desired (which is unlikely). - Removed support for the obsolete/insecure SSL v3. - The use of Master/Slave terminology has been deprecated. Bugfixes: - All bugfixes up to 1.3.4 are included. - IMAP protocol errors are handled more robustly now. - Fixed support for SASL's built-in EXTERNAL mechanism. - Improved reliability of synchronization when resuming interrupted runs. - Fixed MaxSize being ignored under certain circumstances when only one of New and ReNew was requested. - Fixed a network inefficiency occurring with server-side mailboxes that receive new messages only via mbsync. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @isync: Increase PassCmd output buffer size to work with Gmail @ text @d3 2 a4 1 * Google's Gmail access token is longer than 80 bytes. d6 1 a6 1 --- src/drv_imap.c.orig 2019-03-10 10:27:55.000000000 +0000 d8 7 a14 6 @@@@ -1867,7 +1867,7 @@@@ ensure_password( imap_server_conf_t *srv if (cmd) { FILE *fp; int ret; - char buffer[80]; + char buffer[1024]; d16 88 a103 2 if (*cmd == '+') { flushn(); @