summaryrefslogtreecommitdiff
path: root/imap
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-11-26 01:15:31 -0700
committerEduardo Chappa <chappa@washington.edu>2021-11-26 01:15:31 -0700
commitc60f9d3bc9b6217f6b4de7cf516af45c972b6827 (patch)
tree467a470318ea8b6507fc06404757fba1e9a28749 /imap
parentfb5d091667dd5db488d0bba2c4fa2e2e0f264572 (diff)
downloadalpine-c60f9d3bc9b6217f6b4de7cf516af45c972b6827.tar.xz
* 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.
Diffstat (limited to 'imap')
-rw-r--r--imap/src/osdep/unix/unix.c6
1 files changed, 3 insertions, 3 deletions
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? */