rpms/libvmime07/F-11 libvmime07-0.7.1-allow-no-recips-and-senders.patch, NONE, 1.1 libvmime07-0.7.1-attachfnamelen.patch, NONE, 1.1 libvmime07-0.7.1-bmoted-printable.patch, NONE, 1.1 libvmime07-0.7.1-broken-locale-error.patch, NONE, 1.1 libvmime07-0.7.1-charset-catch.patch, NONE, 1.1 libvmime07-0.7.1-charset-output-buffer-full.patch, NONE, 1.1 libvmime07-0.7.1-contentid-without-at.patch, NONE, 1.1 libvmime07-0.7.1-default-transfer-encoding.patch, NONE, 1.1 libvmime07-0.7.1-double-empty-boundary.patch, NONE, 1.1 libvmime07-0.7.1-gcc-4.3-support.patch, NONE, 1.1 libvmime07-0.7.1-gcc-4.4-support.patch, NONE, 1.1 libvmime07-0.7.1-header-value-on-next-line.patch, NONE, 1.1 libvmime07-0.7.1-mdn-disposition.patch, NONE, 1.1 libvmime07-0.7.1-mdn-final-recipient.patch, NONE, 1.1 libvmime07-0.7.1-missing-boundary.patch, NONE, 1.1 libvmime07-0.7.1-oe-compatibility.patch, NONE, 1.1 libvmime07-0.7.1-out-of-bounds-copy.patch, NONE, 1.1 libvmime07-0.7.1-package.patch, NONE, 1.1 libvmime07-0.7.1-plain-bodycopy.patch, NONE, 1.1 libvmime07-0.7.1-qp-starts-on-second-line.patch, NONE, 1.1 libvmime07-0.7.1-quoted-printable-encode-questionmark.patch, NONE, 1.1 libvmime07-0.7.1-quoted-printable-specials.patch, NONE, 1.1 libvmime07-0.7.1-remove-bcc.patch, NONE, 1.1 libvmime07-0.7.1-socket-backport-and-timeout-fix.patch, NONE, 1.1 libvmime07-0.7.1-socket-tcp-nodelay.patch, NONE, 1.1 libvmime07-0.7.1-strip-header-endspaces.patch, NONE, 1.1 libvmime07-0.7.1-threading-remove-static_non-abi-change.patch, NONE, 1.1 libvmime07-0.7.1-timezone-name.patch, NONE, 1.1 libvmime07-0.7.1-unicode-1-1-utf-7-charset.patch, NONE, 1.1 libvmime07.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Robert Scheck robert at fedoraproject.org
Wed Sep 16 21:50:32 UTC 2009


Author: robert

Update of /cvs/pkgs/rpms/libvmime07/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16757/F-11

Modified Files:
	.cvsignore sources 
Added Files:
	libvmime07-0.7.1-allow-no-recips-and-senders.patch 
	libvmime07-0.7.1-attachfnamelen.patch 
	libvmime07-0.7.1-bmoted-printable.patch 
	libvmime07-0.7.1-broken-locale-error.patch 
	libvmime07-0.7.1-charset-catch.patch 
	libvmime07-0.7.1-charset-output-buffer-full.patch 
	libvmime07-0.7.1-contentid-without-at.patch 
	libvmime07-0.7.1-default-transfer-encoding.patch 
	libvmime07-0.7.1-double-empty-boundary.patch 
	libvmime07-0.7.1-gcc-4.3-support.patch 
	libvmime07-0.7.1-gcc-4.4-support.patch 
	libvmime07-0.7.1-header-value-on-next-line.patch 
	libvmime07-0.7.1-mdn-disposition.patch 
	libvmime07-0.7.1-mdn-final-recipient.patch 
	libvmime07-0.7.1-missing-boundary.patch 
	libvmime07-0.7.1-oe-compatibility.patch 
	libvmime07-0.7.1-out-of-bounds-copy.patch 
	libvmime07-0.7.1-package.patch 
	libvmime07-0.7.1-plain-bodycopy.patch 
	libvmime07-0.7.1-qp-starts-on-second-line.patch 
	libvmime07-0.7.1-quoted-printable-encode-questionmark.patch 
	libvmime07-0.7.1-quoted-printable-specials.patch 
	libvmime07-0.7.1-remove-bcc.patch 
	libvmime07-0.7.1-socket-backport-and-timeout-fix.patch 
	libvmime07-0.7.1-socket-tcp-nodelay.patch 
	libvmime07-0.7.1-strip-header-endspaces.patch 
	libvmime07-0.7.1-threading-remove-static_non-abi-change.patch 
	libvmime07-0.7.1-timezone-name.patch 
	libvmime07-0.7.1-unicode-1-1-utf-7-charset.patch 
	libvmime07.spec 
Log Message:
Populate libvmime07 to Fedora and EPEL branches


libvmime07-0.7.1-allow-no-recips-and-senders.patch:
 messageBuilder.cpp |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

--- NEW FILE libvmime07-0.7.1-allow-no-recips-and-senders.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/messageBuilder.cpp				2005-03-18 22:26:47.000000000 +0100
+++ libvmime-0.7.1/src/messageBuilder.cpp.allow-no-recips-and-senders	2006-01-13 09:49:51.000000000 +0100
@@ -50,14 +50,11 @@
 	// Generate the header fields
 	msg->getHeader()->Subject().setValue(m_subject);
 
-	if (m_from.isEmpty())
-		throw exceptions::no_expeditor();
-
-	if (m_to.isEmpty() || m_to.getAddressAt(0)->isEmpty())
-		throw exceptions::no_recipient();
-
-	msg->getHeader()->From().setValue(m_from);
-	msg->getHeader()->To().setValue(m_to);
+	if (!m_from.isEmpty())
+		msg->getHeader()->From().setValue(m_from);
+		
+	if (!m_to.isEmpty())
+		msg->getHeader()->To().setValue(m_to);
 
 	if (!m_cc.isEmpty())
 		msg->getHeader()->Cc().setValue(m_cc);

libvmime07-0.7.1-attachfnamelen.patch:
 defaultParameter.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-attachfnamelen.patch ---
Patch by Zarafa <http://www.zarafa.com/> - fixes parsing of an attachment filename that is between 66 and
76 characters long.

--- libvmime-0.7.1/src/defaultParameter.cpp				2005-06-21 19:06:35.000000000 +0200
+++ libvmime-0.7.1/src/defaultParameter.cpp.attachfnamelen		2006-08-01 10:42:18.277853120 +0200
@@ -200,7 +200,8 @@
 	bool needQuoting = false;
 	string::size_type valueLength = 0;
 
