Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1717 - Fix SMTP failure involving disconnect() method #17137

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented Apr 21, 2020

Overview

v5.24 introduced a new Mailer utility, CRM_Utils_Mail_FilteredPearMailer, which is essentially a wrapper around Mail_Smtp, Mail_mail and Mail_sendmail. This allowed us to inject some of our customisation on top of PEAR Mail (and remove some patch-files).

However, FilteredPearMailer did not implement the SMTP-specific disconnect method (used by some error-handling code for flexmailer and Mailing BAO - https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/MailingJob.php#L668).

Before

Disconnect method not implemented on wrapper factory

After

Disconnect method is implemented

ping @eileenmcnaughton @totten @aydun @jaapjansma

@civibot
Copy link

civibot bot commented Apr 21, 2020

(Standard links)

@civibot civibot bot added the master label Apr 21, 2020
@seamuslee001 seamuslee001 changed the base branch from master to 5.25 April 21, 2020 21:16
@civibot civibot bot added 5.25 and removed master labels Apr 21, 2020
@totten
Copy link
Member

totten commented Apr 21, 2020

  • I think this makes sense. The pre-existing class hierarchy is a little off, but meh. This change is KISS. 👍
  • A slightly more aggressive fix might be to delegate any other public methods that occur in the Mail class hierarchy. I grepped vendor/pear/mail, and it's a fairly short list. (Mail/smtp.php has getSMTPObject and addServiceExtensionParameter. The little/never used Mail/smtpmx.php has _getMx, _loadNetDns, and _raiseError - which appear internal anyway.) Using function __call feels maybe a little more precise. But again, meh. I grepped universe and couldn't find anything which used these. 🤷‍♂️

@totten totten changed the title dev/core#1717 Fix SMTP failure on fail to disconnect due to new wrapp… dev/core#1717 - Fix SMTP failure involving disconnect() method Apr 21, 2020
@eileenmcnaughton eileenmcnaughton added the merge ready PR will be merged after a few days if there are no objections label Apr 21, 2020
@eileenmcnaughton
Copy link
Contributor

@seamuslee001 I'm happy for you to merge this after considering @totten's feedback

…er smtp mailer

Add in wrapper around to check if we can call it
@seamuslee001
Copy link
Contributor Author

@totten I have added the if wrapper around and made the function return True otherwise

@seamuslee001
Copy link
Contributor Author

Merging as Tim's feedback has been incoprorated now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.25 merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants