Exception: rawText does not contain a valid rfc2822 header field
Problem reported by Miguel Enrique - 10/2/2024 at 12:51 AM
Resolved
Hello.

Since I updated to version 9035 in the Delivery Log, I find a multitude of errors with the text: Exception: rawText does not contain a valid rfc2822 header field.

These are emails that are received, but that for smartermail are not correct, but that last week were received without problems.

In the end the sender receives a bounce and the email does not reach the recipient.

Is anyone else experiencing this problem?
Tony Scholz Replied
Employee Post
Hello Miguel, 

Can you send a test message to ascholz@beta.smartermonitor.com for review. Thank you
Tony Scholz
Lead Network/System Administrator
SmarterTools Inc.
Miguel Enrique Replied
Hello. I have created a ticket and it is being reviewed.
terry fairbrother Replied
What was the outcome of this as my delivery logs show these and have several emails stuck in the spool yet opening the email says the message no longer exists


[2026.10.02] 09:54:11.116 [69839754] Starting local delivery to redacted
[2026.10.02] 09:54:11.116 [69839754] Exception: rawText does not contain a valid rfc2822 header field
[2026.10.02]    at SmarterMail.Standard.Network.MIME.MimeHelper.OldMime.MimeHeader.Parse()
[2026.10.02]    at SmarterMail.Standard.Network.MIME.MimeHelper.OldMime.MimeParser.ReadPart(MimePart part, Int32 depth, String defaultContentType, String defaultContentSubtype)
[2026.10.02]    at SmarterMail.Standard.Network.MIME.MimeHelper.OldMime.MimeParser.Parse()
[2026.10.02]    at SmarterMail.Standard.Network.MIME.MimeHelper.OldMime.MimeReader.GetParts()
[2026.10.02]    at MailService.ContentFiltering.伻.DeliverFilterMessage(丄侽 spoolMessage, LocalRecipient localRecipient)
[2026.10.02]    at SmarterMail.MailService.RelayServer.MessageQueue.丄俦.DeliverToLocalRecipientAsync(丄侽 spoolMessage, LocalRecipient localRecipient, db_system_settings_readonly systemSettings, db_system_delivery_settings_readonly systemDeliverySettings)
[2026.10.02] 09:54:11.116 [69839754] Removed from LocalDeliveryQueue (0 queued or processing)


restarting the spool doesn't make the que disappear
Ricardo Ranieri Replied
Hello

The same problem from @icloud.com

[2026.10.02] 10:36:36.683 [40693596] Exception: rawText does not contain a valid rfc2822 header field

terry fairbrother Replied
it was icloud accounts that were the issue
Douglas Foster Replied
It is probably detecting the problem below.   This text is from the Declude Antivirus documentation document.

Outlook 'Space Gap' Vulnerability: This vulnerability occurs when there is a space in one of the MIME
headers where there is not normally a space (such as "Content-Type :" instead of "Content-Type:"). This is not RFC-compliant, but Outlook will treat it as valid and be able to see a virus that virus scanners will not usually see. There is no legitimate reason for an E-mail to be formed like this.

If the email is legitimate, you can probably solve the problem by removing the space character.    Before delivering the document to the recipient, it would be wise to determine why the header is malformed.   ICloud.com should know how to format a header, so where did the malformed header originate?
Tony Scholz Replied
Employee Post Marked As Resolution
Hello, 

For the original case, there was a malformed header, X-Ham-Report:, that was causing the issue, which was resolved in Build 9084 (Nov 14, 2024). 

Thank you
Tony Scholz
Lead Network/System Administrator
SmarterTools Inc.
terry fairbrother Replied
Hi Tony, can the issue be fixed when emails are coming from icloud accounts since it's generating the same error?
Douglas Foster Replied
He was referring to a header added by SmarterMail, which was presumably fixed by adding it correctly.

You need to dig deeper.   I have hundreds of messages from icloud.com but no evidence of this problem.

Define the problem:
Which header causes the error?  
What is the nature of the formatting error?
  • Whitespace between the name and the colon, 
  • a missing colon, or 
  • something else?

Perform Integrity checks: 
  • Does the message come from a server named:
  • Does the Reverse DNS name forward-confirm to the Source IP?   It should.
  • Do you know the sender and why it is being sent?   
Possible Resolutions
Can you ask the sender to ask his support process to investigate why the message was transmitted with an invalid header?  This is the best fix.

Since you said the message gets stuck, can you simply edit the message  yourself on the rare occassions that it happens?

SM could potentially be reconfigured to ignore the error, but that might simply allow the problem to reappear downstream, for example in Outlook.  I assume that the current rule is in place because something similar has been used in the past as an attack vector.

SM could potentially be reconfigured to correct the error.    That introduces risk of something going wrong in the rewrite process, so an attempt to fix someone else's failures may produce support headaches that they do not want or need.

terry fairbrother Replied
it was an icloud email account, they eventually dropped out of the spool but I have no idea if they were delivered, bounced or dropped. it was something I spotted sitting in the spool for hours

Reply to Thread

Enter the verification text