Skip to content

Error 501: Line too long #52

@falco467

Description

@falco467

The RFC for Mails requires all lines in the Message to not be longer than 1000 characters (including CR+LF).
If I create a Message with this library, I would expect line-breaks to be added automatically to conform to the standard.

But the library does not add line-breaks to the message body and this emails are rejected by many mail servers with the error "501: line too long"

Example code:

const mimeText = require('mimetext')

const msg = mimeText.createMimeMessage()
msg.setSender('test@example.org')
msg.setTo('test@example.org')
msg.setSubject('This message will be rejected')

msg.addMessage({ contentType: 'text/html', data: 'x'.repeat(2000) })

console.log(msg.asRaw())

This message will contain a single line with 2000 characters, breaking the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions