8

We do a lot of mailing and we use Sendgrid to give it unique arguments and categories. But for storage, archiving, filtering and search capabilities, I would like to give them some other custom headers too, something like a json format of this array

array('user' => 300, 'item' => 8842, 'country' => 'Croatia');

Now, is it possible for such custom headers to hurt the passthrough rate of our emails? In other words, is there a chance of our emails triggering spam filters due to having such custom headers?

Swader
  • 11,387
  • 14
  • 50
  • 84

1 Answers1

15

The convention for user defined headers is to prefix them with an X-. For example

X-my-custom-header: foo

This has been a part of the email spec for a long time (see: https://www.rfc-editor.org/rfc/rfc822) and shouldn't ever hurt your deliverability.


Also, related question: Custom header mail() and spam score

Community
  • 1
  • 1
Swift
  • 13,118
  • 5
  • 56
  • 80
  • To be precise, the use of `X-` for custom headers isn't/wasn't specified in RFC 822. All it said was that future extensions wouldn't add names that started with `X-`. 822 was obsoleted in 2001, and the subsequent standards (2822/5322) dropped this text entirely. You've always been free to define any names you want, as long as they're syntactically correct. – EML May 22 '23 at 10:16