Hallo zusammen,
bei einem Kundenprojekt (Contao 3.2 LTS) verwende ich das interne Newslettermodul von Contao. Hinterlegt ist ein eigener SMTP-Server.
Das klappt soweit auch gut, Mails werden nach der Reihenfolge verschickt, bis etwas mit der E-Mail Adresse eines Empfängers was nicht stimmt!
z.B.: der Empfänger hat ein volles Postfach, das Mail kommt nicht an, es wird ein Fehler zurückgegeben --> Problem Contao schreibt einen Fehler aus und bricht den Versand des Newsletter komplett ab, was meiner Meinung nach nicht ideal ist.
Code:
[23-Jun-2015 15:31:38 UTC] PHP Fatal error: Uncaught exception 'Swift_TransportException' with message 'Expected response code 250 but got code "552", with message "552 Mail rejected by the processing module: Requested mail action aborted: exceeded storage allocation Mail size limit exceeded. For explanation visit http://postmaster.gmx.com/en/error-messages?ip=91.205.172.99&c=quot
"' thrown in /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php on line 386
#0 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php(281): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('552 Mail reject...', Array)
#1 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/EsmtpTransport.php(245): Swift_Transport_AbstractSmtpTransport->executeCommand('??.??', Array, Array)
#2 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php(335): Swift_Transport_EsmtpTransport->executeCommand('??.??', Array)
#3 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php(428): Swift_Transport_AbstractSmtpTransport->_streamMessage(Object(Swift_Message))
#4 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php(444): Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'newsletter@golf...', Array, Array)
#5 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php(176): Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'newsletter@golf...', Array, Array)
#6 /var/www/customers/5146102215/1300282-2/system/modules/core/vendor/swiftmailer/classes/Swift/Mailer.php(86): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#7 /var/www/customers/5146102215/1300282-2/system/modules/core/library/Contao/Email.php(517): Swift_Mailer->send(Object(Swift_Message), Array)
#8 /var/www/customers/5146102215/1300282-2/system/modules/newsletter/classes/Newsletter.php(394): Contao\Email->sendTo('verawulz@gmx.at')
#9 /var/www/customers/5146102215/1300282-2/system/modules/newsletter/classes/Newsletter.php(176): Contao\Newsletter->sendNewsletter(Object(Contao\Email), Object(Contao\Database\Mysqli\Result), Array, '', '<p><span style=...')
#10 /var/www/customers/5146102215/1300282-2/system/modules/core/classes/Backend.php(279): Contao\Newsletter->send(Object(Contao\DC_Table))
#11 /var/www/customers/5146102215/1300282-2/contao/main.php(136): Contao\Backend->getBackendModule('newsletter')
#12 /var/www/customers/5146102215/1300282-2/contao/main.php(287): Main->run()
#13 {main}
Ich habe mich ein wenig schlau gemacht und würde den Code in der AbstractSmtpTransport.php (Zeile 261-284) einfach deaktivieren. Macht das Sinn oder gibt es da vlt, eine bessere Lösung? Wichtig ist mir, dass die restlichen Newsletter auch nach einem Fehler fertigverschickt werden.
PHP-Code:
/**
* Run a command against the buffer, expecting the given response codes.
*
* If no response codes are given, the response will not be validated.
* If codes are given, an exception will be thrown on an invalid response.
*
* @param string $command
* @param int[] $codes
* @param string[] $failures An array of failures by-reference
*
* @return string
*/
public function executeCommand($command, $codes = array(), &$failures = null)
{
$failures = (array) $failures;
$seq = $this->_buffer->write($command);
$response = $this->_getFullResponse($seq);
if ($evt = $this->_eventDispatcher->createCommandEvent($this, $command, $codes)) {
$this->_eventDispatcher->dispatchEvent($evt, 'commandSent');
}
$this->_assertResponseCode($response, $codes);
return $response;
}
danke & lg
andi
Lesezeichen