-	for (string::size_type i = 0 ; (i < value.length()) && (pos + valueLength < maxLineLength - 4) ; ++i, ++valueLength)
+	// Use worst-case length name.length()+2 for 'name=' part of line
+	for (string::size_type i = 0 ; (i < value.length()) && (pos + name.length() + 2 + valueLength < maxLineLength - 4) ; ++i, ++valueLength)
 	{
 		switch (value[i])
 		{

libvmime07-0.7.1-bmoted-printable.patch:
 encoderFactory.cpp |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE libvmime07-0.7.1-bmoted-printable.patch ---
Patch by Zarafa <http://www.zarafa.com/> - we've seen broken mails with an invalid encoding. Unsure what
'bmoted-printable' actually is, we make vmime treat it as normal 'quoted-printable'. 

--- libvmime-0.7.1/src/encoderFactory.cpp				2005-03-18 22:26:47.000000000 +0100
+++ libvmime-0.7.1/src/encoderFactory.cpp.bmoted-printable		2006-04-05 10:35:25.618215000 +0200
@@ -37,6 +37,7 @@
 	// Register some default encoders
 	registerName <encoderB64>("base64");
 	registerName <encoderQP>("quoted-printable");
+	registerName <encoderQP>("bmoted-printable");
 	registerName <encoderUUE>("uuencode");
 	registerName <encoder7bit>("7bit");
 	registerName <encoder8bit>("8bit");

libvmime07-0.7.1-broken-locale-error.patch:
 posixHandler.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE libvmime07-0.7.1-broken-locale-error.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/platforms/posix/posixHandler.cpp			2005-04-30 09:53:21.000000000 +0200
+++ libvmime-0.7.1/src/platforms/posix/posixHandler.cpp.broken-locale	2006-12-28 17:29:43.883410000 +0100
@@ -106,9 +106,9 @@
 
 const vmime::charset posixHandler::getLocaleCharset() const
 {
-	vmime::string prevLocale(::setlocale(LC_ALL, ""));
+	char *prevLocale = ::setlocale(LC_ALL, "");
 	vmime::charset ch(::nl_langinfo(CODESET));
-	::setlocale(LC_ALL, prevLocale.c_str());
+	::setlocale(LC_ALL, prevLocale);
 
 	return (ch);
 }

libvmime07-0.7.1-charset-catch.patch:
 word.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

--- NEW FILE libvmime07-0.7.1-charset-catch.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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. 

--- libvmime-0.7.1/src/word.cpp						2005-06-13 12:56:52.000000000 +0200
+++ libvmime-0.7.1/src/word.cpp.charset-catch				2005-11-15 18:02:45.000000000 +0100
@@ -688,7 +688,13 @@
 {
 	string out;
 
+	try {
 	charset::convert(m_buffer, out, m_charset, dest);
+	}
+	catch (vmime::exception &e) {
+		// copy 'word' as text
+		out = m_buffer;
+	}
 
 	return (out);
 }

libvmime07-0.7.1-charset-output-buffer-full.patch:
 charset.cpp |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE libvmime07-0.7.1-charset-output-buffer-full.patch ---
Patch by Zarafa <http://www.zarafa.com/> - fixes iconv conversion with source buffers > 64Kb not to add a
'?' and skip one byte of the input buffer.

--- libvmime-0.7.1/src/charset.cpp					2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1/src/charset.cpp.charset-output-buffer-full		2008-07-07 13:51:33.414160106 +0200
@@ -206,10 +206,12 @@
 				out += STRINGT(static_cast <ovt*>(buffer), sizeof(buffer) - outBytesLeft);
 
 				// Ignore this "blocking" character and continue
+				if (outBytesLeft > 0) {
 				out += '?';
 				++inBuffer;
 				--inBytesLeft;
 			}
+			}
 			else
 			{
 				out += STRINGT(static_cast <ovt*>(buffer), sizeof(buffer) - outBytesLeft);

libvmime07-0.7.1-contentid-without-at.patch:
 messageId.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- NEW FILE libvmime07-0.7.1-contentid-without-at.patch ---
Patch by Zarafa <http://www.zarafa.com/> - enables re-generation of broken content-id's that had no @ sign
in them.

--- libvmime-0.7.1/src/messageId.cpp					2005-03-27 14:59:12.000000000 +0200
+++ libvmime-0.7.1/src/messageId.cpp.contentid-without-at		2007-07-31 14:14:38.827718500 +0200
@@ -102,7 +102,7 @@
 		// Extract left part
 		const string::size_type leftStart = position + (p - pstart);
 
-		while (p < pend && *p != '@') ++p;
+		while (p < pend && *p != '@' && *p != '>') ++p;
 
 		m_left = string(buffer.begin() + leftStart,
 		                buffer.begin() + position + (p - pstart));
@@ -162,6 +162,8 @@
 
 const string messageId::getId() const
 {
+	if (m_right == "")
+		return m_left;
 	return (m_left + '@' + m_right);
 }
 
@@ -177,7 +179,10 @@
 		pos = NEW_LINE_SEQUENCE_LENGTH;
 	}
 
-	os << '<' << m_left << '@' << m_right << '>';
+	os << '<' << m_left;
+	if (m_right != "")
+		os << '@' << m_right;
+	os << '>';
 
 	if (newLinePos)
 		*newLinePos = pos + m_left.length() + m_right.length() + 3;

libvmime07-0.7.1-default-transfer-encoding.patch:
 body.cpp |    3 +++
 1 file changed, 3 insertions(+)

--- NEW FILE libvmime07-0.7.1-default-transfer-encoding.patch ---
Patch by Zarafa <http://www.zarafa.com/> - some broken generators may set the Content-Transfer-Encoding
header, but did not set any value. We'll assume the default value '7bit'.

--- libvmime-0.7.1/src/body.cpp						2007-01-26 14:44:10.259563000 +0100
+++ libvmime-0.7.1/src/body.cpp.default-transfer-encoding		2007-07-13 12:14:30.699846500 +0200
@@ -465,6 +465,9 @@
 		const contentEncodingField& cef = dynamic_cast<contentEncodingField&>
 			(*m_header->findField(fields::CONTENT_TRANSFER_ENCODING));
 
+		if (cef.getValue().getName().empty())
+			return (vmime::encoding(encodingTypes::SEVEN_BIT));
+
 		return (cef.getValue());
 	}
 	catch (exceptions::no_such_field&)

libvmime07-0.7.1-double-empty-boundary.patch:
 body.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-double-empty-boundary.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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 64 bit systems.

--- libvmime-0.7.1/src/body.cpp						2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1/src/body.cpp.double-empty-boundary			2007-11-01 16:45:20.688580500 +0100
@@ -173,7 +173,7 @@
 				++pos;
 			}
 
