See bug#10587 for details.
* rfc2047.el (rfc2047-encode-region): Allow not folding the encoded
words.
(rfc2047-encode-string): Ditto.
(rfc2047-encode-parameter): Don't fold parameters. Some MUAs do not
understand folded filename="..." parameters, for instance.
2012-01-30 Lars Ingebrigtsen <larsi@gnus.org>
2012-01-30 Lars Ingebrigtsen <larsi@gnus.org>
+ * rfc2047.el (rfc2047-encode-region): Allow not folding the encoded
+ words.
+ (rfc2047-encode-string): Ditto.
+ (rfc2047-encode-parameter): Don't fold parameters. Some MUAs do not
+ understand folded filename="..." parameters, for instance.
+
* nnimap.el (nnimap-wait-for-response): Include the imap server name in
the message for greater debuggability.
* nnimap.el (nnimap-wait-for-response): Include the imap server name in
the message for greater debuggability.
(modify-syntax-entry ?@ "." table)
table))
(modify-syntax-entry ?@ "." table)
table))
-(defun rfc2047-encode-region (b e)
+(defun rfc2047-encode-region (b e &optional dont-fold)
"Encode words in region B to E that need encoding.
By default, the region is treated as containing RFC2822 addresses.
Dynamically bind `rfc2047-encoding-type' to change that."
"Encode words in region B to E that need encoding.
By default, the region is treated as containing RFC2822 addresses.
Dynamically bind `rfc2047-encoding-type' to change that."
(signal (car err) (cdr err))
(error "Invalid data for rfc2047 encoding: %s"
(mm-replace-in-string orig-text "[ \t\n]+" " "))))))))
(signal (car err) (cdr err))
(error "Invalid data for rfc2047 encoding: %s"
(mm-replace-in-string orig-text "[ \t\n]+" " "))))))))
- (rfc2047-fold-region b (point))
+ (unless dont-fold
+ (rfc2047-fold-region b (point)))
(goto-char (point-max))))
(goto-char (point-max))))
-(defun rfc2047-encode-string (string)
+(defun rfc2047-encode-string (string &optional dont-fold)
"Encode words in STRING.
By default, the string is treated as containing addresses (see
`rfc2047-encoding-type')."
(mm-with-multibyte-buffer
(insert string)
"Encode words in STRING.
By default, the string is treated as containing addresses (see
`rfc2047-encoding-type')."
(mm-with-multibyte-buffer
(insert string)
- (rfc2047-encode-region (point-min) (point-max))
+ (rfc2047-encode-region (point-min) (point-max) dont-fold)
(buffer-string)))
;; From RFC 2047:
(buffer-string)))
;; From RFC 2047:
is the standard but many mailers don't support it."
(let ((rfc2047-encoding-type 'mime)
(rfc2047-encode-max-chars nil))
is the standard but many mailers don't support it."
(let ((rfc2047-encoding-type 'mime)
(rfc2047-encode-max-chars nil))
- (rfc2045-encode-string param (rfc2047-encode-string value))))
+ (rfc2045-encode-string param (rfc2047-encode-string value t))))
;;;
;;; Functions for decoding RFC2047 messages
;;;
;;; Functions for decoding RFC2047 messages