Skip to content

Conversation

msimerson
Copy link
Member

@msimerson msimerson commented Jun 27, 2025

  • fix: also remove dot-stuffing from leftovers Release v1.3.0 #9
  • fix: replace polynomial regex with trimEnd()
  • change: switch test runner from mocha -> node --test
  • doc(README): add ref to Haraka Transaction docs showing usage
  • deps(test-fixtures): bump to latest
  • rename dot_stuffing -> dot_stuffed, consistent with Haraka
    • in Haraka, dot_stuffing got renamed to dot_stuffed in PR 1165, it seems to have been missed here.

While looking into haraka/haraka-plugin-dkim#17, I came across this perverse logic:

      this.dot_stuffing = false
...
      // Remove dot-stuffing if required
      if (
        !this.dot_stuffing &&
        line.length >= 4 &&
        line[0] === 0x2e &&
        line[1] === 0x2e
      ) {
        line = line.slice(1)
      }

Therefore, the default behavior of message-stream is to set dot_stuffing=false and remove stuffed dots only when dot_stuffing=false. This is not intuitive, so I looked at all cases where we handle dot stuffing across Haraka. The closest I got to a good explanation was in the Outbound.md doc:

dot_stuffing = true Use this if you are passing your content dot-stuffed (a dot at the start of a line is doubled, like it is in SMTP conversation, see [RFC 2821][url-rfc2821]

That actually starts to make sense. The variable dot_stuffing isn't a request, it's an indicator. The disconnect is that the naming isn't aligned. Elsewhere in Haraka it was improved to dot_stuffed. This PR updates message-stream by renaming dot_stuffing to dot_stuffed and changes the default value from false to true. Our default assumes any content being piped is dot-stuffed and we should remove the dot. The caller can pass { dot_stuffed: false } to override.

@coveralls
Copy link

coveralls commented Jun 27, 2025

Pull Request Test Coverage Report for Build 16061014205

Details

  • 16 of 19 (84.21%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.3%) to 68.233%

Changes Missing Coverage Covered Lines Changed/Added Lines %
index.js 16 19 84.21%
Totals Coverage Status
Change from base Build 13101595734: 2.3%
Covered Lines: 364
Relevant Lines: 523

💛 - Coveralls

@msimerson msimerson requested a review from Copilot July 2, 2025 16:58
Copilot

This comment was marked as resolved.

@msimerson msimerson merged commit d147847 into master Jul 6, 2025
9 checks passed
@msimerson msimerson deleted the release-1.3.0 branch July 6, 2025 23:18
msimerson added a commit to haraka/Haraka that referenced this pull request Jul 6, 2025
- Pairs with haraka/message-stream#9
  - (tests are broken until the message-stream PR is merged)
- fixes haraka/haraka-plugin-dkim#17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants