Jump to content

System SMTP headers Misspaced


Recommended Posts

Hey, was doing some work recently on moving all mailing to AWS SES and whilst checking how the PBX shapes up I am all ways losing 2.5 points on spam assassin due to HDRS_MISSP "Misspaced headers" I only get this on the pbx.

Can you guys look at the header structure and make it complaint ? just so we don't all lose 2.5 points out of the gate, also some of the base e-mail templates are missing alt text's. 

<img src="https://portal.vodia.com/img/googleplay.png" width="135px" height="40px" />
<img src="https://portal.vodia.com/img/appstore.png" width="135px" height="40px" />
<img src="https://portal.vodia.com/img/msstore.png" width="135px" height="40px" />
<img style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none; max-width: 200px" src="data:image/png;base64,


Link to comment
Share on other sites

yeah I was not 100% sure it was the order, but I also could not find any thing else odd looking to trigger it, unless that part has been stripped out by the time its processed by the remote side and re-rapped.

https://www.mail-tester.com/   you can do a test your self there are many like this but I find this one is good. I try to aim for a score of at least 8+ 

There was as not a whole lot of insightful info on exactly what HDRS_MISSP meant or any examples I could find. 


Link to comment
Share on other sites

Ha ha, I asked chat GPT and it gave me some directions to go down, the sources it was referencing are no longer published. 

Q, What would a Misspaced header look like?

A, Here's an example of a header with a misspaced header that would trigger the "Misspaced headers" rule in SpamAssassin:

From : john.doe@example.com
To : jane.doe@example.com
Subject : Important message regarding your account
Date : Mon, 3 Apr 2023 08:30:00 -0400

In this example, there are extra spaces between the header name and the colon separator in each header field. For instance, there is a space between "From" and the colon separator, which should be "From:". This would trigger the "Misspaced headers" rule in SpamAssassin, and add points to the overall spam score of the message.

Q, What should a correctly formatted one look like ? 

A, Here's an example of a correctly formatted header in an email message:

From: john.doe@example.com
To: jane.doe@example.com
Subject: Important message regarding your account
Date: Mon, 3 Apr 2023 08:30:00 -0400

In a properly formatted header, each header field name (such as "From", "To", "Subject", and "Date") should be followed immediately by a colon separator, with no spaces or tabs in between. The field name and value should be separated by a single space.

Headers in email messages typically follow the format shown above, and adherence to this standard is important for ensuring that email messages are properly interpreted and processed by email clients and servers.

Q, What about the spacing after the : in the header?

A, According to the RFC 5322 standard for Internet Message Format, the recommended format for email headers is as follows:

field-name: field-value

Here, "field-name" refers to the name of the header field, and "field-value" is the value associated with the header field. The colon separator should be followed by a single space.

For example, a properly formatted header for an email might look like this:

From: john.doe@example.com
To: jane.doe@example.com
Subject: Example Email
Date: Tue, 4 Apr 2023 11:30:00 -0400

Note there is also a single space following the colon separator in each header field.

It's worth noting that some email clients or servers may not strictly adhere to the recommended format in RFC 5322, and may allow for variations in header formatting. However, sticking to the recommended format can help ensure that emails are properly interpreted and processed by all email clients and servers.

Here is the raw PBX,

Subject:Voice: Test
Date:Mon, 03 Apr 2023 00:45:59 -0000
Message-Id: <20230403004559.CA021E1B60@mydomain.io>

This is a test email.

Could it simply be the spacing after the : ?  The message ID part is added by my server processing the request, formatted with the space.


Here is one sent from outlook/o365 that scores 10/10.

Date: Fri, 31 Mar 2023 08:52:26 +0000
From: ABC <my@domain.com>
Reply-To: ABC <my@domain.com>
To: test-123@srv1.mail-tester.com
Message-ID: <0101018736de3a32-7dedff49-63aa-49d3-99c2-8ce5307dc9f1-000000@domain.com>
Subject: TEST - 123 123
Mime-Version: 1.0
Content-Type: multipart/alternative;


Link to comment
Share on other sites

Yes the colon handling is inconsistent, but the reason for that is probably because the Message-ID was inserted by the mailer. We had already changed that in 69. What we could do is to add the Message-ID also in 68 and even add that space after the colon, so that if any other tool feels like inserting headers they would look the same.

Link to comment
Share on other sites

  • 3 weeks later...
  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...