{"action":"created","issue":{"url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/1","repository_url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail","labels_url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/1/comments","events_url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/1/events","html_url":"https://github.com/YAO-yet-another-organization/wittymail/issues/1","id":378606075,"node_id":"MDU6SXNzdWUzNzg2MDYwNzU=","number":1,"title":"Detect bounced emails","user":{"login":"ajaynair","id":1824019,"node_id":"MDQ6VXNlcjE4MjQwMTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1824019?v=4","gravatar_id":"","url":"https://api.github.com/users/ajaynair","html_url":"https://github.com/ajaynair","followers_url":"https://api.github.com/users/ajaynair/followers","following_url":"https://api.github.com/users/ajaynair/following{/other_user}","gists_url":"https://api.github.com/users/ajaynair/gists{/gist_id}","starred_url":"https://api.github.com/users/ajaynair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajaynair/subscriptions","organizations_url":"https://api.github.com/users/ajaynair/orgs","repos_url":"https://api.github.com/users/ajaynair/repos","events_url":"https://api.github.com/users/ajaynair/events{/privacy}","received_events_url":"https://api.github.com/users/ajaynair/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-08T07:14:57Z","updated_at":"2018-11-08T14:00:10Z","closed_at":null,"author_association":"NONE","body":"Can we use this? \r\nimport poplib\r\nfrom email import parser\r\n\r\n#breaks with if this is left out for some reason (MAXLINE is set too low by default.)\r\npoplib._MAXLINE=20480\r\n\r\npop_conn = poplib.POP3_SSL('your pop server',port)\r\npop_conn.user(username)\r\npop_conn.pass_(password)\r\n#Get messages from server:\r\nmessages = [pop_conn.retr(i) for i in range(1, len(pop_conn.list()[1]) + 1)]\r\n\r\n# Concat message pieces:\r\nmessages = [\"\\n\".join(mssg[1]) for mssg in messages]\r\n#Parse message intom an email object:\r\nmessages = [parser.Parser().parsestr(mssg) for mssg in messages]\r\nfor message in messages:\r\n    if \"Undeliverable\" in message['subject']:\r\n\r\n        print message['subject']\r\n        for part in message.walk():\r\n            if part.get_content_type():\r\n                body = str(part.get_payload(decode=True))\r\n\r\n                bounced = re.findall('[a-z0-9-_\\.]+@[a-z0-9-\\.]+\\.[a-z\\.]{2,5}',body)\r\n                if bounced:\r\n\r\n                    bounced = str(bounced[0].replace(username,''))\r\n                    if bounced == '':\r\n                        break\r\n\r\n                    print bounced "},"comment":{"url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/comments/437002836","html_url":"https://github.com/YAO-yet-another-organization/wittymail/issues/1#issuecomment-437002836","issue_url":"https://api.github.com/repos/YAO-yet-another-organization/wittymail/issues/1","id":437002836,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzAwMjgzNg==","user":{"login":"dotbugfix","id":1899855,"node_id":"MDQ6VXNlcjE4OTk4NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1899855?v=4","gravatar_id":"","url":"https://api.github.com/users/dotbugfix","html_url":"https://github.com/dotbugfix","followers_url":"https://api.github.com/users/dotbugfix/followers","following_url":"https://api.github.com/users/dotbugfix/following{/other_user}","gists_url":"https://api.github.com/users/dotbugfix/gists{/gist_id}","starred_url":"https://api.github.com/users/dotbugfix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotbugfix/subscriptions","organizations_url":"https://api.github.com/users/dotbugfix/orgs","repos_url":"https://api.github.com/users/dotbugfix/repos","events_url":"https://api.github.com/users/dotbugfix/events{/privacy}","received_events_url":"https://api.github.com/users/dotbugfix/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T14:00:10Z","updated_at":"2018-11-08T14:00:10Z","author_association":"COLLABORATOR","body":"Hmm, this is basically reading emails in the account - bad for privacy! Maybe there is a way to 'test' email delivery to a recipient's mailbox, similar to traceroute?"}}
{"actor":{"display_login":"dotbugfix"}}