回复: 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].