Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Adding DKIM to the PHPMailer package in XC5.4.*

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-12-2019, 04:13 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Adding DKIM to the PHPMailer package in XC5.4.*

Has anybody done this yet via their own Custom Module and if so, how? The original file that has to be modified is located here: /vendor/phpmailer/phpmailer/src/PHPMailer.php Not in here /skins/* and not in here /classes/Xlite/* so it's a slightly different challenge then the usual ones covered when using a Custom Module.

Currently, we copy the XC supplied core file (and retain the original) Then modify the copied file by adding in, all of the required DKIM data including the link to the correct DKIM private key located on our server. This works perfectly and all XC e-mails sent via PHPMailer are fully DKIM as a result, which is exactly what's needed.

The drag is XC upgrades. Unless the modified and original files are exchanged again, prior to an XC upgrade, the modified file is detected as part of the upgrade process. There is an option to "retain and use" it (complete with a disclaimer of how the XC upgrade may fail as a result etc ) or, overwrite the modified file with a new core file. We always exchange the files again prior to any XC upgrades, because the "retain and use option' does not work. The modified file gets overwritten regardless... So, it would be much better to use the modified core file as part of a Custom Module, which would remove the pre & post upgrade file exchange tasks. However, as detailed above, the core file has a different location than usual...

FWIW PHPMailer was upgrade to v6.0.7 in XC5.4.*. That's much better than it was in XC5.3.* but it is still some way behind the current secure release which includes several bug fixes etc. It would be very handy if XC INCLUDE the latest PHPMailer release in XC 5.4.0.7 @mvs can you please add this to the list? It's quite a simple package replacement task for XC!
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote

The following user thanks Triple A Racing for this useful post:
kellenmurphy (11-13-2019)
  #2  
Old 11-12-2019, 04:25 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Adding DKIM to the PHPMailer package in XC5.4.*

Custom modules can modify files only within /classes and /skins directories. Everything else is part of the untouchable XC core.
Everything under /vendor are packages you can pull yourself with composer however depends on the changes between these packages versions some XC functionalities may not work or throw errors. These /vendor packages are not part of XC they are just used by XC.

You can pull phpmailer package under your own custom module and reference it from there instead of the one under /vendor but for this to work how XC uses the package should be under /classes so you can decorate the appropriate class and reference your module package instead.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Triple A Racing (11-12-2019)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:53 AM.

   

 
X-Cart forums © 2001-2020