# Discourse SMTP "X-MSYS-API 'campaign\_id' is limited to 64 bytes"

**URL:** <https://meta.discourse.org/t/discourse-smtp-x-msys-api-campaign-id-is-limited-to-64-bytes/51550>\
**Category:** Product Support\
**Created:** [14 Octubre, 2016 14:26 UTC](https://meta.discourse.org/t/discourse-smtp-x-msys-api-campaign-id-is-limited-to-64-bytes/51550 "2016-10-14T14:26:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Yassine\_Yousfi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yassine_yousfi/32/195913_2.png) [@Yassine\_Yousfi](https://meta.discourse.org/u/Yassine_Yousfi)\
**Post date:** [17 Octubre, 2016 05:23 UTC](https://meta.discourse.org/t/discourse-smtp-x-msys-api-campaign-id-is-limited-to-64-bytes/51550/12 "2016-10-17T05:23:39Z")

</div>

change this line of code:

> Or it can be solved from within line #143 at file : discourse/lib/email/sender.rb  
> @message.header[‘X-MSYS-API’] = { campaign\_id: @message.message\_id }.to\_json

to this:

```
@message.header['X-MSYS-API'] = { campaign_id: @message.message_id[0..63] }.to_json

```

notice that i simply added the [0..63] keyword to cast the campaign id into 63 chars max. so it cannot be longer.

once u change that line, simply restart your discourse `./launcher restart app`

and it should be working 🙂

hope that helps.

---

_[View the full topic](https://meta.discourse.org/t/discourse-smtp-x-msys-api-campaign-id-is-limited-to-64-bytes/51550)._
