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

Github.com in X-mailer header causes emails to be rejected/marked as spam due to github.com being on blacklist #3008

Closed
6 tasks done
SDGPeteBatin opened this issue Jan 16, 2024 · 2 comments

Comments

@SDGPeteBatin
Copy link

SDGPeteBatin commented Jan 16, 2024

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

github.com is on Spamhaus Zen url blacklist.
PHPMailer adds the header : X-Mailer: PHPMailer 5.5 (https://github.com/PHPMailer/PHPMailer/)
The domain IP in the URL to this project is blacklisted causing emails generated by this script to get rejected/marked as spam (depending on mail server configuration)

Code to reproduce

Send a PHPMailer generated emailer to a recipient server using DNS/URL blacklisting.

Debug output

Message 964757AE759A4537B857A8.MAI has link to blacklisted IP. github.com (140.82.121.4) was found in blacklist SpamhausZEN

I recommend removing the URL to prevent this from happening otherwise it will randomly happen without notice.

@Synchro
Copy link
Member

Synchro commented Jan 16, 2024

Spamhaus has quite a severe problem with blocking entirely legitimate sites. But it's their problem to fix, not anyone else's. You can always suppress the header, as per the docs on PHPMailer's XMailer property.

@Synchro Synchro closed this as completed Jan 16, 2024
@SDGPeteBatin
Copy link
Author

Thanks for the reply but I respectfully disagree with that viewpoint.

PHPMailer is well used by many for sending emails (myself included, for years). Spamhaus is also well used by many (over 3 Billion mailboxes) for providing some level of mitigation against spam and other bad emails. Spamhaus is doing their job, IP's don't end up on the list for no good reason, it's not their problem.

In order for PHPMailer to be truly robust and reliable the github URL (any URL in headers) needs to be removed. It's such a simple change to make to prevent a big problem from occurring in the future. The URL serves no purpose other than advertising the project repo to third parties which I've had no issue with until now (the developers using it can get the URL from the comments in the files and are well aware of the repo).

In real terms this is something that makes the script vulnerable to external and uncontrollable factors/influences by default, something that hasn't been an issue until or presented itself in all the years I've used it until now. You have no control over the domain github.com or the IP's that the domain proxies through, you have no control over recipient mail servers or their configurations......... you do have control over the code.

Yes the property can indeed be changed but no one does or will until this happens. In my case it's easier to remove the URL from the class file instead of all the instances where the class is used and all the projects that the class is used in. It makes no difference to me whether you make the change or not, I still have to patch 100's of projects that this is used in to ensure deliverability, I just wanted to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants