From 51f55bd6d2f5cbc4f9c92dd3340b5d1397cec89a Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 13 Sep 2008 13:26:34 +0000 Subject: #1485337: fill recipient on reply to address of yourself (if there's only one address found in message) --- program/steps/mail/compose.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'program/steps') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 0a5226e66..f32637abe 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -209,9 +209,14 @@ function rcmail_compose_headers($attrib) { $to_addresses = $IMAP->decode_address_list($fvalue); $fvalue = ''; + foreach ($to_addresses as $addr_part) { - if (!empty($addr_part['mailto']) && !in_array($addr_part['mailto'], $sa_recipients) && (!$MESSAGE->compose_from || !in_array($addr_part['mailto'], $MESSAGE->compose_from))) + if (!empty($addr_part['mailto']) + && !in_array($addr_part['mailto'], $sa_recipients) + && (!$MESSAGE->compose_from + || !in_array($addr_part['mailto'], $MESSAGE->compose_from) + || count($to_addresses)==1)) // allow reply to yourself { $fvalue .= (strlen($fvalue) ? ', ':'').$addr_part['string']; $sa_recipients[] = $addr_part['mailto']; -- cgit v1.2.3