Page MenuHomePhorge

PHPMailer: Merge class.phpmailer-lite.php into class.phpmailer.php
Needs ReviewPublic

Authored by aklapper on Jul 4 2024, 12:16.

Details

Summary

Remove class.phpmailer-lite.php whose upstream is nowhere to be found, to potentially lay out a path to future PHPMailer updates.

Closes T15877

Test Plan

Unclear, apart from carefully diff'ing and reading code.
Maybe https://we.phorge.it/book/phorge/article/configuring_outbound_email/ could come handy though.

Diff Detail

Repository
rP Phorge
Branch
phpMailerLiteMerge
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1539
Build 1539: arc lint + arc unit

Event Timeline

aklapper requested review of this revision.Jul 4 2024, 12:16
  • Between class.phpmailer-lite.php and class.phpmailer.php there were two differences in default values of variables, for $Mailer and $SingleTo:
    • I kept Lite's public $SingleTo = true as src/applications/metamta/adapter/PhabricatorMailSMTPAdapter.php (using non-Lite) already explicitly sets $smtp->SingleTo = false.
    • I kept Lite's public $Mailer = 'mail' instead of non-Lite's public $Mailer = 'sendmail' as SMTP in non-Lite already explicitly sets $Mailer = 'smtp' via calling $smtp->IsSMTP(), same for Sendmail via $mailer->IsSendmail(), and custom AmazonSES's code already explicitly sets $mailer->Mailer = 'amazon-ses' in src/applications/metamta/adapter/PhabricatorMailAmazonSESAdapter.php - so our default value sendmail does not really matter here anyway.
  • The other PhabricatorMail*Adapter subclasses of PhabricatorMailAdapter do not seem to utilize PHPMailer.
  • No documentation to update as https://we.phorge.it/book/phorge/article/configuring_outbound_email/ does not mention any PHPMailer.

Fix $Mailer default value in docs

Fix some ambiguous URIs to Phorge commits/tasks; remove two empty lines

Apart from a few additional fixes and custom lines, this change brings the codebase as close as possible to revision 5b661107cab6ae3d96a076532c8fccf23ea07ece from 2010-06-23 in upstream and thus offers a future upgrade/maintenance path.

For what it's worth I've applied this to my personal instance which tracks master, and I've foisted it on my work instance too---ostensibly tracking stable there, but ;)

So my work's unwilling test subjects users should let me know over the course of next week if anything's gone screwy due to it. Cursory initial testing (prompting emails and seeing them show up) seems fine.