{"action":"created","issue":{"url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/828","repository_url":"https://api.github.com/repos/swiftmailer/swiftmailer","labels_url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/828/comments","events_url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/828/events","html_url":"https://github.com/swiftmailer/swiftmailer/issues/828","id":191005641,"number":828,"title":"Swiftmailer does not comply with SMTP specs when SMTP servers' response to swiftmailers command takes more than 30 seconds (default timeout)","user":{"login":"adminblogger","id":20477825,"avatar_url":"https://avatars.githubusercontent.com/u/20477825?v=3","gravatar_id":"","url":"https://api.github.com/users/adminblogger","html_url":"https://github.com/adminblogger","followers_url":"https://api.github.com/users/adminblogger/followers","following_url":"https://api.github.com/users/adminblogger/following{/other_user}","gists_url":"https://api.github.com/users/adminblogger/gists{/gist_id}","starred_url":"https://api.github.com/users/adminblogger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adminblogger/subscriptions","organizations_url":"https://api.github.com/users/adminblogger/orgs","repos_url":"https://api.github.com/users/adminblogger/repos","events_url":"https://api.github.com/users/adminblogger/events{/privacy}","received_events_url":"https://api.github.com/users/adminblogger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-22T13:32:24Z","updated_at":"2016-11-23T14:52:33Z","closed_at":null,"body":"## Exception occurred while flushing email queue: Expected response code 250 but got code \"354\", with message \"354 End data with <CR><LF>.<CR><LF> \"\r\n\r\nHi,\r\n\r\nwe have some reproducible issues with swiftmailer talking to a SMTP server.\r\n\r\nThe problem occurs when swiftmailer has sent the last dot `.` to end the `DATA` block and the server then takes more than 30 seconds to respond with `250 2.0.0 Ok: queued as ...`.\r\n\r\nSwiftmailer will wait 30 seconds after sending the dot `.` and then tries to resend the message a second time over the same SMTP connection, just sending a new \"MAIL FROM\" command, without waiting for reply to the DATA command from the server.\r\n\r\nWhen the reply then comes, swiftmail get's confused and interprets that response as a reply for the MAIL FROM when instead it was the reply for the DATA command.\r\n\r\n## SMTP Transcript\r\n\r\n```\r\n< 220 server.example.com\r\n\r\n> EHLO client.example.com\r\n\r\n< 250-server.example.com\r\n< 250-PIPELINING\r\n< 250-SIZE 26214400\r\n< 250-ETRN\r\n< 250-STARTTLS\r\n< 250-ENHANCEDSTATUSCODES\r\n< 250-8BITMIME\r\n< 250 DSN\r\n\r\n> MAIL FROM:<noreply@example.com>\r\n\r\n< 250 2.1.0 Ok\r\n\r\n> RCPT TO:<someone@example.com>\r\n\r\n< 250 2.1.5 Ok\r\n\r\n> DATA\r\n\r\n< 354 End data with <CR><LF>.<CR><LF>\r\n\r\n> Message-ID: <xxx@example.com>\r\n> Date: Tue, 22 Nov 2016 12:53:06 +0100\r\n> Subject: ...\r\n> From: <noreply@example.com>\r\n> To: someone@example.com\r\n> MIME-Version: 1.0\r\n> Content-Type: multipart/related;\r\n>  boundary=\"_=_swift_v4_1479815586_83fdb3ffb1f26eb2c5dabcb986f3b86c_=_\"\r\n> \r\n> [..]\r\n> \r\n> --_=_swift_v4_1479815586_83fdb3ffb1f26eb2c5dabcb986f3b86c_=_--\r\n> \r\n> .\r\n\r\n(at this point tcpdump shows a delay of 30 seconds)\r\n\r\n> MAIL FROM:<noreply@example.com>\r\n\r\n(delay of 15 seconds)\r\n\r\n< 250 2.0.0 Ok: queued as 615B88A6D10\r\n\r\n> RCPT TO:<someone@example.com>\r\n\r\n< 250 2.1.0 Ok\r\n\r\n> DATA\r\n\r\n< 250 2.1.5 Ok\r\n\r\n> 354 End data with <CR><LF>.<CR><LF>\r\n> MAIL FROM:<noreply@example.com>\r\n```\r\n\r\nA workaround would be to increase the timeout in swiftmailer to accommodate for slow SMTP servers. 45 seconds for a reply is not normal, I know, but this shouldn't end in swiftmailer using the still open TCP connection for trying again and ignoring the fact that the server did not respond yet."},"comment":{"url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/comments/262534444","html_url":"https://github.com/swiftmailer/swiftmailer/issues/828#issuecomment-262534444","issue_url":"https://api.github.com/repos/swiftmailer/swiftmailer/issues/828","id":262534444,"user":{"login":"xdecock","id":49789,"avatar_url":"https://avatars.githubusercontent.com/u/49789?v=3","gravatar_id":"","url":"https://api.github.com/users/xdecock","html_url":"https://github.com/xdecock","followers_url":"https://api.github.com/users/xdecock/followers","following_url":"https://api.github.com/users/xdecock/following{/other_user}","gists_url":"https://api.github.com/users/xdecock/gists{/gist_id}","starred_url":"https://api.github.com/users/xdecock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdecock/subscriptions","organizations_url":"https://api.github.com/users/xdecock/orgs","repos_url":"https://api.github.com/users/xdecock/repos","events_url":"https://api.github.com/users/xdecock/events{/privacy}","received_events_url":"https://api.github.com/users/xdecock/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T14:52:33Z","updated_at":"2016-11-23T14:52:33Z","body":"Can you provide a stacktrace? i can't see where swiftmailer will by itself\nretry anything (being a library)\n\n2016-11-23 15:38 GMT+01:00 @adm1nblogger <notifications@github.com>:\n\n> Thinking more about this issue I would rather not \"fix\" this by upping the\n> timeout.\n>\n> The issue here is the completely wrong concept of using the already open\n> SMTP connection to start a new MAIL FROM command without\n>\n> a) waiting for the SMTP servers reply to the client command sent\n> immediately before\n> b) sending a RSET\n>\n> We fixed the issue with the long delay in the SMTP server - but this is\n> not the issue here. The concept how swiftmailer talks to the SMTP server\n> and handles delays is flawed.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/swiftmailer/swiftmailer/issues/828#issuecomment-262529375>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AADCfeRusCM01MphGPm145zvx3yo1GySks5rBE_ggaJpZM4K5bgW>\n> .\n>\n\n\n\n-- \nXavier De Cock\nGPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B\nGPG Id: 0xE7A50C1B\n"}}
{"actor":{"display_login":"xdecock"}}