-			if (index > 0)
+			if (index > 0 && partStart < partEnd)
 			{
 				bodyPart* part = new bodyPart;
 

libvmime07-0.7.1-gcc-4.3-support.patch:
 src/messaging/imap/IMAPMessage.cpp  |    2 +-
 src/platforms/posix/posixSocket.cpp |    1 +
 src/utility/md5.cpp                 |    2 +-
 vmime/utility/filteredStream.hpp    |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

--- NEW FILE libvmime07-0.7.1-gcc-4.3-support.patch ---
Patch by Zarafa <http://www.zarafa.com/> - adds required include headers to compile with g++-4.3 and up.

--- libvmime-0.7.1/src/messaging/imap/IMAPMessage.cpp			2005-05-27 21:31:44.000000000 +0200
+++ libvmime-0.7.1/src/messaging/imap/IMAPMessage.cpp.gcc-4.3-support	2008-07-07 15:41:38.034166062 +0200
@@ -26,7 +26,7 @@
 
 #include <sstream>
 #include <iterator>
-
+#include <typeinfo>
 
 namespace vmime {
 namespace messaging {
--- libvmime-0.7.1/src/platforms/posix/posixSocket.cpp			2005-03-18 22:26:49.000000000 +0100
+++ libvmime-0.7.1/src/platforms/posix/posixSocket.cpp.gcc-4.3-support	2008-07-07 15:42:16.700025085 +0200
@@ -19,6 +19,7 @@
 
 #include "vmime/platforms/posix/posixSocket.hpp"
 
+#include <string.h>
 #include <unistd.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
--- libvmime-0.7.1/src/utility/md5.cpp					2005-03-18 22:26:48.000000000 +0100
+++ libvmime-0.7.1/src/utility/md5.cpp.gcc-4.3-support			2008-07-07 15:41:38.034166062 +0200
@@ -45,7 +45,7 @@
 //     documentation and/or software.
 
 #include "vmime/utility/md5.hpp"
-
+#include <string.h>
 
 namespace vmime {
 namespace utility {
--- libvmime-0.7.1/vmime/utility/filteredStream.hpp			2005-06-16 21:19:12.000000000 +0200
+++ libvmime-0.7.1/vmime/utility/filteredStream.hpp.gcc-4.3-support	2008-07-07 15:41:38.034166062 +0200
@@ -22,7 +22,7 @@
 
 
 #include "vmime/utility/stream.hpp"
-
+#include <algorithm>
 
 namespace vmime {
 namespace utility {

libvmime07-0.7.1-gcc-4.4-support.patch:
 posixFile.cpp |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE libvmime07-0.7.1-gcc-4.4-support.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for libvmime >= 0.7.1, which adds a missing include file
in order to build successfully with GCC 4.4 and newer.

--- libvmime-0.7.1/src/platforms/posix/posixFile.cpp			2005-04-09 10:42:46.000000000 +0200
+++ libvmime-0.7.1/src/platforms/posix/posixFile.cpp.gcc-4.4-support	2009-03-29 21:09:07.000000000 +0200
@@ -28,6 +28,7 @@
 
 #include <dirent.h>
 
+#include <stdio.h>
 #include <string.h>
 
 #include "vmime/exception.hpp"

libvmime07-0.7.1-header-value-on-next-line.patch:
 headerField.cpp |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- NEW FILE libvmime07-0.7.1-header-value-on-next-line.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/headerField.cpp					2007-01-26 14:44:10.315567250 +0100
+++ libvmime-0.7.1/src/headerField.cpp.header-value-on-next-line	2007-02-07 13:35:35.177077750 +0100
@@ -147,14 +147,12 @@
 					{
 						contentsEnd = pos;
 						pos += 2;
-						break;
 					}
 					else if (c == '\n')
 					{
 						contentsEnd = pos;
 						++pos;
-						break;
-					}
+					} else {
 
 					while (pos < end)
 					{
@@ -176,6 +174,7 @@
 
 						++pos;
 					}
+					}
 
 					// Handle the case of folded lines
 					if (buffer[pos] == ' ' || buffer[pos] == '\t')

libvmime07-0.7.1-mdn-disposition.patch:
 MDNHelper.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-mdn-disposition.patch ---
Patch by Zarafa <http://www.zarafa.com/> - fixes a small but crucial typo in a header of an MDN (read
receipt) mail.

--- libvmime-0.7.1/src/mdn/MDNHelper.cpp				2005-04-09 21:45:07.000000000 +0200
+++ libvmime-0.7.1/src/mdn/MDNHelper.cpp.mdn-disposition		2006-11-28 09:37:56.009129500 +0100
@@ -143,7 +143,7 @@
 
 	hdr->ContentType().setValue(mediaType(vmime::mediaTypes::MULTIPART,
 	                                      vmime::mediaTypes::MULTIPART_REPORT));
-	hdr->ContentType().setReportType("disosition-notification");
+	hdr->ContentType().setReportType("disposition-notification");
 
 	hdr->Disposition().setValue(dispo);
 

libvmime07-0.7.1-mdn-final-recipient.patch:
 MDNHelper.cpp |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE libvmime07-0.7.1-mdn-final-recipient.patch ---
Patch by Zarafa <http://www.zarafa.com/> - a header with the final recipient information was created, but
not added to the MDN email. This patch adds this information to the mail.

--- libvmime-0.7.1/src/mdn/MDNHelper.cpp				2006-11-28 09:43:47.995127250 +0100
+++ libvmime-0.7.1/src/mdn/MDNHelper.cpp.mdn-final-recipient		2006-11-28 09:43:27.505846750 +0100
@@ -246,6 +246,7 @@
 		(headerFieldFactory::getInstance()->create(vmime::fields::FINAL_RECIPIENT));
 
 	fr->setValue("rfc822; " + mdnInfos.getRecipient().getEmail());
+	fields.appendField(fr);
 
 	// -- Original-Message-ID
 	if (mdnInfos.getMessage()->getHeader()->hasField(vmime::fields::MESSAGE_ID))

libvmime07-0.7.1-missing-boundary.patch:
 body.cpp |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

--- NEW FILE libvmime07-0.7.1-missing-boundary.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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. 

--- libvmime-0.7.1/src/body.cpp						2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1/src/body.cpp.missing-boundary			2006-01-12 15:45:48.443911888 +0100
@@ -200,6 +200,27 @@
 
 		if (partStart < end)
 			m_epilogText = string(buffer.begin() + partStart, buffer.begin() + end);
+
+		// lastPart was not found, so the last boundary was missing
+		// m_epilogText will become a bodyPart
+		if (!lastPart && pos == string::npos) {
+			bodyPart* part = new bodyPart;
+
+			try
+			{
+				part->parse(m_epilogText);
+			}
+			catch (std::exception&)
+			{
+				delete (part);
+				throw;
+			}
+
+			part->m_parent = m_part;
+
+			m_parts.push_back(part);
+		}
+			
 	}
 	// Treat the contents as 'simple' data
 	else

libvmime07-0.7.1-oe-compatibility.patch:
 defaultParameter.cpp |   66 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 41 insertions(+), 25 deletions(-)

--- NEW FILE libvmime07-0.7.1-oe-compatibility.patch ---
Patch by Zarafa <http://www.zarafa.com/> - fixes attachment names in Outlook Express which are long and
have high characters.

--- libvmime-0.7.1/src/defaultParameter.cpp				2007-01-26 14:44:10.243562750 +0100
+++ libvmime-0.7.1/src/defaultParameter.cpp.vmime-oe-compatibility	2007-04-24 13:43:36.579203500 +0200
@@ -186,18 +186,18 @@
 {
 	const string& name = getName();
 	const string& value = m_value.getBuffer();
+	string tmpbuf;
+	utility::outputStreamStringAdapter tmpos(tmpbuf);
 
 	// For compatibility with implementations that do not understand RFC-2231,
 	// also generate a normal "7bit/us-ascii" parameter
 	string::size_type pos = curLinePos;
 
-	if (pos + name.length() + 10 + value.length() > maxLineLength)
-	{
-		os << NEW_LINE_SEQUENCE;
+		tmpos << NEW_LINE_SEQUENCE;
 		pos = NEW_LINE_SEQUENCE_LENGTH;
-	}
 
 	bool needQuoting = false;
+	bool needQuotedPrintable = false;
 	string::size_type valueLength = 0;
 
 	// Use worst-case length name.length()+2 for 'name=' part of line
@@ -228,35 +228,50 @@
 			needQuoting = true;
 			break;
 		}
+		if (!parserHelpers::isAscii(value[i]))
+		{
+			needQuotedPrintable = true;
+			needQuoting = true;
+		}
 	}
 
 	const bool cutValue = (valueLength != value.length());  // has the value been cut?
 
 	if (needQuoting)
 	{
-		os << name << "=\"";
+		tmpos << name << "=\"";
 		pos += name.length() + 2;
 	}
 	else
 	{
-		os << name << "=";
+		tmpos << name << "=";
 		pos += name.length() + 1;
 	}
 
 	bool extended = false;
-
-	for (string::size_type i = 0 ; (i < value.length()) && (pos < maxLineLength - 4) ; ++i)
+	if (needQuotedPrintable)
+	{
+		// send the name in quoted-printable, so outlook express et.al. will understand the real filename
+		size_t oldlen = tmpbuf.length();
+		m_value.generate(tmpos);
+		pos += tmpbuf.length() - oldlen;
+		extended = true;		// also send with RFC-2231 encoding
+	}
+	else
+	{
+	// do not chop off this value, but just add the complete name as one header line.
+	for (string::size_type i = 0 ; (i < value.length()) /*&& (pos < maxLineLength - 4) */ ; ++i)
 	{
 		const char_t c = value[i];
 
 		if (/* needQuoting && */ (c == '"' || c == '\\'))  // 'needQuoting' is implicit
 		{
-			os << '\\' << value[i];  // escape 'x' with '\x'
+			tmpos << '\\' << value[i];  // escape 'x' with '\x'
 			pos += 2;
 		}
 		else if (parserHelpers::isAscii(c))
 		{
-			os << value[i];
+			tmpos << value[i];
 			++pos;
 		}
 		else
@@ -264,10 +279,11 @@
 			extended = true;
 		}
 	}
+	}
 
 	if (needQuoting)
 	{
-		os << '"';
+		tmpos << '"';
 		++pos;
 	}
 
@@ -275,7 +291,7 @@
 	// or is too long for a single line
 	if (extended || cutValue)
 	{
-		os << ';';
+		tmpos << ';';
 		++pos;
 
 		/* RFC-2231
@@ -301,11 +317,8 @@
 			  name.length() + 4 /* *0*= */ + 2 /* '' */
 			+ m_value.getCharset().getName().length();
 
-		if (pos + firstSectionLength + 5 >= maxLineLength)
-		{
-			os << NEW_LINE_SEQUENCE;
+			tmpos << NEW_LINE_SEQUENCE;
 			pos = NEW_LINE_SEQUENCE_LENGTH;
-		}
 
 		// Split text into multiple sections that fit on one line
 		int sectionCount = 0;
@@ -384,33 +397,36 @@
 		// Output sections
 		for (int sectionNumber = 0 ; sectionNumber < sectionCount ; ++sectionNumber)
 		{
-			os << name;
+			tmpos << name;
 
 			if (sectionCount != 1) // no section specifier when only a single one
 			{
-				os << '*';
-				os << sectionNumber;
+				tmpos << '*';
+				tmpos << sectionNumber;
 			}
 
-			os << "*=";
+			tmpos << "*=";
 
 			if (sectionNumber == 0)
 			{
-				os << m_value.getCharset().getName();
-				os << '\'' << /* No language */ '\'';
+				tmpos << m_value.getCharset().getName();
+				tmpos << '\'' << /* No language */ '\'';
 			}
 
-			os << sectionText[sectionNumber];
+			tmpos << sectionText[sectionNumber];
 
 			if (sectionNumber + 1 < sectionCount)
 			{
-				os << ';';
-				os << NEW_LINE_SEQUENCE;
+				tmpos << ';';
+				tmpos << NEW_LINE_SEQUENCE;
 				pos = NEW_LINE_SEQUENCE_LENGTH;
 			}
 		}
 	}
 
+	// write the complete header
+	os << tmpbuf;
+
 	if (newLinePos)
 		*newLinePos = pos;
 }

libvmime07-0.7.1-out-of-bounds-copy.patch:
 filteredStream.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-out-of-bounds-copy.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/utility/filteredStream.cpp			2005-06-16 21:50:12.000000000 +0200
+++ libvmime-0.7.1/src/utility/filteredStream.cpp.out-of-bounds-copy	2007-06-15 14:29:40.907779750 +0200
@@ -146,7 +146,7 @@
 
 		if (previousChar == '\n')
 		{
-			m_stream.write(start, pos - data);
+			m_stream.write(start, pos - start);
 			m_stream.write("..", 2);
 
 			start = pos + 1;

libvmime07-0.7.1-package.patch:
 configure.in    |    2 +-
 src/Makefile.am |   22 +++++++++++-----------
 vmime.pc.in     |    6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

--- NEW FILE libvmime07-0.7.1-package.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for libvmime >= 0.7.1 to get libvmime renamed to
libvmime07 to avoid any conflicts with current libvmime series. Note that libvmime 0.7.x, 0.8.x and
0.9.x are unfortunately completely API and ABI incompatible to eachother.

--- libvmime-0.7.1/src/Makefile.am					2005-06-22 00:11:11.000000000 +0200
+++ libvmime-0.7.1/src/Makefile.am.package				2009-04-05 17:36:46.000000000 +0200
@@ -5,9 +5,9 @@
 AUTOMAKE_OPTIONS = no-dependencies foreign
 INTERNALS =
 INCLUDES = -I$(top_srcdir) -I$(srcdir) @PKGCONFIG_CFLAGS@ @EXTRA_CFLAGS@
-lib_LTLIBRARIES = libvmime.la
-libvmime_la_LDFLAGS = -export-dynamic -version-info @LIBRARY_VERSION@ @PKGCONFIG_LIBS@ @EXTRA_LIBS@
-libvmime_la_SOURCES = address.cpp \
+lib_LTLIBRARIES = libvmime07.la
+libvmime07_la_LDFLAGS = -export-dynamic -version-info @LIBRARY_VERSION@ @PKGCONFIG_LIBS@ @EXTRA_LIBS@
+libvmime07_la_SOURCES = address.cpp \
 	addressList.cpp \
 	base.cpp \
 	body.cpp \
@@ -82,7 +82,7 @@
 	misc_importanceHelper.cpp
 
 if VMIME_HAVE_MESSAGING_FEATURES
-libvmime_la_SOURCES += messaging_authenticator.cpp \
+libvmime07_la_SOURCES += messaging_authenticator.cpp \
 	messaging_authenticationInfos.cpp \
 	messaging_authHelper.cpp \
 	messaging_builtinServices.inl \
@@ -99,17 +99,17 @@
 endif
 
 if VMIME_BUILTIN_MESSAGING_PROTO_POP3
-libvmime_la_SOURCES += messaging_pop3_POP3Store.cpp \
+libvmime07_la_SOURCES += messaging_pop3_POP3Store.cpp \
 	messaging_pop3_POP3Folder.cpp \
 	messaging_pop3_POP3Message.cpp
 endif
 
 if VMIME_BUILTIN_MESSAGING_PROTO_SMTP
-libvmime_la_SOURCES += messaging_smtp_SMTPTransport.cpp
+libvmime07_la_SOURCES += messaging_smtp_SMTPTransport.cpp
 endif
 
 if VMIME_BUILTIN_MESSAGING_PROTO_IMAP
-libvmime_la_SOURCES += messaging_imap_IMAPConnection.cpp \
+libvmime07_la_SOURCES += messaging_imap_IMAPConnection.cpp \
 	messaging_imap_IMAPStore.cpp \
 	messaging_imap_IMAPFolder.cpp \
 	messaging_imap_IMAPMessage.cpp \
@@ -118,24 +118,24 @@
 endif
 
 if VMIME_BUILTIN_MESSAGING_PROTO_MAILDIR
-libvmime_la_SOURCES += messaging_maildir_maildirStore.cpp \
+libvmime07_la_SOURCES += messaging_maildir_maildirStore.cpp \
 	messaging_maildir_maildirFolder.cpp \
 	messaging_maildir_maildirMessage.cpp \
 	messaging_maildir_maildirUtils.cpp
 endif
 
 if VMIME_BUILTIN_MESSAGING_PROTO_SENDMAIL
-libvmime_la_SOURCES += messaging_sendmail_sendmailTransport.cpp
+libvmime07_la_SOURCES += messaging_sendmail_sendmailTransport.cpp
 endif
 
 if VMIME_BUILTIN_PLATFORM_WINDOWS
-libvmime_la_SOURCES += platforms_windows_windowsFile.cpp \
+libvmime07_la_SOURCES += platforms_windows_windowsFile.cpp \
 	platforms_windows_windowsHandler.cpp \
 	platforms_windows_windowsSocket.cpp
 endif
 
 if VMIME_BUILTIN_PLATFORM_POSIX
-libvmime_la_SOURCES += platforms_posix_posixChildProcess.cpp \
+libvmime07_la_SOURCES += platforms_posix_posixChildProcess.cpp \
 	platforms_posix_posixFile.cpp \
 	platforms_posix_posixHandler.cpp \
 	platforms_posix_posixSocket.cpp
--- libvmime-0.7.1/configure.in						2005-06-22 00:11:11.000000000 +0200
+++ libvmime-0.7.1/configure.in.package					2009-04-06 20:42:53.000000000 +0200
@@ -18,7 +18,7 @@
 GENERIC_VERSIONED_LIBRARY_NAME="vmime"
 AC_SUBST(GENERIC_VERSIONED_LIBRARY_NAME)
 
-LIBRARY_NAME="libvmime"
+LIBRARY_NAME="libvmime07"
 AC_SUBST(LIBRARY_NAME)
 
 # Library version
--- libvmime-0.7.1/vmime.pc.in						2005-06-22 00:11:11.000000000 +0200
+++ libvmime-0.7.1/vmime.pc.in.package					2009-04-06 20:46:07.000000000 +0200
@@ -6,9 +6,9 @@
 libdir=@libdir@
 includedir=@includedir@
 
-Name: @GENERIC_LIBRARY_NAME@
+Name: vmime07
 Description: VMime C++ Mail Library (http://vmime.sourceforge.net)
 Version: @VERSION@
 Requires:
-Libs: -L${libdir} -l at GENERIC_VERSIONED_LIBRARY_NAME@
-Cflags: -I${includedir}/
+Libs: -L${libdir} -lvmime07
+Cflags: -I${includedir}/libvmime07/

libvmime07-0.7.1-plain-bodycopy.patch:
 messageBuilder.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-plain-bodycopy.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/messageBuilder.cpp				2009-09-15 22:59:21.000000000 +0200
+++ libvmime-0.7.1/src/messageBuilder.cpp.plain-bodycopy		2009-09-15 23:00:33.000000000 +0200
@@ -137,6 +137,8 @@
 	if (msg->getBody()->getPartCount() == 1)
 	{
 		const bodyPart& part = *msg->getBody()->getPartAt(0);
+		// make a full copy of the body, otherwise the copyFrom will delete the body we're copying
+		const body* bodyCopy = part.getBody()->clone();
 
 		// First, copy (and replace) the header fields
 		const std::vector <const headerField*> fields = part.getHeader()->getFieldList();
@@ -149,7 +151,8 @@
 
 		// Second, copy the body contents and sub-parts (this also remove
 		// the body part we are copying...)
-		msg->getBody()->copyFrom(*part.getBody());
+		msg->getBody()->copyFrom(*bodyCopy);
+		delete bodyCopy;
 	}
 
 	return (msg);

libvmime07-0.7.1-qp-starts-on-second-line.patch:
 word.cpp |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE libvmime07-0.7.1-qp-starts-on-second-line.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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, instead
of parsing it as quoted-printable. 

--- libvmime-0.7.1/src/word.cpp						2007-01-26 14:44:10.251563000 +0100
+++ libvmime-0.7.1/src/word.cpp.qp-starts-on-second-line		2007-01-26 14:45:01.074739500 +0100
@@ -91,6 +91,7 @@
 			unencoded += ' ';
 
 			startPos = pos;
+			continue;
 		}
 		// Start of an encoded word
 		else if (pos + 8 < end &&  // 8 = "=?(.+)?(.+)?(.*)?="

libvmime07-0.7.1-quoted-printable-encode-questionmark.patch:
 encoderQP.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-quoted-printable-encode-questionmark.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/encoderQP.cpp					2008-03-10 13:57:05.055163691 +0100
+++ libvmime-0.7.1/src/encoderQP.cpp.quoted-printable-encode-question	2008-03-10 13:51:53.071163435 +0100
@@ -249,7 +249,7 @@
 		default:
 		{
 			//if ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))
-			if (c >= 33 && c <= 126 && c != 61)
+			if (c >= 33 && c <= 126 && c != 61 && c!= 63)
 			{
 				outBuffer[outBufferPos++] = c;
 				++curCol;

libvmime07-0.7.1-quoted-printable-specials.patch:
 encoderQP.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

--- NEW FILE libvmime07-0.7.1-quoted-printable-specials.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/encoderQP.cpp					2005-03-18 22:26:47.000000000 +0100
+++ libvmime-0.7.1/src/encoderQP.cpp.quoted-printable-specials		2007-02-02 10:09:26.273653250 +0100
@@ -214,10 +214,18 @@
 			QP_ENCODE_HEX('=')
 			break;
 		}
+		// http://www.faqs.org/rfcs/rfc2047.html, see 'especials' characters
 		case ',':
 		case ';':
 		case ':':
 		case '_':
+		case '@':
+		case '(':
+		case ')':
+		case '<':
+		case '>':
+		case '[':
+		case ']':
 		{
 			if (rfc2047)
 			{

libvmime07-0.7.1-remove-bcc.patch:
 transport.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

--- NEW FILE libvmime07-0.7.1-remove-bcc.patch ---
Patch by Zarafa <http://www.zarafa.com/> - Bcc headers should not be send to the SMTP server. Some SMTP
servers automatically strip this header (Postfix, qmail), and others have an option for this (Exim).

--- libvmime-0.7.1/src/messaging/transport.cpp				2005-04-27 18:42:58.000000000 +0200
+++ libvmime-0.7.1/src/messaging/transport.cpp.remove-bcc		2006-10-10 14:01:43.602621328 +0200
@@ -90,6 +90,14 @@
 	}
 	catch (exceptions::no_such_field&) { }
 
+	// Remove BCC headers from the message we're about to send
+	try {
+		headerField* bcc = msg->getHeader()->findField(fields::BCC);
+
+		msg->getHeader()->removeField(bcc);
+	}
+	catch (exceptions::no_such_field&) { }
+
 	// Generate the message, "stream" it and delegate the sending
 	// to the generic send() function.
 	std::ostringstream oss;

libvmime07-0.7.1-socket-backport-and-timeout-fix.patch:
 src/platforms/posix/posixSocket.cpp   |  102 +++++++++++++++++++++++++++-------
 vmime/platforms/posix/posixSocket.hpp |    3 +
 2 files changed, 85 insertions(+), 20 deletions(-)

--- NEW FILE libvmime07-0.7.1-socket-backport-and-timeout-fix.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/platforms/posix/posixSocket.cpp			2007-10-18 11:19:47.000000000 +0200
+++ libvmime-0.7.1/src/platforms/posix/posixSocket.cpp.socket-timeout	2007-10-18 11:02:54.000000000 +0200
@@ -26,6 +26,7 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <fcntl.h>
+#include <errno.h>
 
 #include "vmime/exception.hpp"
 
@@ -43,7 +44,7 @@
 //
 
 posixSocket::posixSocket()
-	: m_desc(-1)
+	: m_desc(-1), m_timeouts(0)
 {
 }
 
@@ -101,6 +102,8 @@
 		// Error
 		throw vmime::exceptions::connection_error("Error while connecting socket.");
 	}
+
+	m_timeouts = 0;
 }
 
 
@@ -121,38 +124,62 @@
 	}
 }
 
-
 void posixSocket::receive(vmime::string& buffer)
 {
-	::ssize_t ret = ::recv(m_desc, m_buffer, sizeof(m_buffer), 0);
-
-	if (ret == -1)
-	{
-		// Error or no data
-		return;
-	}
-	else if (ret > 0)
-	{
-		buffer = vmime::string(m_buffer, ret);
-	}
+	const int size = receiveRaw(m_buffer, sizeof(m_buffer));
+	buffer = vmime::string(m_buffer, size);
 }
 
 
 const int posixSocket::receiveRaw(char* buffer, const int count)
 {
-	::ssize_t ret = ::recv(m_desc, buffer, count, 0);
+	fd_set fds;
+	struct timeval tv;
+	int ret;
+
+	FD_ZERO(&fds);
+	FD_SET(m_desc, &fds);
+
+	tv.tv_sec = 10;
+	tv.tv_usec = 0;
+
+	ret = ::select(m_desc+1, &fds, NULL, NULL, &tv);
+	if (ret < 0)
+	{
+		if (errno != EAGAIN)
+			throwSocketError(errno);
+
+		m_timeouts++;
+		if (m_timeouts > (5*60))
+			throwSocketError(errno); // SMTP server did not react within 5 minutes
+
+		// No data available at this time
+		return 0;
+	}
 
-	if (ret == -1)
+	ret = ::recv(m_desc, buffer, count, 0);
+
+	if (ret < 0)
 	{
-		// Error or no data
-		return (0);
+		if (errno != EAGAIN)
+			throwSocketError(errno);
+
+		m_timeouts++;
+		if (m_timeouts > (5*60))
+			throwSocketError(errno); // SMTP server did not react within 5 minutes
+
+		// No data available at this time
+		return 0;
 	}
-	else
+	else if (ret == 0)
 	{
-		return (ret);
+		// Host shutdown
+		throwSocketError(ENOTCONN);
 	}
-}
 
+	m_timeouts = 0;
+	return ret;
+}
 
 void posixSocket::send(const vmime::string& buffer)
 {
@@ -166,6 +193,41 @@
 }
 
 
