0

When we mean e-mail payload, are we talking about the whole message provided after DATA command or just the Body part of the message (without headers like From, Subject, Message-ID etc)?

S: 220 smtp.server.com Simple Mail Transfer Service Ready
C: HELO client.example.com
S: 250 Hello client.example.com
C: MAIL FROM:<[email protected]>
S: 250 OK
C: RCPT TO:<[email protected]>
S: 250 OK
C: DATA
S: 354 Send message content; end with <CRLF>.<CRLF>
C: <The message data (body text, subject, e-mail header, attachments etc) is sent>
C: .
S: 250 OK, message accepted for delivery: queued as 12345
C: QUIT
S: 221 Bye
5
  • 4
    The normal meaning of "payload" is the data being transmitted, not any headers and such. I'd expect roughly the same to apply here, so it would mean the body text. Feb 13, 2017 at 19:57
  • I think this is an interesting question. The question shows an exchange between an email client and an email server. One of the things transmitted is the message, but that includes the body, subject, headers, and attachments. My intuition would say that the payload is everything after the "Send message content" message from the server and the "." sent by the client to indicate the end of the message and the rest is negotiation around sending the payload, but I'm not an SMTP expert. I'm curious if there is an accepted definition of what the payload of an email body is in SMTP.
    – Thomas Owens
    Feb 13, 2017 at 21:57
  • I doubt the term payload is so strictly defined that there is a "right" answer. It could probably be both. However, I did not read all those RFCs about e-mail, so I could be wrong.
    – Doc Brown
    Feb 13, 2017 at 22:01
  • Note that I did not see the use of the word "payload" in the Wikipedia article on SMTP. It's only used in one of the RFCs linked to on the Wikipedia article, and there's no definition for what it means by payload.
    – Thomas Owens
    Feb 13, 2017 at 22:01
  • Possible duplicate of What does the term "Payload" mean in programming
    – amon
    Feb 15, 2017 at 13:25

1 Answer 1

4

19.1.1. email.message: Representing an email message

An email message consists of headers and a payload (which is also referred to as the content). Headers are RFC 5322 or RFC 6532 style field names and values, where the field name and value are separated by a colon. The colon is not part of either the field name or the field value.

The payload may be a simple text message, or a binary object, or a structured sequence of sub-messages each with their own set of headers and their own payload. The latter type of payload is indicated by the message having a MIME type such as multipart/* or message/rfc822.

In general, the payload is the part of transmitted data that is the actual intended message. The payload excludes any headers or metadata sent solely to facilitate payload delivery.

2
  • 1
    Ok, this is how the docs of Python's email package define "payload" for e-mails, and it is surely a good definition for their context, but is this a canonical reference? I have my doubts.
    – Doc Brown
    Feb 14, 2017 at 6:29
  • @DocBrown" The Wikipedia article I linked is a suitable canonical reference. Feb 14, 2017 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.