PMCORE-1159 SpoolRunTest: Solve the incomplete test

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-02-18 12:03:40 -04:00
parent 8851292713
commit 5a046c8d53
3 changed files with 0 additions and 99 deletions

View File

@@ -674,42 +674,6 @@ class SpoolRun
$this->updateSpoolError($error->getMessage());
}
break;
case 'OPENMAIL':
$pack = new package($this->fileData);
$header = $pack->returnHeader();
$body = $pack->returnBody();
$send = new smtp();
$send->setServer($this->config['MESS_SERVER']);
$send->setPort($this->config['MESS_PORT']);
$send->setUsername($this->config['MESS_ACCOUNT']);
$passwd = $this->config['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
$passwd = $auxPass[1];
} else {
array_shift($auxPass);
$passwd = implode('', $auxPass);
}
}
$this->config['MESS_PASSWORD'] = $passwd;
$send->setPassword($this->config['MESS_PASSWORD']);
$send->setReturnPath($this->fileData['from_email']);
$send->setHeaders($header);
$send->setBody($body);
$send->setEnvelopeTo($this->fileData['envelope_to']);
if ($send->sendMessage()) {
$this->error = '';
$this->status = 'sent';
} else {
$this->error = implode(', ', $send->returnErrors());
$this->status = 'failed';
}
break;
}
}
}