{"action":"created","issue":{"url":"https://api.github.com/repos/lumail/lumail2/issues/83","labels_url":"https://api.github.com/repos/lumail/lumail2/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/lumail/lumail2/issues/83/comments","events_url":"https://api.github.com/repos/lumail/lumail2/issues/83/events","html_url":"https://github.com/lumail/lumail2/issues/83","id":119377005,"number":83,"title":"We should be able to add attachments to outgoing mail.","user":{"login":"skx","id":735291,"avatar_url":"https://avatars.githubusercontent.com/u/735291?v=3","gravatar_id":"","url":"https://api.github.com/users/skx","html_url":"https://github.com/skx","followers_url":"https://api.github.com/users/skx/followers","following_url":"https://api.github.com/users/skx/following{/other_user}","gists_url":"https://api.github.com/users/skx/gists{/gist_id}","starred_url":"https://api.github.com/users/skx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skx/subscriptions","organizations_url":"https://api.github.com/users/skx/orgs","repos_url":"https://api.github.com/users/skx/repos","events_url":"https://api.github.com/users/skx/events{/privacy}","received_events_url":"https://api.github.com/users/skx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-29T18:46:19Z","updated_at":"2015-11-30T09:38:17Z","closed_at":null,"body":"This might take some thought.  The trivial thing to do is to prompt for them, in the post-compose loop.  But from there how do we add them to the message?\r\n\r\nI think we probably need to create a CMessage object from the temporary file we've already populated, which is simple, and then allow an attachment to be created and added to it, from Lua.  \r\n\r\nWe will need to ensure we add the attachment post-confirm though, because otherwise any `re(e)dit` operation will see the MIME message, and we won't want that.\r\n\r\nHopefully something like this:\r\n\r\n       - Create a message form the temporary-file\r\n       x = Message.new( \"path/tmp/tmpfile\")\r\n\r\n        - Add a pair of attachments\r\n       x.add_attachment(  \"/etc/motd\" ) \r\n       x.add_attachment(  \"/etc/passwd\" ) \r\n\r\nThe issue really is if we allow this, which is simple, or whether we allow constructing CMessagePart objects.  I'm leaning toward simple right now."},"comment":{"url":"https://api.github.com/repos/lumail/lumail2/issues/comments/160574265","html_url":"https://github.com/lumail/lumail2/issues/83#issuecomment-160574265","issue_url":"https://api.github.com/repos/lumail/lumail2/issues/83","id":160574265,"user":{"login":"skx","id":735291,"avatar_url":"https://avatars.githubusercontent.com/u/735291?v=3","gravatar_id":"","url":"https://api.github.com/users/skx","html_url":"https://github.com/skx","followers_url":"https://api.github.com/users/skx/followers","following_url":"https://api.github.com/users/skx/following{/other_user}","gists_url":"https://api.github.com/users/skx/gists{/gist_id}","starred_url":"https://api.github.com/users/skx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skx/subscriptions","organizations_url":"https://api.github.com/users/skx/orgs","repos_url":"https://api.github.com/users/skx/repos","events_url":"https://api.github.com/users/skx/events{/privacy}","received_events_url":"https://api.github.com/users/skx/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T09:38:17Z","updated_at":"2015-11-30T09:38:17Z","body":"This is sample code which does not yet work, but which I expect to in the future:\r\n\r\n[add_attachment.lua.txt](https://github.com/lumail/lumail2/files/47122/add_attachment.lua.txt)\r\n"}}