alecpl
2010-03-12 b579f42b550a5c3f3bf11a0cee13149d67c1bcd8
- fixes for proper handling of email addresses with form: "user"@domain.tld


3 files modified
12 ■■■■■ changed files
program/include/rcube_imap.php 8 ●●●● patch | view | raw | blame | history
program/include/rcube_smtp.php 4 ●●● patch | view | raw | blame | history
program/steps/mail/func.inc patch | view | raw | blame | history
program/include/rcube_imap.php
@@ -2675,8 +2675,12 @@
    foreach ($a as $val)
      {
      $j++;
      $address = $val['address'];
      $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name']));
      $address = trim($val['address']);
      $name = trim($val['name']);
      if (preg_match('/^[\'"]/', $name) && preg_match('/[\'"]$/', $name))
        $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', $name);
      if ($name && $address && $name != $address)
        $string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address);
      else if ($address)
program/include/rcube_smtp.php
@@ -399,7 +399,7 @@
      $a = explode(" ", $recipient);
      while (list($k2, $word) = each($a))
      {
        if ((strpos($word, "@") > 0) && (strpos($word, "\"")===false))
        if (strpos($word, "@") > 0 && $word[strlen($word)-1] != '"')
        {
          $word = preg_replace('/^<|>$/', '', trim($word));
          if (in_array($word, $addresses)===false)
@@ -411,5 +411,3 @@
  }
}
?>
program/steps/mail/func.inc