{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/warehouse/issues/3580","repository_url":"https://api.github.com/repos/pypa/warehouse","labels_url":"https://api.github.com/repos/pypa/warehouse/issues/3580/labels{/name}","comments_url":"https://api.github.com/repos/pypa/warehouse/issues/3580/comments","events_url":"https://api.github.com/repos/pypa/warehouse/issues/3580/events","html_url":"https://github.com/pypa/warehouse/pull/3580","id":312243434,"number":3580,"title":"[WIP] Implement email sending via SES","user":{"login":"dstufft","id":145979,"avatar_url":"https://avatars3.githubusercontent.com/u/145979?v=4","gravatar_id":"","url":"https://api.github.com/users/dstufft","html_url":"https://github.com/dstufft","followers_url":"https://api.github.com/users/dstufft/followers","following_url":"https://api.github.com/users/dstufft/following{/other_user}","gists_url":"https://api.github.com/users/dstufft/gists{/gist_id}","starred_url":"https://api.github.com/users/dstufft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstufft/subscriptions","organizations_url":"https://api.github.com/users/dstufft/orgs","repos_url":"https://api.github.com/users/dstufft/repos","events_url":"https://api.github.com/users/dstufft/events{/privacy}","received_events_url":"https://api.github.com/users/dstufft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-07T21:10:38Z","updated_at":"2018-04-08T01:25:10Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/pypa/warehouse/pulls/3580","html_url":"https://github.com/pypa/warehouse/pull/3580","diff_url":"https://github.com/pypa/warehouse/pull/3580.diff","patch_url":"https://github.com/pypa/warehouse/pull/3580.patch"},"body":"This implements sending emails via Amazon SES. It has the following features:\r\n\r\n- [x] Implements a SESEmailSender service that sends emails and logs them to the database.\r\n- [x] Implements a Web hook that SES via SNS will call with various delivery related events.\r\n- [x] Will Unflag emails as verified when they bounce or are marked as complaint, requiring users to re-verify their emails.\r\n- [x] Provides an admin panel that will show the emails sent (omitting their body, incase the body has sensitive information in it) as well as the email status (accepted, delivered, bounced, complained) and any delivery events that were received about the email.\r\n- [x] Provides a flag on the email to indicate it has been having delivery issues.\r\n  - Long term goal of this flag is to provide better UX in the user's account management page to indicate that the reason this email is no longer verified is because of delivery issues. This PR does *not* implement that though.\r\n- [x] Cleans up logged emails after 14 days. This is to keep the table from growing unbounded (see the journals table) and also to provide a finite lifespan on any email addresses or similar that get logged into this table.\r\n- [x] Allow searching the email logs for specific addresses, etc.\r\n- [x] Allows configuring the email sending backend similarly to the way the file storage backend is configured.\r\n- [x] Handles flagging an account as having delivery problems after N transient delivery failures.\r\n- [ ] Authenticate/Validate that the web hook was actually called by SNS for the desired topic and it wasn't an attacker attempting to DoS the email handling.\r\n\r\nOverall it still needs some cleanups as well (tests need written, some hardcoded region values, error handling is broken, etc). However it has all the basic functionality!\r\n\r\nHere's some screenshots of the admin interface:\r\n\r\n<img width=\"1019\" alt=\"download 2\" src=\"https://user-images.githubusercontent.com/145979/38460367-571a7f3c-3a86-11e8-8fab-ad4aeafc67a0.png\">\r\n\r\n<img width=\"1009\" alt=\"download 1\" src=\"https://user-images.githubusercontent.com/145979/38460370-5d7d87c0-3a86-11e8-8e39-30b2b381ab3a.png\">\r\n\r\n<img width=\"1032\" alt=\"download\" src=\"https://user-images.githubusercontent.com/145979/38460371-63d24566-3a86-11e8-9cad-3c2f12e9e93c.png\">\r\n\r\n<img width=\"1010\" alt=\"download 3\" src=\"https://user-images.githubusercontent.com/145979/38460375-680898b0-3a86-11e8-9daf-12b7d6304f3c.png\">\r\n"},"comment":{"url":"https://api.github.com/repos/pypa/warehouse/issues/comments/379511388","html_url":"https://github.com/pypa/warehouse/pull/3580#issuecomment-379511388","issue_url":"https://api.github.com/repos/pypa/warehouse/issues/3580","id":379511388,"user":{"login":"dstufft","id":145979,"avatar_url":"https://avatars3.githubusercontent.com/u/145979?v=4","gravatar_id":"","url":"https://api.github.com/users/dstufft","html_url":"https://github.com/dstufft","followers_url":"https://api.github.com/users/dstufft/followers","following_url":"https://api.github.com/users/dstufft/following{/other_user}","gists_url":"https://api.github.com/users/dstufft/gists{/gist_id}","starred_url":"https://api.github.com/users/dstufft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstufft/subscriptions","organizations_url":"https://api.github.com/users/dstufft/orgs","repos_url":"https://api.github.com/users/dstufft/repos","events_url":"https://api.github.com/users/dstufft/events{/privacy}","received_events_url":"https://api.github.com/users/dstufft/received_events","type":"User","site_admin":false},"created_at":"2018-04-08T01:25:09Z","updated_at":"2018-04-08T01:25:09Z","author_association":"OWNER","body":"I've hardcoded the number of transient bounces that an email address can have before it gets flagged for re-verification to 5. I'm not sure if that's a good number or not or if that should be generally configurable or not.\r\n\r\n-  Whenever we get a soft bounce that *doesn't* occur after a delivery (i.e. not an OOTO auto-responder) increment the number of transient bounces by 1.\r\n- Whenever we get a successful email delivery, reset the number of transient bounces to 0.\r\n- Whenever the number of transient bounces is greater than 5, treat it as if the email had hard bounced and un-verify the email address.\r\n- Whenever an email gets verified (either the first time, or any subsequent times) we reset the number of transient bounces back to 0."}}
{"actor":{"display_login":"dstufft"}}