$headers->replaceHeader('Content-Disposition', $disposition, array('params' => (!empty($name) ? array('filename' => $name) : array())));
}
- /* Add transfer encoding information. */
- $headers->replaceHeader('Content-Transfer-Encoding', $this->_getTransferEncoding(empty($options['encode']) ? null : $options['encode']));
+ /* Add transfer encoding information. RFC 2045 [6.1] indicates that
+ * default is 7bit. No need to send the header in this case. */
+ $encoding = $this->_getTransferEncoding(empty($options['encode']) ? null : $options['encode']);
+ if ($encoding == '7bit') {
+ $headers->removeHeader('Content-Transfer-Encoding');
+ } else {
+ $headers->replaceHeader('Content-Transfer-Encoding', $encoding);
+ }
/* Add content ID information. */
if (!is_null($this->_contentid)) {
<api>alpha</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Default disposition should be empty by default, not inline (RFC 2183 [2]).
+ <notes>
+ * No need to generate Content-Transfer-Encoding header if part data is 7bit.
+ * Default disposition should be empty by default, not inline (RFC 2183 [2]).
* Request #8556: Allow specifying a header charset for a part.
* Add 'raw' render view to Horde_Mime_Viewer.
* Horde_Mime_Part::parseMessage() correctly parses non-MIME parts.