{"action":"created","issue":{"url":"https://api.github.com/repos/djfarrelly/MailDev/issues/202","repository_url":"https://api.github.com/repos/djfarrelly/MailDev","labels_url":"https://api.github.com/repos/djfarrelly/MailDev/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/djfarrelly/MailDev/issues/202/comments","events_url":"https://api.github.com/repos/djfarrelly/MailDev/issues/202/events","html_url":"https://github.com/djfarrelly/MailDev/pull/202","id":290365689,"number":202,"title":"Fix #145: Attachments with the same cid","user":{"login":"GeoffreyBooth","id":456802,"avatar_url":"https://avatars2.githubusercontent.com/u/456802?v=4","gravatar_id":"","url":"https://api.github.com/users/GeoffreyBooth","html_url":"https://github.com/GeoffreyBooth","followers_url":"https://api.github.com/users/GeoffreyBooth/followers","following_url":"https://api.github.com/users/GeoffreyBooth/following{/other_user}","gists_url":"https://api.github.com/users/GeoffreyBooth/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoffreyBooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoffreyBooth/subscriptions","organizations_url":"https://api.github.com/users/GeoffreyBooth/orgs","repos_url":"https://api.github.com/users/GeoffreyBooth/repos","events_url":"https://api.github.com/users/GeoffreyBooth/events{/privacy}","received_events_url":"https://api.github.com/users/GeoffreyBooth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-01-22T06:46:41Z","updated_at":"2018-03-19T22:55:06Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/djfarrelly/MailDev/pulls/202","html_url":"https://github.com/djfarrelly/MailDev/pull/202","diff_url":"https://github.com/djfarrelly/MailDev/pull/202.diff","patch_url":"https://github.com/djfarrelly/MailDev/pull/202.patch"},"body":"Fixes #145. Currently, if two emails arrive where both emails use the same `cid` for an attachment, e.g. `<img src=\"cid:image\">`, Maildev overwrites the first attached file with the second one (and so on, if more such emails arrive). This is because Maildev saves each attachment to `tempDir/cid`, where all attachments from all emails share the same folder. This PR changes that behavior so that now attachments are saved in `tempDir/emailId/cid`, so that different emails’ attachments don’t overwrite each other.\r\n\r\nTo see the bug in action:\r\n```bash\r\ngit clone git@github.com:GeoffreyBooth/MailDev.git\r\ncd MailDev\r\n\r\n# Check out the commit where I added test data to illustrate the bug,\r\n# but before I committed the fix:\r\ngit checkout 82b6e2d80cf5ed46d100ca5b741c357a2c7b7b47\r\n\r\nnpm install\r\nnpm run dev\r\n```\r\n\r\nThen go to http://localhost:1080/ and open the messages “Where’s Tyler?” and “Big Wave Coming”. You should see the same photo in both emails, either in the preview or if you click Attachments. Checkout the end of my `attachments` branch (`git checkout attachments`) to see it fixed.\r\n\r\nAlso includes a test."},"comment":{"url":"https://api.github.com/repos/djfarrelly/MailDev/issues/comments/374412788","html_url":"https://github.com/djfarrelly/MailDev/pull/202#issuecomment-374412788","issue_url":"https://api.github.com/repos/djfarrelly/MailDev/issues/202","id":374412788,"user":{"login":"GeoffreyBooth","id":456802,"avatar_url":"https://avatars2.githubusercontent.com/u/456802?v=4","gravatar_id":"","url":"https://api.github.com/users/GeoffreyBooth","html_url":"https://github.com/GeoffreyBooth","followers_url":"https://api.github.com/users/GeoffreyBooth/followers","following_url":"https://api.github.com/users/GeoffreyBooth/following{/other_user}","gists_url":"https://api.github.com/users/GeoffreyBooth/gists{/gist_id}","starred_url":"https://api.github.com/users/GeoffreyBooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeoffreyBooth/subscriptions","organizations_url":"https://api.github.com/users/GeoffreyBooth/orgs","repos_url":"https://api.github.com/users/GeoffreyBooth/repos","events_url":"https://api.github.com/users/GeoffreyBooth/events{/privacy}","received_events_url":"https://api.github.com/users/GeoffreyBooth/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T22:55:06Z","updated_at":"2018-03-19T22:55:06Z","author_association":"NONE","body":"@djfarrelly?"}}
{"actor":{"display_login":"GeoffreyBooth"}}