I've spent the better part of the day looking for a solution to a very annoying problem. If your OpenCart installation is configured to use an SMTP email server you've likely run into this too. Please note: disabling SMTP and using mail is not an option for me...
Server Details:
OpenCart Version 1.5.6.4
PHP 5.5.9-1ubuntu4.14
Apache/2.4.7 (Ubuntu)
SMTP Provider: MailGun
The Issue:
OpenCart attempts to send an order confirmation email via SMTP. If anything goes wrong during that process the order will hang and the user never gets to the success page. Furthermore you'll likely see duplicate orders because the user ends up clicking submit over and over not knowing that each order was actually successful.
This has been a really tricky one to troubleshoot because 99% of my orders go through without issue. I assume its the result of an SMTP connection lagging or failing but I can't be 100% sure. Each time it happens the error log shows the following entry:
Code: Select all
Error: Password not accepted from server! - in checkout/system/library/mail.php
(1) /checkout/catalog/model/checkout/order.php
(2) /checkout/system/library/mail.php
From what I've gathered order.php (1) is running the Confirm function which loads the mail class to send over the confirmation email. The mail class is expecting a 235 response code but doesn't get one for whatever reason and thus everything falls apart. See code below:
Code: Select all
if (substr($reply, 0, 3) != 235) {
trigger_error('Error: Password not accepted from server!');
exit();
}