{"action":"opened","issue":{"url":"https://api.github.com/repos/nette/mail/issues/47","repository_url":"https://api.github.com/repos/nette/mail","labels_url":"https://api.github.com/repos/nette/mail/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/nette/mail/issues/47/comments","events_url":"https://api.github.com/repos/nette/mail/issues/47/events","html_url":"https://github.com/nette/mail/issues/47","id":277735243,"number":47,"title":"eml attachments","user":{"login":"podolinek","id":1062993,"avatar_url":"https://avatars3.githubusercontent.com/u/1062993?v=4","gravatar_id":"","url":"https://api.github.com/users/podolinek","html_url":"https://github.com/podolinek","followers_url":"https://api.github.com/users/podolinek/followers","following_url":"https://api.github.com/users/podolinek/following{/other_user}","gists_url":"https://api.github.com/users/podolinek/gists{/gist_id}","starred_url":"https://api.github.com/users/podolinek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podolinek/subscriptions","organizations_url":"https://api.github.com/users/podolinek/orgs","repos_url":"https://api.github.com/users/podolinek/repos","events_url":"https://api.github.com/users/podolinek/events{/privacy}","received_events_url":"https://api.github.com/users/podolinek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-29T12:24:23Z","updated_at":"2017-11-29T12:24:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- bug report? yes\r\n- feature request? yes\r\n- version: 2.4\r\n\r\n### Wrong content type for .eml files added as attachment\r\n\r\nHi, if you add eml file (mail file) to mail message attachments and send, some mail servers (in my case seznam.cz) reply me:\r\n\r\n```\r\nYou message for <...@...> from 2017/11/29 could not be delivered.\r\nIt's attached below.\r\n\r\nDůvod / Reason:\r\n---------------\r\n\r\n5.6.5 ebox; ebox: bad argument: Rfc822 message part can not be conbinated with base64 encoding.\r\n```\r\nIt noticed me about wrong content type of attachment, which is \"correctly\" set as Rfc822, but this content type is not allowed for attached files.\r\n\r\nChapter 4.4 of [whitepapers from microsoft](https://technet.microsoft.com/en-us/library/hh547013(v=exchg.141).aspx) describes how to fix it: change content-type to ```APPLICATION/OCTET-STREAM```.\r\n\r\nThis should be fine implemented at nette mail for example at Message.php.\r\n\r\n```\r\npublic function addAttachment($file, $content = null, $contentType = null) {\r\n\t$path = $file;\r\n\t$ext = Strings::lower(pathinfo($path, PATHINFO_EXTENSION));\r\n\tif ($ext == 'eml') {\r\n\t\t$contentType = $contentType ?? 'APPLICATION/OCTET-STREAM';\r\n\t}\r\n\treturn $this->attachments[] = $this->createAttachment($file, $content, $contentType, 'attachment');\r\n}\r\n```\r\n\r\nWhat do you think about this change?\r\n\r\nRegards,\r\nOndrej"}}
{"actor":{"display_login":"podolinek"}}