Browse Source

Fix handling of custom From addresses with names (#8106)

pull/8115/head
Aleksander Machniak 4 years ago
parent
commit
600a1e29ff
  1. 1
      CHANGELOG
  2. 19
      program/include/rcmail_sendmail.php

1
CHANGELOG

@ -7,6 +7,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where consecutive LDAP searches could return wrong results (#8064)
- Fix bug where plus characters in attachment filename could have been ignored (#8074)
- Fix displaying HTML body with inline images encapsulated using TNEF format (winmail.dat)
- Fix handling of custom sender addresses with names (#8106)
RELEASE 1.4.11
--------------

19
program/include/rcmail_sendmail.php

@ -136,15 +136,18 @@ class rcmail_sendmail
$from = null;
}
}
// ... if there is no identity record, this might be a custom from
else if (($from_string = $this->email_input_format($from))
&& preg_match('/(\S+@\S+)/', $from_string, $m)
) {
$from = trim($m[1], '<>');
}
// ... otherwise it's empty or invalid
else {
$from = null;
// ... if there is no identity record, this might be a custom from
$from_addresses = rcube_mime::decode_address_list($from);
if (count($from_addresses) == 1) {
$from = $from_addresses[1]['mailto'];
$from_string = $from_addresses[1]['string'];
}
// ... otherwise it's empty or invalid
else {
$from = null;
}
}
// check 'From' address (identity may be incomplete)

Loading…
Cancel
Save