+void posixSocket::throwSocketError(const int err)
+{
+	string msg;
+
+	switch (err)
+	{
+	case EACCES:          msg = "EACCES: permission denied"; break;
+	case EAFNOSUPPORT:    msg = "EAFNOSUPPORT: address family not supported"; break;
+	case EMFILE:          msg = "EMFILE: process file table overflow"; break;
+	case ENFILE:          msg = "ENFILE: system limit reached"; break;
+	case EPROTONOSUPPORT: msg = "EPROTONOSUPPORT: protocol not supported"; break;
+	case EAGAIN:          msg = "EAGAIN: blocking operation"; break;
+	case EBADF:           msg = "EBADF: invalid descriptor"; break;
+	case ECONNRESET:      msg = "ECONNRESET: connection reset by peer"; break;
+	case EFAULT:          msg = "EFAULT: bad user space address"; break;
+	case EINTR:           msg = "EINTR: signal occured before transmission"; break;
+	case EINVAL:          msg = "EINVAL: invalid argument"; break;
+	case EMSGSIZE:        msg = "EMSGSIZE: message cannot be sent atomically"; break;
+	case ENOBUFS:         msg = "ENOBUFS: output queue is full"; break;
+	case ENOMEM:          msg = "ENOMEM: out of memory"; break;
+	case EPIPE:
+	case ENOTCONN:        msg = "ENOTCONN: not connected"; break;
+	case ECONNREFUSED:    msg = "ECONNREFUSED: connection refused"; break;
+	default:
+
+		std::ostringstream oss;
+		oss << ::strerror(err);
+
+		msg = oss.str();
+		break;
+	}
+
+	throw vmime::exceptions::connection_error(msg);
+}
+
 
 
 //
