Closed SMTP Session is closed after each recipient over SSL

ActorMike

Well-known member
Licensed customer
Affected version
2.2.13 but also happened in much older versions.
I noticed this a few years ago, but didn't want to fool with it so I just used a non-SSL connection since our mail server and web server are all on one Windows 2019 machine and when the spool messages are sent they go out via TLS anyway. Worth noting, that this issue also presented on a Win 2012 R2 server.

When I put in our secure mail server connection and email users, it does one at a time. When we used a non-secure method, it does them in batches of as many as 100+.

I worked with the support team at SmarterTools and they determined the limitation is within XF for the following reasons after testing our server. This is NOT by opinion, but theirs:

The reason why it's faster on a non-secure connection is because it's not closing the connection it just calls an RST command. This means that it doesn't have to go through the whole SMTP session again. It can just immediately specify the recipients.

This specific issue is happening over SSL in XF because instead of declaring another RCPT TO address XF is starting a whole new session. I'm able to authenticate and declare as many RCPT TO sessions as I like with the Python SMTP lib while going over TLS or SSL encryption. So I think that this has to be a limitation within XF.


This has a crippling effect when trying to email 10,000 users!
 
Automated triage: Closed

Thank you for reporting this issue. This report is about the older mail library used in 2.2, which was replaced by a new one in XenForo 2.3. The current SMTP code reuses a single connection for many recipients whether or not SSL is enabled. If you still see a new session per recipient on the current version, please open a new report with current details.

This is an automated assessment. A member of staff may review and update it.
 
This is interesting, when I reported this two years ago I was told that Xenforo does not control this, that it was a server issue, so that was not correct information?

Screenshot 2026-11-19 090347.webp

1795097130987.webp
1795097171884.webp
 
Last edited:
Ultimately, I believe the diagnosis was correct given the information we had at the time. It breaking after moving servers must have been a factor, but that's really only something you can confirm in terms of what changed between the two server builds. I guess that may have been the SSL/TLS part changing for some reason.

I think you found the limitation before support identified it, so asking you to report it as a bug was the correct outcome.

That being said, it was still not an issue we had any immediate control over, at the time, so that diagnosis was correct too. It does appear that Swiftmailer had the described limitation and this wouldn't have been something we'd have been able to change in XF or Swiftmailer itself. Swiftmailer was already discontinued and a few months after this, we shipped the fix in the first XenForo 2.3.0 Beta with the usage of the new Symfony Mail library.

The gap since then and now is one that is now corrected through proactive and ongoing triage and bug classification.
 
Back
Top Bottom