}
/* Ok, who is sending the message? */
- $fromaddress = ($from->mailbox && $from->host) ?
+ $fromaddress = (strlen($from->mailbox) && $from->host) ?
$from->mailbox.'@'.$from->host : '';
fputs($stream, 'MAIL FROM:<'.$fromaddress.">\r\n");
$tmp = fgets($stream, 1024);
/* send who the recipients are */
for ($i = 0, $cnt = count($to); $i < $cnt; $i++) {
if (!$to[$i]->host) $to[$i]->host = $domain;
- if ($to[$i]->mailbox) {
+ if (strlen($to[$i]->mailbox)) {
fputs($stream, 'RCPT TO:<'.$to[$i]->mailbox.'@'.$to[$i]->host.">\r\n");
$tmp = fgets($stream, 1024);
if ($this->errorCheck($tmp, $stream)) {
for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) {
if (!$cc[$i]->host) $cc[$i]->host = $domain;
- if ($cc[$i]->mailbox) {
+ if (strlen($cc[$i]->mailbox)) {
fputs($stream, 'RCPT TO:<'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n");
$tmp = fgets($stream, 1024);
if ($this->errorCheck($tmp, $stream)) {
for ($i = 0, $cnt = count($bcc); $i < $cnt; $i++) {
if (!$bcc[$i]->host) $bcc[$i]->host = $domain;
- if ($bcc[$i]->mailbox) {
+ if (strlen($bcc[$i]->mailbox)) {
fputs($stream, 'RCPT TO:<'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host.">\r\n");
$tmp = fgets($stream, 1024);
if ($this->errorCheck($tmp, $stream)) {
if ($sGroup) {
$aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup);
$oAddr = end($aAddress);
- if(!$oAddr || ((isset($oAddr)) && !$oAddr->mailbox && !$oAddr->personal)) {
+ if(!$oAddr || ((isset($oAddr)) && !strlen($oAddr->mailbox) && !$oAddr->personal)) {
$sEmail = $sGroup . ':;';
}
$aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup);
}
}
}
- if (!$grouplookup && !$oAddr->mailbox) {
+ if (!$grouplookup && !strlen($oAddr->mailbox)) {
$oAddr->mailbox = trim($sEmail);
- if ($sHost && $oAddr->mailbox) {
+ if ($sHost && strlen($oAddr->mailbox)) {
$oAddr->host = $sHost;
}
} else if (!$grouplookup && !$oAddr->host) {
- if ($sHost && $oAddr->mailbox) {
+ if ($sHost && strlen($oAddr->mailbox)) {
$oAddr->host = $sHost;
}
}
}
- if (!$aAddrBookAddress && $oAddr->mailbox) {
+ if (!$aAddrBookAddress && strlen($oAddr->mailbox)) {
$aProcessedAddress[] = $oAddr;
} else {
$aProcessedAddress = array_merge($aProcessedAddress,$aAddrBookAddress);