summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 1b9d387f6..25eb0596e 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -176,7 +176,11 @@ function rcmail_email_input_format($mailto, $count=false, $check=true)
// address with name (handle name)
} else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) {
$address = $matches[0];
- $name = trim(str_replace($address, '', $item), '" ');
+ $name = trim(str_replace($address, '', $item));
+ if ($name[0] == '"' && $name[count($name)-1] == '"') {
+ $name = substr($name, 1, -1);
+ }
+ $name = stripcslashes($name);
$address = rcube_idn_to_ascii(trim($address, '<>'));
$result[] = format_email_recipient($address, $name);
$item = $address;