--- libvmime-0.7.1/vmime/platforms/posix/posixSocket.hpp		2007-10-18 11:19:47.000000000 +0200
+++ libvmime-0.7.1/vmime/platforms/posix/posixSocket.hpp.socket-timeout	2007-10-18 10:34:46.000000000 +0200
@@ -49,10 +49,13 @@
 	void send(const vmime::string& buffer);
 	void sendRaw(const char* buffer, const int count);
 
+	void throwSocketError(const int err);
+
 private:
 
 	char m_buffer[65536];
 	int m_desc;
+	int m_timeouts;
 };
 
 

libvmime07-0.7.1-socket-tcp-nodelay.patch:
 posixSocket.cpp |    5 +++++
 1 file changed, 5 insertions(+)

--- NEW FILE libvmime07-0.7.1-socket-tcp-nodelay.patch ---
Patch by Zarafa <http://www.zarafa.com/> - adds the TCP_NODELAY flag to vmime sockets. This should mak
the SMTP connection faster

--- libvmime-0.7.1/src/platforms/posix/posixSocket.cpp			2005-03-18 22:26:49.000000000 +0100
+++ libvmime-0.7.1/src/platforms/posix/posixSocket.cpp.socket-tcp	2009-03-27 10:51:06.405594549 +0100
@@ -25,6 +25,7 @@
 #include <arpa/inet.h>
 #include <sys/types.h>
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <netdb.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -59,6 +60,8 @@
 
 void posixSocket::connect(const vmime::string& address, const vmime::port_t port)
 {
+	int flag = 1;
+
 	// Close current connection, if any
 	if (m_desc != -1)
 	{
@@ -94,6 +97,8 @@
 	if (m_desc == -1)
 		throw vmime::exceptions::connection_error("Error while creating socket.");
 
+	::setsockopt(m_desc, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag));
+
 	// Start connection
 	if (::connect(m_desc, reinterpret_cast <sockaddr*>(&addr), sizeof(addr)) == -1)
 	{

libvmime07-0.7.1-strip-header-endspaces.patch:
 headerField.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

--- NEW FILE libvmime07-0.7.1-strip-header-endspaces.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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.

--- libvmime-0.7.1/src/headerField.cpp					2007-07-31 12:54:21.898679250 +0200
+++ libvmime-0.7.1/src/headerField.cpp.strip-header-endspaces		2007-07-31 12:43:08.408588750 +0200
@@ -189,6 +189,14 @@
 					}
 				}
 
