Author Topic: 1.5 final: Mail server always returns a mail failure notice "unknown recipient"  (Read 2608 times)

zensursula

  • Newbie
  • *
  • Posts: 9
    • View Profile
I added a patch to solve the following problem:
I can successfully send a mail with new opengoo release 1.5 final. But opengoo always adds an empty entry for CC: and BCC and sometimes for TO (depending on the ',') to the swift mail module. Swift tries to send the mail to the empty  recipients. Some Mailserver does not handle such mails and return one or more failure notices.
The attached patch only adds contacts to the swift mail module, if they are not empty.


ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Thanks.

Karlos

  • Newbie
  • *
  • Posts: 45
    • View Profile
Please i have the same issue in my 1.5.2 installation , if i send mail with "bcc" and "cc" in blank and the smtp server not send this mail.


Please how install the patch? itīs correct for 1.5.2 version? , iīm not php coder , unable to locate the correct position of code im the file "mailutilities.class.php"

Thanks in advance.

Carlos.

alvarotm01

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
    • Email
to apply the patch you must replace lines 369 - 372 of /environment/classes/mail/MailUtilities.class.php
Code: [Select]
$cc = trim($cc, " ,");
$bcc = trim($bcc, " ,");
if ($cc != '') $mailer->addCc(explode(",", $cc));
if ($bcc != '') $mailer->addBcc(explode(",", $bcc));
for these ones:
Code: [Select]
$ccArr = explode(",", $cc);
foreach ($ccArr as $k => $v) {
if (trim($v) == '') unset($ccArr[$k]);
}
if(count($ccArr)>0) $mailer->addCc($ccArr);
$bccArr = explode(",", $bcc);
foreach ($bccArr as $k => $v) {
if (trim($v) == '') unset($bccArr[$k]);
}
if(count($bccArr)>0) $mailer->addBcc($bccArr);

Karlos

  • Newbie
  • *
  • Posts: 45
    • View Profile
Ok, thanks a lot for your quick reply ,

I test this patch.

BCC works well
CC donīt work , we must add a email

GRACIAS !!
« Last Edit: August 28, 2009, 06:06:09 AM by Karlos »

Karlos

  • Newbie
  • *
  • Posts: 45
    • View Profile
UPDATE:

Version 1.5.3 running whitout this error  :)

 

anything