回复: Roundcubemail 中文附件乱码的问题 [已解决]

以下内容引自 RFC 2183(http://www.ietf.org/rfc/rfc2183.txt),"Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field"。

看引用内容的最后一句即可。

简单来说,就是如果附件的名字里包含有非 ASCII 字符,就必须将文件名进行 encode 处理。所以可以确认,是你发送邮件的那台服务器的 webmail 程序有问题,而不是 iRedMail 里包含的 Roundcubemail 有问题。

   In the extended BNF notation of [RFC 822], the Content-Disposition
   header field is defined as follows:

     disposition := "Content-Disposition" ":"
                    disposition-type
                    *(";" disposition-parm)

     disposition-type := "inline"
                       / "attachment"
                       / extension-token
                       ; values are not case-sensitive

     disposition-parm := filename-parm
                       / creation-date-parm
                       / modification-date-parm
                       / read-date-parm
                       / size-parm
                       / parameter

     filename-parm := "filename" "=" value

     creation-date-parm := "creation-date" "=" quoted-date-time

     modification-date-parm := "modification-date" "=" quoted-date-time

     read-date-parm := "read-date" "=" quoted-date-time

     size-parm := "size" "=" 1*DIGIT

     quoted-date-time := quoted-string
                      ; contents MUST be an RFC 822 `date-time'
                      ; numeric timezones (+HHMM or -HHMM) MUST be used



   NOTE ON PARAMETER VALUE LENGHTS: A short (length <= 78 characters)
   parameter value containing only non-`tspecials' characters SHOULD be
   represented as a single `token'.  A short parameter value containing
   only ASCII characters, but including `tspecials' characters, SHOULD
   be represented as `quoted-string'.  Parameter values longer than 78
   characters, or which contain non-ASCII characters, MUST be encoded as
   specified in [RFC 2184].

回复: Roundcubemail 中文附件乱码的问题 [已解决]

原帖由 westgo 于 2008-7-24 10:26 发表 http://www.osspinc.com/bbs/images/common/back.gif
从乱码原理上解释 用户就容易接受的多了
还希望通过努力 FIX或者加强roundcube的自适应性,让所有用户受益, 而不能强求对方服务器遵循某个标准

是增强程序的”兼容性“,还是对方服务器软件的提供商发送 bug report 来得合适?我相信规范服务器软件,按照 RFC 来操作才是最有效的方法。

PS:木鸟已经向 winwebmail 的作者发了 bug report。向上游反馈,最终受益的是用户(不管你是付费的还是盗版的)。