Hi,

Thank you for your quick release of 5.0.4.

Now there was another claim that Thunderbird users could not delete attachments 
with UTF-8 filenames.

Because Thunderbird add a new mime-part with delete comment like:
--------------B9BFA3413B08F1FAB3A2AAC0
Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0";
 name="=?UTF-8?B?44OG44K544OILnR4dA==?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*=utf-8''%E3%83%86%E3%82%B9%E3%83%88%2E%74%78%74

44OG44K544OI
--------------B9BFA3413B08F1FAB3A2AAC0--

I'm not sure this part is violate RFC or not, but this error seemed to be
avoidable with the attached patch(I reffered to libs/imap/fetch.c).

P.S.
I aloso report this bug on Thuderbird's Bugzilla.

Best regards,
Hideki Sakamoto
*** libs/imap/imapd.c.orig      Wed Jul 18 21:26:27 2018
--- libs/imap/imapd.c   Fri Nov 30 19:07:09 2018
***************
*** 714,720 ****
                         time_t timestamp,
                         struct imaptoken *curtoken,
                         unsigned long *new_uidv,
!                        unsigned long *new_uid)
  {
        unsigned long nbytes=curtoken->tokennum;
        char    *tmpname;
--- 714,721 ----
                         time_t timestamp,
                         struct imaptoken *curtoken,
                         unsigned long *new_uidv,
!                        unsigned long *new_uid,
!                        int *utf8_error)
  {
        unsigned long nbytes=curtoken->tokennum;
        char    *tmpname;
***************
*** 797,806 ****
        if ((rfc2045_parser->rfcviolation & RFC2045_ERR8BITHEADER) &&
            curtoken->tokentype != IT_LITERAL8_STRING_START)
        {
!               errmsg=" NO [ALERT] Your IMAP client does not appear to "
!                       "correctly implement Unicode messages, "
!                       "see https://tools.ietf.org/html/rfc6855.html\r\n";;
!               errflag=1;
        }
  
        rfc2045_free(rfc2045_parser);
--- 798,805 ----
        if ((rfc2045_parser->rfcviolation & RFC2045_ERR8BITHEADER) &&
            curtoken->tokentype != IT_LITERAL8_STRING_START)
        {
!               /* in order to [ALERT] the client */
!               *utf8_error=1;
        }
  
        rfc2045_free(rfc2045_parser);
***************
*** 3911,3916 ****
--- 3910,3916 ----
        char access_rights[8];
        struct imaptoken *curtoken;
        int need_rparen;
+       int utf8_error=0;
  
        if (access(path, 0))
        {
***************
*** 4030,4036 ****
                          acl_flags_adjust(access_rights, &flags)
                          ? NULL:keywords,
                          timestamp,
!                         curtoken, &new_uidv, &new_uid))
        {
                libmail_kwmDestroy(keywords);
                unread('\n');
--- 4030,4036 ----
                          acl_flags_adjust(access_rights, &flags)
                          ? NULL:keywords,
                          timestamp,
!                         curtoken, &new_uidv, &new_uid, &utf8_error))
        {
                libmail_kwmDestroy(keywords);
                unread('\n');
***************
*** 4057,4063 ****
        writen(new_uidv);
        writes(" ");
        writen(new_uid);
!       writes("] APPEND Ok.\r\n");
        return (0);
  }
  
--- 4057,4069 ----
        writen(new_uidv);
        writes(" ");
        writen(new_uid);
!       writes("] APPEND Ok.");
!       if (utf8_error) {
!               writes(" [ALERT] Your IMAP client does not appear to "
!                               "correctly implement Unicode messages, "
!                               "see https://tools.ietf.org/html/rfc6855.html";);
!       }
!       writes("\r\n");
        return (0);
  }
  
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to