+				// strip spaces from end of header lines, also through continuation headers
+				contentsEnd--;	// original enter
+				while (contentsEnd>contentsStart &&
+					   (buffer[contentsEnd] == ' ' || buffer[contentsEnd] == '\t' ||
+						buffer[contentsEnd] == '\r' || buffer[contentsEnd] == '\n'))
+					contentsEnd--;
+				contentsEnd++;	// new 'enter'
+
 				// Return a new field
 				headerField* field = headerFieldFactory::getInstance()->create(name);
 

libvmime07-0.7.1-threading-remove-static_non-abi-change.patch:
 smartPtr.hpp |    9 +++++++++
 1 file changed, 9 insertions(+)

--- NEW FILE libvmime07-0.7.1-threading-remove-static_non-abi-change.patch ---
Patch by Zarafa <http://www.zarafa.com/> - workaround a static variable in the smart_ptr class using a
pthread mutex, which fixes multi-threading issues in libvmime.

--- libvmime-0.7.1/vmime/utility/smartPtr.hpp				2005-05-19 19:17:17.000000000 +0200
+++ libvmime-0.7.1/vmime/utility/smartPtr.hpp.threading-remove-static	2009-05-13 15:21:53.276875219 +0200
@@ -20,6 +20,9 @@
 #ifndef VMIME_UTILITY_SMARTPTR_HPP_INCLUDED
 #define VMIME_UTILITY_SMARTPTR_HPP_INCLUDED
 
