You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net_imap: Fix false warning in __gen_keyword_names.
When moving messages from a mailbox (and possibly other operations)
with certain flags to a mailbox with different keyword mappings e.g.,
Mailbox A (test): a -> encrypted
Mailbox B (Trash): a -> NonJunk, b -> encrypted
there would be a warning like this:
File has 1 custom flags (b), but we only have mappings for 0 of them ()?
For one, this was misleading, since actually there was a mapping, just
not for the specific keyword, so this is a more appropriate warning:
'Sb' has 1 custom flag (b), but /home/bbs/maildir/1/.test/.keywords only
has mappings for 0 of them (a)?
Moreover, this warning is still not appropriate, because the keyword
mapping in question does exist as 'b' in the destination mailbox, but
we were using the source mailbox (since imap->dir is passed in to this
function by default). Add a few variants of calling APIs that allow us
to pass in the the destination maildir, which avoids this error.
bbs_warning("File has %d custom flags (%s), but we only have mappings for %d of them (%s)?\n", keywordslen, custom_start, matches, mappings);
168
+
bbs_warning("'%s' has %d custom flag%s (%s), but %s only has mappings for %d of them (%s)?\n", msgfilename, keywordslen, ESS(keywordslen), custom_start, filename, matches, mappings);
162
169
}
163
170
}
164
171
fclose(fp);
@@ -340,7 +347,7 @@ int translate_maildir_flags(struct imap_session *imap, const char *oldmaildir, c
340
347
* and abstracted away from the IMAP module (i.e. done automatically on any move or copy). */
341
348
342
349
/* Get the old keyword names themselves */
343
-
numkeywords=__gen_keyword_names(oldfilename, keywords, sizeof(keywords), oldmaildir); /* prepends a space before all of them, so this (usually) works out great */
350
+
numkeywords=__gen_keyword_names(oldfilenamefull, oldfilename, keywords, sizeof(keywords), oldmaildir); /* prepends a space before all of them, so this (usually) works out great */
344
351
345
352
if (numkeywords <= 0) {
346
353
#ifdefEXTRA_DEBUG
@@ -376,27 +383,29 @@ int translate_maildir_flags(struct imap_session *imap, const char *oldmaildir, c
/*! \brief base flagstr The file name of the message file (importantly, we want the part containing the flags). Please do not provide the full filepath. */
0 commit comments