Mail no longer working after upgrading to 1.5.9

Hi,

after upgrading to 1.5.9 the mailing system is no longer working. I can create invoices and download them but sending via mail does not work. After a while the system returns that the application obviously hung up.

No matter if I change from SMTP to PHPMailer.

The debug log shows no errors:

DEBUG - 2018-07-08 18:05:44 --> UTF-8 Support Enabled
DEBUG - 2018-07-08 18:05:44 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2018-07-08 18:05:44 --> Invoices MX_Controller Initialized
DEBUG - 2018-07-08 18:05:44 --> Config file loaded: /var/www/html/intranet/ip/application/config/invoice_plane.php
DEBUG - 2018-07-08 18:05:44 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/settings/models/Mdl_settings.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/settings/models/Mdl_versions.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2018-07-08 18:05:44 --> Layout MX_Controller Initialized
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_items.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/payments/models/Mdl_payments.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2018-07-08 18:05:44 --> File loaded: /var/www/html/intranet/ip/application/views/invoice_templates/pdf/InvoicePlane.php
DEBUG - 2018-07-08 18:05:45 --> Total execution time: 0.5469
DEBUG - 2018-07-08 18:05:54 --> UTF-8 Support Enabled
DEBUG - 2018-07-08 18:05:54 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2018-07-08 18:05:54 --> Invoices MX_Controller Initialized
DEBUG - 2018-07-08 18:05:54 --> Config file loaded: /var/www/html/intranet/ip/application/config/invoice_plane.php
DEBUG - 2018-07-08 18:05:54 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/settings/models/Mdl_settings.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/settings/models/Mdl_versions.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2018-07-08 18:05:54 --> Layout MX_Controller Initialized
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_items.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/payments/models/Mdl_payments.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2018-07-08 18:05:54 --> File loaded: /var/www/html/intranet/ip/application/views/invoice_templates/pdf/InvoicePlane.php
DEBUG - 2018-07-08 18:05:54 --> Total execution time: 0.4039

It’s not a production down issue as I can download the PDF and send it manually. But I guess this is not working as intended.

Regards
Michael

Could you take a look at the general error logs of the web server and the mail logs? Maybe we can find something there.

Hello Kovah,

thank you for your feedback. Already done. Nothing suspicious.

In apaches access.log
127.0.0.1 - - [12/Jul/2018:20:54:05 +0200] "GET /intranet/ip/index.php/upload/upload_file/1/ptOmZDWPrMUhQbdV25X0BANR6cFGovzg HTTP/1.1" 200 688 "https://blah.foo.bar/intranet/ip/index.php/mailer/invoice/23" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"

error.log and php logs nothing.

Any extended debug logging for the mailer possible?

This totally depends an your mail server. Please search on the web for more information.

Well, wireshark shows that there is no outgoing connection on the SMTP port. So I am assuming that the problem is in the PHP code and not on the mailserver side. I ment “debug logging for the mailer” the php code for mailing.

And: In the previous version it worked.

However, so I am going to reinstall invoice plane and recover the database afterwards. Maybe that helps.

Okay, let me know if that works

If you can change the code, set the debug level on PHPMailer

In the file :
application/modules/mailer/helpers/phpmailer_helper.php

function phpmail_send(
    $from,
    $to,
    $subject,
    $message,
                 ...
                ...
    // Create the basic mailer object
    $mail = new \PHPMailer\PHPMailer\PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->isHTML();
    
    $mail->SMTPDebug = 2;    // or 3 or 4
2 Likes