+// non-portable, but at least not an abi change
+#include <pthread.h>
+static pthread_mutex_t mapLock = PTHREAD_MUTEX_INITIALIZER;
 
 namespace vmime {
 namespace utility {
@@ -108,8 +111,10 @@
 		{
 			if (m_data->refCount == 1)
 			{
+				pthread_mutex_lock(&mapLock);
 				typename MapType::iterator it = sm_map.find(m_data->ptr);
 				if (it != sm_map.end()) sm_map.erase(it);
+				pthread_mutex_unlock(&mapLock);
 
 				delete (m_data->ptr);
 				delete (m_data);
@@ -127,6 +132,8 @@
 	{
 		detach();
 
+		pthread_mutex_lock(&mapLock);
+
 		typename MapType::iterator it = sm_map.find(p);
 
 		if (it != sm_map.end())
@@ -141,6 +148,8 @@
 
 			sm_map.insert(typename MapType::value_type(p, m_data));
 		}
+
+		pthread_mutex_unlock(&mapLock);
 	}
 
 	void attach(const smart_ptr <T>& p)

libvmime07-0.7.1-timezone-name.patch:
 dateTime.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- NEW FILE libvmime07-0.7.1-timezone-name.patch ---
Patch by Zarafa <http://www.zarafa.com/> - fixes dates in headers which use a timezone definition, instead
of a numeric timezone offset.

--- libvmime-0.7.1/src/dateTime.cpp					2005-04-23 11:02:48.000000000 +0200
+++ libvmime-0.7.1/src/dateTime.cpp.timezone-name			2009-01-08 10:51:39.000000000 +0100
@@ -423,7 +423,7 @@
 				zone[zoneLength++] = *p;
 				++p;
 			}
-			while (zoneLength < 3 && p < pend && parserHelpers::isDigit(*p));
+			while (zoneLength < 3 && p < pend);
 
 			switch (zone[0])
 			{
@@ -487,6 +487,8 @@
 
 				break;
 			}
+			case 'g':
+			case 'G':
 			case 'u':
 			case 'U':
 			{

libvmime07-0.7.1-unicode-1-1-utf-7-charset.patch:
 charset.cpp |    7 +++++++
 1 file changed, 7 insertions(+)

--- NEW FILE libvmime07-0.7.1-unicode-1-1-utf-7-charset.patch ---
Patch by Zarafa <http://www.zarafa.com/> - 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 <http://www.faqs.org/rfcs/rfc1642.html>.

--- libvmime-0.7.1/src/charset.cpp					2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1/src/charset.cpp.unicode-1-1-utf-7-charset		2007-04-23 17:08:46.714435000 +0200
@@ -64,6 +64,9 @@
 charset::charset(const string& name)
 	: m_name(name)
 {
+	// if we receive this rfc-1642 valid MIME charset, convert it to something usefull for iconv
+	if (utility::stringUtils::isStringEqualNoCase(m_name, "unicode-1-1-utf-7"))
+		m_name = "utf-7";
 }
 
 
@@ -72,6 +75,10 @@
 {
 	m_name = string(buffer.begin() + position, buffer.begin() + end);
 
+	// if we parsed this rfc-1642 valid MIME charset, convert it to something usefull for iconv
+	if (utility::stringUtils::isStringEqualNoCase(m_name, "unicode-1-1-utf-7"))
+		m_name = "utf-7";
+
 	setParsedBounds(position, end);
 
 	if (newPosition)


--- NEW FILE libvmime07.spec ---
Summary:	A powerful C++ class library for working with MIME/Internet messages
Name:		libvmime07
Version:	0.7.1
Release:	1%{?dist}
License:	GPLv2+
Group:		System Environment/Libraries
URL:		http://www.zarafa.com/wiki/index.php/Libvmime_patches
Source0:	http://developer.zarafa.com/download/libvmime-%{version}.tar.bz2
Patch0:		libvmime07-0.7.1-package.patch
Patch1:		libvmime07-0.7.1-charset-catch.patch
Patch2:		libvmime07-0.7.1-missing-boundary.patch
Patch3:		libvmime07-0.7.1-allow-no-recips-and-senders.patch
Patch4:		libvmime07-0.7.1-bmoted-printable.patch
Patch5:		libvmime07-0.7.1-strip-header-endspaces.patch
Patch6:		libvmime07-0.7.1-attachfnamelen.patch
Patch7:		libvmime07-0.7.1-remove-bcc.patch
Patch8:		libvmime07-0.7.1-mdn-disposition.patch
Patch9:		libvmime07-0.7.1-mdn-final-recipient.patch
Patch10:	libvmime07-0.7.1-broken-locale-error.patch
Patch11:	libvmime07-0.7.1-qp-starts-on-second-line.patch
Patch12:	libvmime07-0.7.1-quoted-printable-specials.patch
Patch13:	libvmime07-0.7.1-header-value-on-next-line.patch
Patch14:	libvmime07-0.7.1-oe-compatibility.patch
Patch15:	libvmime07-0.7.1-unicode-1-1-utf-7-charset.patch
Patch16:	libvmime07-0.7.1-out-of-bounds-copy.patch
Patch17:	libvmime07-0.7.1-default-transfer-encoding.patch
Patch18:	libvmime07-0.7.1-contentid-without-at.patch
Patch19:	libvmime07-0.7.1-socket-backport-and-timeout-fix.patch
Patch20:	libvmime07-0.7.1-double-empty-boundary.patch
Patch21:	libvmime07-0.7.1-quoted-printable-encode-questionmark.patch
Patch22:	libvmime07-0.7.1-charset-output-buffer-full.patch
Patch23:	libvmime07-0.7.1-gcc-4.3-support.patch
Patch24:	libvmime07-0.7.1-timezone-name.patch
Patch25:	libvmime07-0.7.1-socket-tcp-nodelay.patch
Patch26:	libvmime07-0.7.1-threading-remove-static_non-abi-change.patch
Patch27:	libvmime07-0.7.1-gcc-4.4-support.patch
Patch28:	libvmime07-0.7.1-plain-bodycopy.patch
BuildRequires:	sendmail, libtool, autoconf, automake
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
VMime is a powerful C++ class library for parsing, generating or
editing Internet RFC-[2]822 and MIME messages. VMime is designed
to provide a fast and an easy way to manipulate Internet mail
messages.

It also includes support for using messaging protocols (POP3, IMAP,
SMTP and maildir) with a lot of features supported: listing folders,
downloading and adding messages to folders, extracting parts from
message, getting and setting message flags and a lot more.

This package contains an old and deprecated version of libvmime.
You need it only if the software you are using hasn't been updated
to work with the newer version and the newer API.

%package devel
Summary:	Development files for the libvmime library
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}, pkgconfig

%description devel
The libvmime package includes header files and libraries necessary
for developing programs which use the libvmime C++ class library.

This package contains an old and deprecated version of libvmime.
You need it only if the software you are using hasn't been updated
to work with the newer version and the newer API.

%prep
%setup -q -n libvmime-%{version}
%patch0 -p1 -b .package
%patch1 -p1 -b .charset-catch
%patch2 -p1 -b .missing-boundary
%patch3 -p1 -b .allow-no-recips-and-senders
%patch4 -p1 -b .bmoted-printable
%patch5 -p1 -b .strip-header-endspaces
%patch6 -p1 -b .attachfnamelen
%patch7 -p1 -b .remove-bcc
%patch8 -p1 -b .mdn-disposition
%patch9 -p1 -b .mdn-final-recipient
%patch10 -p1 -b .broken-locale-error
%patch11 -p1 -b .qp-starts-on-second-line
%patch12 -p1 -b .quoted-printable-specials
%patch13 -p1 -b .header-value-on-next-line
%patch14 -p1 -b .oe-compatibility
%patch15 -p1 -b .unicode-1-1-utf-7-charset
%patch16 -p1 -b .out-of-bounds-copy
%patch17 -p1 -b .default-transfer-encoding
%patch18 -p1 -b .contentid-without-at
%patch19 -p1 -b .socket-backport-and-timeout-fix
%patch20 -p1 -b .double-empty-boundary
%patch21 -p1 -b .quoted-printable-encode-questionmark
%patch22 -p1 -b .charset-output-buffer-full
%patch23 -p1 -b .gcc-4.3-support
%patch24 -p1 -b .timezone-name
%patch25 -p1 -b .socket-tcp-nodelay
%patch26 -p1 -b .threading-remove-static_non-abi-change
%patch27 -p1 -b .gcc-4.4-support
%patch28 -p1 -b .plain-bodycopy

# Needed to apply branding patch
libtoolize --force
autoreconf --force --install

%build
export EXTRA_CFLAGS="$RPM_OPT_FLAGS"
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# Complete the libvmime07 renaming at some places
mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}/
mv -f $RPM_BUILD_ROOT%{_includedir}/{vmime,%{name}}/
mv -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/vmime{,07}.pc 

# Remove the static library and libtool .la file
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.{a,la}

# Remove the documentation dir, as %doc will pick it up
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog
%{_libdir}/%{name}.so.*

%files devel
%defattr(-,root,root,-)
%{_libdir}/%{name}.so
%{_includedir}/%{name}/
%{_libdir}/pkgconfig/vmime07.pc

%changelog
* Sat Sep 05 2009 Robert Scheck <robert at fedoraproject.org> 0.7.1-1
- Upgrade to 0.7.1
- Initial spec file for Fedora and Red Hat Enterprise Linux


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/libvmime07/F-11/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	16 Sep 2009 21:17:43 -0000	1.1
+++ .cvsignore	16 Sep 2009 21:50:31 -0000	1.2
@@ -0,0 +1 @@
+libvmime-0.7.1.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libvmime07/F-11/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	16 Sep 2009 21:17:43 -0000	1.1
+++ sources	16 Sep 2009 21:50:32 -0000	1.2
@@ -0,0 +1 @@
+81f06a771d2de01d5982635838eb5f6a  libvmime-0.7.1.tar.bz2




More information about the scm-commits mailing list