Libvmime patches

From Zarafa wiki

Jump to: navigation, search

The following patches are applied by Zarafa to the vmime library, in order of creation date.
The patches can be downloaded here. These patches belong to version 0.7 of libvmime. A number of patches are also applied in version 0.8 and 0.9, but that version is currently not used by Zarafa, because of a non-compatible API.


Early catches an exception of vmime when iconv was unable to convert a word from or to the requested charsets. This makes broken mails with invalid characters for a valid charset still be able to deliver. We'd rather have an email with a ? sign than a FallbackDelivery for the user.


Broken emails without a final boundary will still be able to deliver with all attachments. The final part without the boundary will be treated as an attachment.


Makes the messageBuilder helper generate an mail without To or Cc headers. This way, an email with only Bcc entries will still be sent. This feature is mostly used by people to mask a mailing list or invitation that should be send to alot of people.


We've seen broken mails with an invalid encoding. Unsure what {{{'bmoted-printable'}}} actually is, we make vmime treat it as normal {{{quoted-printable}}}.


This patch makes sure that vmime does not parse trailing spaces on an header. Otherwise vmime will throw an exception and a fallback delivery will be started.


Fixes parsing of an attachment filename that is between 66 and 76 characters long.


Bcc headers should not be send to the SMTP server. Some SMTP server automatically strip this header (Postfix, qmail), and others have an option for this (Exim).


Fixes a small but crucial typo in a header of an MDN (read receipt) mail.


A header with the final recipient information was created, but not added to the MDN email. This patch adds this information to the mail.


On Debian machines, you need to configure the locales (languages) that will be used on the system. When you use a locale (eg. {{{LC_MESSAGES=nl_NL}}}, but did not configure your distribution to have this locale present on your system, a NULL pointer would have thrown an exception in the std::string class. This makes sure that exception never happens.


Headers can be broken over multiple lines in an email. When the wrapped line directly started with quoted-printable, vmime copied this text as normal text, in stead of parsing it as quoted-printable.


This patch adds some characters that should be "escaped" in quoted-printable. With this fix you can have these characters in a fullname of an email address.


When an email header has the data part on the second line, vmime was unable to parse this data and skip adds the header as empty to it's internal structures. This makes sure these headers are still correctly parsed.


Fixes attachment names in Outlook Express which are long and have high characters.


Some mails have a special definition of the utf-7 character set, named unicode-1-1-utf-7. Since this name is not defined by iconv, we rename it to utf-7. This name seems to come from rfc-1642


When a line in a plain text mail starts with a '.', the character needs to be escaped. VMime has a special filter for this, but due to a bug in this filter, a second line starting with a '.' would trigger a wrong buffer copy, and your email would contain double parts.


Some broken generators may set the Content-Transfer-Encoding header, but did not set any value. We'll assume the default value '7bit'.


Enables re-generation of broken content-id's that had no @ sign in them.


Small partial backport of some socket handling code from 0.8.1 Only receiving data is handled better. The patch also adds a timeout, when receiving data from a socket hasn't worked for 5 minutes. This isn't present in 0.8.1.


When an email contains the same boundary to announce a new body part directly one after another, vmime would have crashed because the body part added to the object with size of (size_type)(-1). Thus having a body part of 4294967294 bytes on 32bit and 18446744073709551615 bytes on 64bit systems.


Special characters break the quoted-printable encoding when they are typed after a ?. This fix also encodes ?-characters, so we can't break the encoding with this trick.


Fixes iconv conversion with source buffers >64Kb not to add a '?' and skip one byte of the input buffer.


Adds required include headers to compile with g++-4.3.


Fixes dates in headers which use a timezone definition, instead of a numeric timezone offset.


Adds the TCP_NODELAY flag to vmime sockets. This should make the SMTP connection faster.


Workaround a static variable in the smart_ptr class using a pthread mutex, which fixes multi-threading issues in libvmime.


Adds required include headers to compile with g++-4.4.


When constructing a plaintext only body without attachments, a copy of the body was made to set as the real body, and thus removing all the multiparts. However, the same reference is removed before setting the new body, thus invalidating that body we wish to copy, possibly resulting in a crash.


Replaces old vmime-strip-header-endspaces.diff. This patch makes sure that vmime does not parse trailing spaces on an header. Otherwise vmime will throw an exception and a fallback delivery wil be started. This fix includes a patch when then last header does not end with \n. Fixes read receipt emails.


Fixes RFC 2047 encoded fullname parsing. All addresses after a wrongly parsed address were not recognized anymore.


Adds support for address headers that specify an (encoded) fullname with an empty email address, which was set by a <> marker.


Strips excessive spaces in parameterized headers. Backported from upstream svn.


Allows non-rfc '7-bit' and '8-bit' encodings in Content-Transfer-Encoding headers.

Personal tools