Bug Fix for Broken/Malformed Links in Header - Please implement this in future releases

Ages ago I posted about an issue that causes the unsubscribe, and other links embedded in the header to be malformed or broken:

Here is an example from an email send before the patch I am sharing:

Here is an example of the links after the patch:

image

These malformed links are critical now, as gmail and others use the one click unsubscribe for those who want to report spam, so having them function is very important.

I used ChatGPT to create this patch, and have tested it. It is attached and I hope I don’t have to keep patching it myself with new updates–please consider fixing this bug for good!

It is just small changes to two files:
/lists/admin/lib.php
/lists/admin/PHPMailer6/src/PHPMailer.php

link_header_patch.zip (62.2 KB)

@keeenone This is a consequence of phplist sending using the php mail() function. In the config.php file

define("PHPMAILERHOST", '');

If you change to sending through an SMTP server then the encoding should not happen.See the online manual for guidance Installing phpList man... | phpList manual

Usually you can use the bounce email address $message_envelopeand its password for the settings.

I have always used SMTP to send, so this was happening in SMTP as well. Please include this fix in your new version if possible, thank you!

@keeenone Which version of phplist are you using? I send through SMTP and don’t have encoded headers. If I change to send using php mail() then I do get encoded headers.

I use the very latest version: v3.6.16

This problem has been going on continuously for years, but only now could I address it with a fix using ChatGPT for help. The subject is still doing this, but I haven’t had time to fix that yet.