From f0af8ad158b559b12063be902a5ee6114c4b0a7c Mon Sep 17 00:00:00 2001 From: Dmitry Isaikin Date: Wed, 11 May 2016 19:29:22 +0300 Subject: Automaticaly enable Rambler workaround when we are downloading attachment with base64 or uuencode encoding (#1423) --- src/core/imap/MCIMAPSession.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 48491121..f564a435 100755 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -2826,10 +2826,20 @@ Data * IMAPSession::fetchMessageAttachment(String * folder, bool identifier_is_u section = mailimap_section_new_part(section_part); fetch_att = mailimap_fetch_att_new_body_peek_section(section); fetch_type = mailimap_fetch_type_new_fetch_att(fetch_att); - + +#ifdef LIBETPAN_HAS_MAILIMAP_RAMBLER_WORKAROUND + if ((encoding == EncodingBase64 || encoding == EncodingUUEncode) && (mHostname->compare(MCSTR("imap.rambler.ru")) == 0)) { + mailimap_set_rambler_workaround_enabled(mImap, 1); + } +#endif + r = fetch_imap(mImap, identifier_is_uid, identifier, fetch_type, &text, &text_length); mailimap_fetch_type_free(fetch_type); - + +#ifdef LIBETPAN_HAS_MAILIMAP_RAMBLER_WORKAROUND + mailimap_set_rambler_workaround_enabled(mImap, 0); +#endif + mProgressCallback = NULL; MCLog("had error : %i", r); -- cgit v1.2.3