From 6d1337e1df0e18ac03ac9bf7d5b9a79e2f6b0e6f Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 06 May 2016 03:03:07 -0400
Subject: [PATCH] Fix regression where setting Answered/Forwarded flag didn't work when sending an email

---
 program/steps/mail/sendmail.inc |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 68c444e..4c6dfaf 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -191,7 +191,7 @@
 // remember reply/forward UIDs in special headers
 if ($savedraft) {
     // Note: We ignore <UID>.<PART> forwards/replies here
-    if (($uid = $COMPOSE['reply_uid']) && !preg_match('/^\d+[0-9.]+$/', $uid)) {
+    if (($uid = $COMPOSE['reply_uid']) && !preg_match('/^\d+\.[0-9.]+$/', $uid)) {
         $headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $uid);
     }
     else if (!empty($COMPOSE['forward_uid'])
@@ -557,7 +557,7 @@
     if ($COMPOSE['reply_uid']) {
         foreach (rcmail::get_uids($COMPOSE['reply_uid'], $COMPOSE['mailbox']) as $mbox => $uids) {
             // skip <UID>.<PART> replies
-            if (!preg_match('/^\d+[0-9.]+$/', implode(',', (array) $uids))) {
+            if (!preg_match('/^\d+\.[0-9.]+$/', implode(',', (array) $uids))) {
                 $RCMAIL->storage->set_flag($uids, 'ANSWERED', $mbox);
             }
         }
@@ -565,7 +565,7 @@
     else if ($COMPOSE['forward_uid']) {
         foreach (rcmail::get_uids($COMPOSE['forward_uid'], $COMPOSE['mailbox']) as $mbox => $uids) {
             // skip <UID>.<PART> forwards
-            if (!preg_match('/^\d+[0-9.]+$/', implode(',', (array) $uids))) {
+            if (!preg_match('/^\d+\.[0-9.]+$/', implode(',', (array) $uids))) {
                 $RCMAIL->storage->set_flag($uids, 'FORWARDED', $mbox);
             }
         }

--
Gitblit v1.9.1