Good morning, I work for an ISP. Outlook has problems in (according to what I have seen and reproduced) the following situations : - You say it to rename a folder to a folder that already exists but that Outlook has not noticed yet of it's existence. - It needs to access to a chained folder and in that chain some folder doesn't exist in the middle. - Sync seems to get stuck for large mailboxes. Apart from that, there is a new recent problem : Having said that, we have patched our servers for avoiding the first two issues. With this patch, we have have no longer Outlook syncing issues and I would say the solution should go in that direction. We have written the patches for the 3.0.X versions. Apart from the patch, you need some way of notifying the user the final rename you have done due to the conflicted rename his Outlook asked. I mean, you need something more than a patch (for notifying users about the final and real folder rename and how to access it) but it's working. For the third issue, the best thing you can do is, configure a new account in a new profile, stop periodic sync, launch a sync and let it sync and index the whole mailbox once. If you wait till this proccess ends, later syncing attempts would be normal or pretty fast (seconds). You can then re-enable periodic sync. We transmitted this issues to Microsoft (through their tech forums), but they didn't gave us any kind of solution and the problem persists (without patching). It seems almost all of us have seen issues with Outlook but as I have never run Dovecot (Cyrus it's a extremely nice mail system) I was wondering how it deals with it (with Outlook)?. If you are curious I do attach the commented patch in this email. Best regards, El 2022-01-13 12:53, Jim Wallis escribió:
|
--- ORIGINAL/imapd.c 2021-05-26 19:00:31.693661000 +0200 +++ PARCHEADO/imapd.c 2021-05-27 03:23:06.160393000 +0200 @@ -192,6 +192,12 @@ static const char *plaintextloginalert = NULL; static int ignorequota = 0; +/* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + +int es_outlook = 0; + +/* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + #define QUIRK_SEARCHFUZZY (1<<0) static struct id_data { struct attvaluelist *params; @@ -2595,6 +2601,13 @@ */ static void cmd_login(char *tag, char *user) { + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + + es_outlook = 0; + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + char userbuf[MAX_MAILBOX_BUFFER]; char replybuf[MAX_MAILBOX_BUFFER]; unsigned userlen; @@ -3071,6 +3084,46 @@ } syslog(LOG_INFO, "client id sessionid=<%s>:%s", session_id(), buf_cstring(&logbuf)); + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + + char *regexString = "microsoft outlook"; + char *regexString2 = "microsoft outlook for mac"; + size_t maxMatches = 1; + size_t maxGroups = 1; + regex_t regexCompiled; + regex_t regexCompiled2; + regmatch_t groupArray[maxGroups]; + regmatch_t groupArray2[maxGroups]; + + if (regcomp(®exCompiled, regexString, REG_EXTENDED|REG_ICASE)) + { + syslog(LOG_INFO, "NO PUEDO DETECTAR SI EL CLIENTE ES OUTLOOK...."); + }; + + if (regcomp(®exCompiled2, regexString2, REG_EXTENDED|REG_ICASE)) + { + syslog(LOG_INFO, "NO PUEDO DETECTAR SI EL CLIENTE ES OUTLOOK...."); + }; + + if (!regexec(®exCompiled, buf_cstring(&logbuf), maxGroups, groupArray, 0)) + { + if (regexec(®exCompiled2, buf_cstring(&logbuf), maxGroups, groupArray2, 0)) + { + syslog(LOG_INFO, "OUTLOOK PARA WINDOWS DETECTADO...."); + es_outlook = 1; + } + else + { + syslog(LOG_INFO, "OUTLOOK DETECTADO PERO NO EL DE WINDOWS.... NO ACTUAMOS...."); + } + } + + regfree(®exCompiled); + regfree(®exCompiled2); + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + buf_free(&logbuf); } @@ -4106,6 +4159,13 @@ struct backend *backend_next = NULL; struct index_init init; int wasopen = 0; + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + + int buzon_outlook_creado = 0; + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + struct vanished_params *v = &init.vanished; memset(&init, 0, sizeof(struct index_init)); @@ -4342,6 +4402,38 @@ if (init.vanishedlist) seqset_free(init.vanishedlist); init.vanishedlist = NULL; if (doclose) index_close(&imapd_index); + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + + int chequeo_crear_buzon = 1; + + if (es_outlook) + { + chequeo_crear_buzon = mboxlist_createmailboxcheck(intname, 0, 0, 0, imapd_userid, imapd_authstate, NULL, NULL, 0); + } + + if ((es_outlook) && (r == IMAP_MAILBOX_NONEXISTENT && chequeo_crear_buzon == 0)) + { + buzon_outlook_creado = mboxlist_createmailbox(intname, 0, NULL, 0, imapd_userid, imapd_authstate, 1, 0, 0, 1, NULL); + + if (!buzon_outlook_creado) + { + mboxlist_changesub(intname, imapd_userid, imapd_authstate, 1, 0, 1); + syslog(LOG_INFO, "CREANDO CARPETA %s PARA TENER OUTLOOK CONTENTO DE %s", name, imapd_userid); + } + else + { + syslog(LOG_INFO, "ERROR CREANDO CARPETA %s PARA TENER OUTLOOK CONTENTO DE %s", name, imapd_userid); + } + } + else if (es_outlook) + { + syslog(LOG_INFO, "EVITAMOS CREAR CARPETA %s PARA TENER OUTLOOK CONTENTO DE %s porque r vale %d y chequeo crear buzon vale %d", name, imapd_userid, r, chequeo_crear_buzon); + } + + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + free(intname); return; } @@ -7515,7 +7607,50 @@ imapd_check(NULL, 0); if (r) { - prot_printf(imapd_out, "%s NO %s\r\n", tag, error_message(r)); + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + + syslog(LOG_INFO, "PARTE RENAME"); + char string_fallo_rename_existe[] = "Mailbox already exists"; + char string_fallo_no_existe_origen[] = "Mailbox does not exist"; + if((!strcmp(error_message(r), string_fallo_rename_existe)) && (es_outlook)) + { + syslog(LOG_INFO, "PARTE RENAME 1111"); + char *copia_nuevo_nombre; + copia_nuevo_nombre = (char*)malloc(strlen(newname)+500); + memset(copia_nuevo_nombre, '\0', strlen(newname)+300); + strncpy(copia_nuevo_nombre,newname,strlen(newname)); + + time_t rawtime; + struct tm * timeinfo; + char bufferaleat[80]; + syslog(LOG_INFO, "PARTE RENAMEII"); + + time(&rawtime); + timeinfo = localtime(&rawtime); + strftime(bufferaleat,70,"SAREMAIL_CONFLICTO_%H%M%S_%d%m%Y",timeinfo); + + syslog(LOG_INFO, "PARTE RENAMEIII"); + strncat(copia_nuevo_nombre,bufferaleat,strlen(newname)+300-strlen(copia_nuevo_nombre)-1); + syslog(LOG_INFO, "DICIENTO AL OUTLOOK DE --%s-- QUE OK AL RENOMBRAR DE --%s-- A --%s-- PARA TENERLE CONTENTO YA QUE A --%s-- NO SE PUEDE PORQUE YA EXISTE", imapd_userid, oldname, copia_nuevo_nombre,newname); + cmd_rename(tag, oldname, copia_nuevo_nombre, 0); + free(copia_nuevo_nombre); + syslog(LOG_INFO, "PARTE RENAMEIV"); + } + else if ((!strcmp(error_message(r), string_fallo_no_existe_origen)) && (es_outlook)) + { + syslog(LOG_INFO, "PARTE RENAME 2 1111"); + syslog(LOG_INFO, "DICIENTO AL OUTLOOK DE --%s-- QUE OK AL RENOMBRAR DE --%s-- A --%s-- AUNQUE NO EXISTE EL ORIGEN Y NO SE PUEDE HACER, NO PASA NADA, TODO OK... PARA TENERLE CONTENTO", imapd_userid, oldname, newname); + prot_printf(imapd_out, "%s OK %s\r\n", tag, + error_message(IMAP_OK_COMPLETED)); + } + else + { + prot_printf(imapd_out, "%s NO %s\r\n", tag, error_message(r)); + } + + /* INTENTAR ARREGLAR PROBLEMA OUTLOOK */ + } else { if (config_mupdate_server) kick_mupdate();