Suitecrm: "Users may send as themselves" broken - Invalid address: (punyEncode)

Created on 17 Jun 2019  路  8Comments  路  Source: salesagility/SuiteCRM

Issue

users are not able to send mails, if checkbox "Users may send as themselves:" is activated

chrome_f1H7uTkFWK

CRM-Settings:

  • EMAIL SETTINGS: OUTGOING MAIL CONFIGURATION is configured, "outbound mail" contains only the "system" item (sending test-mails from the admin-backend works)
  • checkbox "Users may send as themselves:" is checked as shown above
  • test user has two mail addresses set up in his profile

Expected Behavior

  • click on a contacts mail address opens mailer
  • user is able to choose one of his own addresses and add content
  • and can send the mail

Actual Behavior

  • after clicking the "send" icon, an error message appears:

Error Sending Email. Please contact your administrator for assistance.
chrome_PASYuvGElf

  • log:
    Mon Jun 17 09:27:55 2019 [16712][1][FATAL] SugarPHPMailer encountered an error: Invalid address: (punyEncode) Administrator <[email protected]
    - note the missing ">"!

Possible Fix

  • I've debugged into it. Found the issue in \include\phpmailer\class.phpmailer.php, line 1252 (validateAddress returns false instead of true)
  • I changed therefore (only for testing) the condition to
    if (false && !$this->validateAddress($this->$address_kind)) {
  • result: mail is sent.

  • E: var $address in validateAddress() is set to [email protected] for all receiving addresses, but the from-address is set to Administrator <[email protected] and the following preg_match fails

Steps to Reproduce

as described above

Your Environment

  • SuiteCRM Version 7.10.17
    Sugar Version 6.5.25 (Build 344)
Emails Critical Fix Proposed Bug

Most helpful comment

FYI I've also tested with sending as your own SMTP email address vs. the System. Both do not. Work. I Think this should be bumped up to high priority as no emails can be sent other than from the system email address!

If it helps 7.11.2 works. I don't have any 7.11.3 installations, but for sure 7.11.4 experiences the issue. So it's either the changes made in 7.11.3 or 7.11.4 updates.

All 8 comments

The fix shouldn't be done inside the phpmailer package (include/phpmailer), but in one of the calling functions (probably in https://github.com/salesagility/SuiteCRM/blob/master/include/SugarPHPMailer.php, which is our own SuiteCRM class to deal with phpmailer package, or even further above in the call stack).

Basically we don't need to disable the validation, we simply shouldn't be passing it an invalid email address.

Yes, i have same problem.

I'm experiencing this in 7.11.4 it seems to be missing the last ">" to close the email address.

FYI I've also tested with sending as your own SMTP email address vs. the System. Both do not. Work. I Think this should be bumped up to high priority as no emails can be sent other than from the system email address!

If it helps 7.11.2 works. I don't have any 7.11.3 installations, but for sure 7.11.4 experiences the issue. So it's either the changes made in 7.11.3 or 7.11.4 updates.

Think this issue is a duplicate of this one...
https://github.com/salesagility/SuiteCRM/issues/6812

Issue

users are not able to send mails, if checkbox "Users may send as themselves:" is activated

chrome_f1H7uTkFWK

CRM-Settings:

  • EMAIL SETTINGS: OUTGOING MAIL CONFIGURATION is configured, "outbound mail" contains only the "system" item (sending test-mails from the admin-backend works)
  • checkbox "Users may send as themselves:" is checked as shown above
  • test user has two mail addresses set up in his profile

Expected Behavior

  • click on a contacts mail address opens mailer
  • user is able to choose one of his own addresses and add content
  • and can send the mail

Actual Behavior

  • after clicking the "send" icon, an error message appears:

Error Sending Email. Please contact your administrator for assistance.
chrome_PASYuvGElf

  • log:
    Mon Jun 17 09:27:55 2019 [16712][1][FATAL] SugarPHPMailer encountered an error: Invalid address: (punyEncode) Administrator <[email protected]
    - note the missing ">"!

Possible Fix

  • I've debugged into it. Found the issue in \include\phpmailer\class.phpmailer.php, line 1252 (validateAddress returns false instead of true)
  • I changed therefore (only for testing) the condition to
    if (false && !$this->validateAddress($this->$address_kind)) {
  • result: mail is sent.
  • E: var $address in validateAddress() is set to [email protected] for all receiving addresses, but the from-address is set to Administrator <[email protected] and the following preg_match fails

Steps to Reproduce

as described above

Your Environment

  • SuiteCRM Version 7.10.17
    Sugar Version 6.5.25 (Build 344)

I have applied this fix "* I changed therefore (only for testing) the condition to

if (false && !$this->validateAddress($this->$address_kind)) { on line 1252 but I still get the same error message, I also applied all settings on this thread.

But my test user is still ot able to send an email as themselves

@MyBlissIT that's not the fix. There is a fix for this issue Dillon Brown has linked it above.

@MyBlissIT that's not the fix. There is a fix for this issue Dillon Brown has linked it above.

Thanks, I performed Dillion Brown's fix and it worked

Was this page helpful?
0 / 5 - 0 ratings