{"action":"created","issue":{"url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/135","repository_url":"https://api.github.com/repos/mailjet/mailjet-gem","labels_url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/135/comments","events_url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/135/events","html_url":"https://github.com/mailjet/mailjet-gem/issues/135","id":303006699,"number":135,"title":"Unable to set List-Unsubscribe header","user":{"login":"ArthurWD","id":18190620,"avatar_url":"https://avatars2.githubusercontent.com/u/18190620?v=4","gravatar_id":"","url":"https://api.github.com/users/ArthurWD","html_url":"https://github.com/ArthurWD","followers_url":"https://api.github.com/users/ArthurWD/followers","following_url":"https://api.github.com/users/ArthurWD/following{/other_user}","gists_url":"https://api.github.com/users/ArthurWD/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurWD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurWD/subscriptions","organizations_url":"https://api.github.com/users/ArthurWD/orgs","repos_url":"https://api.github.com/users/ArthurWD/repos","events_url":"https://api.github.com/users/ArthurWD/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurWD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-07T08:32:44Z","updated_at":"2018-03-07T11:01:15Z","closed_at":null,"author_association":"NONE","body":"I try to set the List-Unsubscribe header, but on mailer.rb line 113, the header is excluded:\r\n\r\n```ruby\r\nif header.name.start_with?('X-') && !header.name.start_with?('X-MJ') && !header.name.start_with?('X-Mailjet')\r\n```\r\n\r\nWhy not allow additional headers? Or am I missing something?\r\n\r\nMight be better to blacklist the headers listed [here](https://dev.mailjet.com/guides/#adding-email-headers), instead of whitelisting, or just let the api handle unpermitted headers."},"comment":{"url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/comments/371103201","html_url":"https://github.com/mailjet/mailjet-gem/issues/135#issuecomment-371103201","issue_url":"https://api.github.com/repos/mailjet/mailjet-gem/issues/135","id":371103201,"user":{"login":"Lorel","id":4034571,"avatar_url":"https://avatars1.githubusercontent.com/u/4034571?v=4","gravatar_id":"","url":"https://api.github.com/users/Lorel","html_url":"https://github.com/Lorel","followers_url":"https://api.github.com/users/Lorel/followers","following_url":"https://api.github.com/users/Lorel/following{/other_user}","gists_url":"https://api.github.com/users/Lorel/gists{/gist_id}","starred_url":"https://api.github.com/users/Lorel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lorel/subscriptions","organizations_url":"https://api.github.com/users/Lorel/orgs","repos_url":"https://api.github.com/users/Lorel/repos","events_url":"https://api.github.com/users/Lorel/events{/privacy}","received_events_url":"https://api.github.com/users/Lorel/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T11:01:15Z","updated_at":"2018-03-07T11:01:15Z","author_association":"CONTRIBUTOR","body":"I don't know how the API works exactly, sorry\r\nIf the API rejects your request, you can rewrite\r\n```ruby\r\nif header.name.start_with?('X-') && !header.name.start_with?('X-MJ') && !header.name.start_with?('X-Mailjet')\r\n```\r\nwith\r\n```\r\nif header.name.start_with?('X-') && !header.name.start_with?('X-MJ') && !header.name.start_with?('X-Mailjet') || (header.name == List-Unsubscribe)\r\n```\r\nfor a quick fix\r\n\r\nTo do that well, a whitelist of authorized headers to forward to the API should be considered\r\nLet me know if the API accepts this header"}}
{"actor":{"display_login":"Lorel"}}