From f09b169e5151e377280e843804fb934e725268db Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 31 Jul 2013 11:10:40 +0200 Subject: Support special Return-Path form used on some (PEAR) mailing list (#1489241) --- program/steps/mail/func.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index a41e3ffeb..cf3a791d8 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1783,8 +1783,14 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r // Try Return-Path if ($from_idx === null && ($return_path = $MESSAGE->headers->others['return-path'])) { foreach ($identities as $idx => $ident) { + // Return-Path header contains an email address, but on some mailing list + // it can be e.g. + // where local@domain.tld is the address we're looking for (#1489241) + $ident1 = $ident['email_ascii']; + $ident2 = str_replace('@', '=', $ident1); + foreach ((array)$return_path as $path) { - if (stripos($path, $ident['email_ascii']) !== false) { + if (stripos($path, $ident1) !== false || stripos($path, $ident2)) { $from_idx = $idx; break 2; } -- cgit v1.2.3