I use EMailMessage and SMTPSecureSocket to send confirmations to clients.
Works ok, no complaints.
But lately I get more and more bounce emails regarding RFC 5322 violations.
In this case it’s a xojo 2024r4.2 webserver running on ubuntu and sending emails via a hoster.
Cause is the line with Date: like:
Date: Mon, 24 Mar 2025 11:37:47 0000
It should be (at least) regarding RFC 5322 chapter 3.3
Date: Mon, 24 Mar 2025 11:37:47 +0000
or
Date: Mon, 24 Mar 2025 11:37:47 -0000
Better of course would be a date with the correct timezone like:
Date: Mon, 24 Mar 2025 11:37:47 +0200 (CET)
Is smtpsecuresocket responsible for this line (then it’s maybe a bug), or where gets this line added?
Can I somehow modify the behavior?
Just the reason I wrote all my own methods for handling email headers in and out, and using only sslsocket. That combined with careful study of the relevant RFCs.
The other thing you don’t get with Xojo mail classes (as far as I know) is encoded word treatment for some header items such as subject lines or file names for attachments, which allows for subject lines and filenames to contain other than ASCII. See Wikipedia for encoded words.
I don’t use email related stuff from Xojo at all because bug fixing is very slow. See for instance https://tracker.xojo.com/xojoinc/xojo/-/issues/74008 . Curl or Chilkat work much better. For Sendgrid I’m now using the API version which wasn’t really complicated to add.
No, I just built the support into my app. Meaning that a user wanting to send attachments which have UTF8 filenames can do so. Some very old email clients see the incoming filenames as garbage but I have no sympathy. This is part of the Mime standard - there are RFCs which specify the format.