Skip to content

Commit c9f0f22

Browse files
committed
midb: handle "INBOX" name with notif_folder_added
"INBOX" is a valid name for a non-inbox in MAPI, but special rules apply for IMAP, so midb renames folders as they pass through. This rename logic is applied when midb scans a mailbox initially, or when an existing folder's name changes to "INBOX", but we doing this for the create event triggered by [php_mapi] mapi_folder_createfolder("INBOX").
1 parent 026c7f5 commit c9f0f22

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

exch/midb/mail_engine.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,12 +3649,11 @@ static BOOL notif_folder_added(IDB_ITEM *pidb,
36493649
auto str = propvals.get<const char>(PR_DISPLAY_NAME);
36503650
if (str == nullptr)
36513651
return FALSE;
3652-
auto tmp_len = strlen(str);
3653-
if (tmp_len >= 256)
3654-
return FALSE;
36553652
std::string temp_name;
36563653
if (parent_id == PRIVATE_FID_IPMSUBTREE) {
3657-
temp_name.assign(str, tmp_len);
3654+
temp_name = str;
3655+
if (strncasecmp(str, "inbox", 5) == 0)
3656+
temp_name += "." + std::to_string(folder_id);
36583657
} else {
36593658
temp_name = std::move(decoded_name) + "/"s + str;
36603659
}

0 commit comments

Comments
 (0)