X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Adding DKIM to the PHPMailer package in XC5.4.* (https://forum.x-cart.com/showthread.php?t=77337)

Triple A Racing 11-12-2019 04:13 PM

Adding DKIM to the PHPMailer package in XC5.4.*
 
Has anybody done this yet via their own Custom Module and if so, how? :lol: 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 :mrgreen: ) 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! :wink:

cflsystems 11-12-2019 04:25 PM

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.


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.