Skip to content

folded headers get corrupted #7

@ttoohey

Description

@ttoohey

When the following message is sent to a mailhog service, the Subject line gets the Message-ID field appended to it (and mailhog generates a new Message-ID).

telnet localhost 1025 <<EOF
HELO test
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
From: [email protected]
To: [email protected]
Subject: Testing
Message-ID:
 <message-id@localhost>

Body
.
QUIT
EOF

The subject appears as:

Subject: Testing <message-id@localhost>

I believe the following line is the source of the problem as it is expecting headers to always have a space after them:

data/message.go

Line 299 in 024d554

} else if strings.Contains(hdr, ": ") {

Is it incorrect behaviour to omit the space after the colon when folding? Is a space after the colon required even when no folding occurs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions