{"action":"created","issue":{"url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/1148","labels_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/1148/labels{/name}","comments_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/1148/comments","events_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/1148/events","html_url":"https://github.com/sandstorm-io/sandstorm/issues/1148","id":116139854,"number":1148,"title":"error sending email with Mailgun","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-10T16:13:45Z","updated_at":"2015-11-10T16:51:31Z","closed_at":null,"body":"I'm trying to send email from a RoundCube grain on a Sandstorm server using Mailgun for outgoing email. I'm pretty sure all of this worked without a problem as of a month or two ago (and it still seems to work fine on Oasis). Now when I try to send, RoundCube pops up a modal saying \"An error occurred!\" and I see the following in my sandstorm.log:\r\n\r\n```\r\nError sending e-mail: DeliveryError: Message delivery failed: 500 Error: bad syntax\r\n    at Object.Future.wait (/programs/server/node_modules/fibers/future.js:398:15)\r\n    at smtpSend (packages/sandstorm-email/email.js:101:1)\r\n    at Object.SandstormEmail.rawSend (packages/sandstorm-email/email.js:176:1)\r\n    at app/server/drivers/mail.js:282:20\r\n    at app/server/proxy.js:111:17\r\n    at app/server/proxy.js:103:3\r\n    at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)\r\n    - - - - -\r\n500 Command not implemented\r\n    at SMTPConnectionPool._onConnectionReady (/programs/server/npm/sandstorm-email/node_modules/simplesmtp/lib/pool.js:287:21)\r\n    at SMTPClient.emit (events.js:98:17)\r\n    at SMTPClient._actionStream (/programs/server/npm/sandstorm-email/node_modules/simplesmtp/lib/client.js:946:14)\r\n    at SMTPClient._onData (/programs/server/npm/sandstorm-email/node_modules/simplesmtp/lib/client.js:329:29)\r\n    at CleartextStream.emit (events.js:95:17)\r\n    at CleartextStream.<anonymous> (_stream_readable.js:765:14)\r\n    at CleartextStream.emit (events.js:92:17)\r\n    at emitReadable_ (_stream_readable.js:427:10)\r\n    at _stream_readable.js:420:7\r\n    at process._tickCallback (node.js:442:13)\r\n```\r\n\r\nOddly, the message does actually reach the intended recipient. So I end up in a bad state when my RoundCube client thinks that the send failed, but it really succeeded.\r\n\r\nThe MailComposer object, as passed to `smtpSend()`, looks like:\r\n\r\n```\r\n{\r\n    \"_alternatives\": [],\r\n    \"_attachments\": [],\r\n    \"_cacheOutput\": false,\r\n    \"_currentStream\": false,\r\n    \"_dkim\": false,\r\n    \"_envelope\": {\r\n        \"from\": [\r\n            \"0j1lxpsvh1bk8ayq2lff@sandstorm-lithium.dwrensha.ws\"\r\n        ],\r\n        \"stamp\": [\r\n            \"\",\r\n            \"\"\r\n        ],\r\n        \"to\": [\r\n            \"david@sandstorm.io\"\r\n        ],\r\n        \"userDefined\": true\r\n    },\r\n    \"_events\": {},\r\n    \"_gencounter\": 0,\r\n    \"_headers\": {\r\n        \"Date\": \"Tue, 10 Nov 2015 16:04:45 GMT\",\r\n        \"Message-Id\": \"<d6d921f21cc41247d1890363c472f35f@63d551d2944f4cc2eb9695209a3a17f5.sandstorm-lithium.dwrensha.ws>\"\r\n    },\r\n    \"_lineEnding\": \"\\r\\n\",\r\n    \"_maxListeners\": 10,\r\n    \"_message\": {\r\n        \"bcc\": \"\",\r\n        \"body\": \"hello?\\r\\n.\\r\\n\",\r\n        \"cc\": \"\",\r\n        \"envelope\": {\r\n            \"from\": \"0j1lxpsvh1bk8ayq2lff@sandstorm-lithium.dwrensha.ws\",\r\n            \"stamp\": \"Postage paid, Par Avion\",\r\n            \"to\": [\r\n                \"david@sandstorm.io\"\r\n            ]\r\n        },\r\n        \"from\": \"\\\"Alice Dev Admin\\\" <0j1lxpsvh1bk8ayq2lff@sandstorm-lithium.dwrensha.ws>\",\r\n        \"replyTo\": \"\",\r\n        \"subject\": \"testing\",\r\n        \"to\": \"david@sandstorm.io\"\r\n    },\r\n    \"_outputBuffer\": \"\",\r\n    \"_relatedAttachments\": [],\r\n    \"domain\": null,\r\n    \"options\": {\r\n        \"charset\": \"utf-8\",\r\n        \"identityString\": \"mailcomposer\"\r\n    },\r\n    \"readable\": true\r\n}\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/comments/155484118","html_url":"https://github.com/sandstorm-io/sandstorm/issues/1148#issuecomment-155484118","issue_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/1148","id":155484118,"user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T16:51:31Z","updated_at":"2015-11-10T16:51:31Z","body":"Values for the `body` field that succeed: `[\"\", \"a\", \"..\", \"\\r\\n\", \"a.\\r\\n\", \"a.\\r\\n\\r\\n\", \"..\\r\\n\"]`\r\nValues for the `body` field that fail: `[\".\", \"\\r\\n.\" \".\\r\\n\", \".\\r\\n\\r\\n\"]`\r\n\r\nIt's looking to me like the problem is lines that consist only of \".\""}}