From c60f9d3bc9b6217f6b4de7cf516af45c972b6827 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Fri, 26 Nov 2021 01:15:31 -0700 Subject: * When saving to a folder in the unix format, Alpine parses the destination folder to assign uids to all messages in the folder. When the destination folder is large this could significantly slow down alpine. The purpose of parsing the folder is to make sure that when saving the messages to it, the uids assigned to the messages upon saving are available so that the COPYUID and APPENDUID calls in the imap server return the uids of the saved messages. This data is returned through a callback function which Alpine does not define (but the imap server does), so we will force the parsing of the destination folder when the callback is needed, since the assignment of uids does not need to be done until opening the folder, and that can be delayed. Fix based on a patch submitted to the alpine-info list by Chris Caputo. --- imap/src/osdep/unix/unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'imap/src') diff --git a/imap/src/osdep/unix/unix.c b/imap/src/osdep/unix/unix.c index 8fec0ee6..955090d9 100644 --- a/imap/src/osdep/unix/unix.c +++ b/imap/src/osdep/unix/unix.c @@ -917,8 +917,8 @@ long unix_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options) return NIL; } - /* try to open rewrite for UIDPLUS */ - if ((tstream = mail_open_work (&unixdriver,NIL,mailbox, + /* try to open readwrite for UIDPLUS */ + if (cu && (tstream = mail_open_work (&unixdriver,NIL,mailbox, OP_SILENT|OP_NOKOD)) && tstream->rdonly) tstream = mail_close (tstream); if (cu && !tstream) { /* wanted a COPYUID? */ @@ -1113,7 +1113,7 @@ long unix_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data) MM_CRITICAL (stream); /* go critical */ /* try to open readwrite for UIDPLUS */ - if ((tstream = mail_open_work (&unixdriver,NIL,mailbox, + if (au && (tstream = mail_open_work (&unixdriver,NIL,mailbox, OP_SILENT|OP_NOKOD)) && tstream->rdonly) tstream = mail_close (tstream); if (au && !tstream) { /* wanted an APPENDUID? */ -- cgit v1.2.3-54-g00ecf