From 1434231b9d0a7e154b1230de97e8ce3848212bcf Mon Sep 17 00:00:00 2001
From: Vincent Bernat <bernat@luffy.cx>
Date: Fri, 7 Mar 2008 10:10:10 +0000
Subject: [PATCH] Fix problem with sending mail

---
 debian/changelog                               |  6 ++++++
 debian/patches/fix-too-old-php-mail-mime.patch | 15 +++++++++++++++
 debian/patches/series                          |  1 +
 3 files changed, 22 insertions(+)
 create mode 100644 debian/patches/fix-too-old-php-mail-mime.patch

diff --git a/debian/changelog b/debian/changelog
index 5a37d0e..1946902 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+roundcube (0.1-3) unstable; urgency=low
+
+  * Fix problem with too old php-mail-mime package (Closes: #469814)
+
+ -- Vincent Bernat <bernat@luffy.cx>  Fri, 07 Mar 2008 11:06:49 +0100
+
 roundcube (0.1-2) unstable; urgency=low
 
   * Ship bin/ directory as well. This fix conversion from HTML to text in
diff --git a/debian/patches/fix-too-old-php-mail-mime.patch b/debian/patches/fix-too-old-php-mail-mime.patch
new file mode 100644
index 0000000..d1af6b6
--- /dev/null
+++ b/debian/patches/fix-too-old-php-mail-mime.patch
@@ -0,0 +1,15 @@
+--- roundcube/program/steps/mail/sendmail.inc	2008-03-07 09:52:40.000000000 +0100
++++ roundcube/program/steps/mail/sendmail.inc.new	2008-03-07 11:04:33.000000000 +0100
+@@ -351,7 +351,11 @@
+   
+   // append message to sent box
+   if ($store_folder)
+-    $saved = $IMAP->save_message($CONFIG[$store_target], $MAIL_MIME->getMessage());
++    {
++    $header_str = $MAIL_MIME->txtHeaders($headers);
++    $msg_body = $header_str."\r\n".$MAIL_MIME->get($message_param);
++    $saved = $IMAP->save_message($CONFIG[$store_target], $msg_body);
++    }
+ 
+   // raise error if saving failed
+   if (!$saved)
diff --git a/debian/patches/series b/debian/patches/series
index c1aeafd..e679d9a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ use_packaged_tinymce.patch
 use-db-backend.patch
 correct-magic-path.patch
 disable-tinymce-spellchecker.patch
+fix-too-old-php-mail-mime.patch
-- 
2.39.5