View Issue Details

IDProjectCategoryView StatusLast Update
0025566mantisbtemailpublic2019-10-14 03:40
Reportervboctor Assigned Todregad  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version2.19.0 
Target Version2.19.1Fixed in Version2.19.1 
Summary0025566: PHPMailer regressions
Description

As part of moving to PHP 6.x, the following issues were introduced:

  1. PHPMailer::ValidateAddress() seems to be replaced by PHPMailer::validateAddress().
  2. catch ( phpmailerException $e ) { seems to be replaced by catch ( Exception $e ) { # PHPMailer Exception - two occurences
  3. StartTLS fails when config is set to use TLS.

@dregad are the latest PHPMailer releases working for you?

TagsNo tags attached.

Relationships

related to 0025436 closeddregad Bump phpmailer/phpmailer from 6.0.6 to 6.0.7 
related to 0024990 closeddregad Update PHPMailer to 6.0.6 
related to 0025582 assignedvboctor PHPMailer times out when sending emails 

Activities

vboctor

vboctor

2019-03-05 00:48

manager   ~0061622

We should target any fixes for this to master-2.19 branch and merge into master before releasing 2.20.0.

vboctor

vboctor

2019-03-05 00:53

manager   ~0061623

Here is the snippet from the error log:

[Tue Mar 05 04:19:24.628039 2019] [:error] [pid 28020] [client 172.31.47.148:37510] 
PHP Fatal error:  Uncaught PHPMailer\\PHPMailer\\Exception: SMTP Error: Could not connect to SMTP host. in /.../www/vendor/phpmailer/phpmailer/src/PHPMailer.php:1947
Stack trace:
#0 /.../www/vendor/phpmailer/phpmailer/src/PHPMailer.php(1774): PHPMailer\\PHPMailer\\PHPMailer->smtpConnect(Array)
0000001 /.../www/vendor/phpmailer/phpmailer/src/PHPMailer.php(1516): PHPMailer\\PHPMailer\\PHPMailer->smtpSend('Date: Tue, 5 Ma...', 'The following i...')
0000002 /.../www/vendor/phpmailer/phpmailer/src/PHPMailer.php(1352): PHPMailer\\PHPMailer\\PHPMailer->postSend()
0000003 /.../www/core/email_api.php(1395): PHPMailer\\PHPMailer\\PHPMailer->send()
0000004 /.../www/core/email_api.php(1220): email_send(Object(EmailData))
0000005 /data/srv/instances/dba740bb-1a25-40a2 in /.../www/vendor/phpmailer/phpmailer/src/PHPMailer.php on line 1947, referer: https://mantis/bug_report_page.php
vboctor

vboctor

2019-03-05 00:55

manager   ~0061624

I haven't proven that TLS is the cause of the 3rd issue.

vboctor

vboctor

2019-03-05 00:56

manager   ~0061625

Here are the PHPMailer 6 upgrade guide:
https://github.com/PHPMailer/PHPMailer/blob/master/UPGRADING.md

dregad

dregad

2019-03-05 04:21

developer   ~0061626

are the latest PHPMailer releases working for you?

I have not experienced any issues on my end since I started testing PHPMailer 6 about one year ago. This code has been running on our tracker since November 2018, and I have not noticed any problems there either (I'm receiving notifications every day).

PHPMailer::ValidateAddress() seems to be replaced by PHPMailer::validateAddress().

I know, but this is not an issue as PHP Function names are case-insensitive so I didn't think it was worth the effort to adapt the code to the new camelCase naming. I can do it if you want.

catch ( phpmailerException $e ) { seems to be replaced by catch ( Exception $e ) { # PHPMailer Exception - two occurences

I missed those during migration, will fix.

StartTLS fails when config is set to use TLS.

I don't have a config to test this. Can you provide more information / steps to reproduce ?

dregad

dregad

2019-03-05 10:35

developer   ~0061628

Sorry I pushed to the wrong remote and source integration picked the commits up and marked the issue as fixed.

See PR https://github.com/mantisbt/mantisbt/pull/1475 (does not include fix for TLS issue)

dregad

dregad

2019-03-07 12:17

developer   ~0061646

1 & 2 are fixed.

Please open a separate issue for 3 with additional details if your TLS issue comes up again.

vboctor

vboctor

2019-03-09 00:21

manager   ~0061654

@dregad It turns out the issue is not related to TLS. But I opened bug 0025582 and opened a corresponding bug in PHPMailer with the fix I found. However, I expect the PHPMailer team to find a better fix.

Related Changesets

MantisBT: master-2.19 ab2353cd

2019-03-05 01:58

dregad


Details Diff
Use new namespaced PHPMailer exception

Define alias for PHPMailer\Exception as phpmailerException, matching
previous usage in the code.

Fixes 0025566
Affected Issues
0025566
mod - core/email_api.php Diff File

MantisBT: master-2.19 14c8334f

2019-03-05 02:02

dregad


Details Diff
Adjust case of PHPMailer method names

In PHPMailer 6, functions have been renamed to camelCase, this commit
modifies our email API code to use the new names.

Issue 0025566
Affected Issues
0025566
mod - core/email_api.php Diff File