{"action":"created","comment":{"url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/comments/147434654","pull_request_review_id":72533617,"id":147434654,"diff_hunk":"@@ -63,6 +70,99 @@ def mx_scan(domain):\n         handle_error(\"[MX]\", domain, error)\n \n \n+def starttls_scan(domain, smtp_timeout, smtp_localhost, smtp_ports, smtp_cache):\n+    \"\"\"\n+    Scan a domain to see if it supports SMTP and supports STARTTLS.\n+\n+    Scan a domain to see if it supports SMTP.  If the domain does support\n+    SMTP, a further check will be done to see if it supports STARTTLS.\n+    All results are stored inside the Domain object that is passed in\n+    as a parameter.\n+\n+    Parameters\n+    ----------\n+    domain : Domain\n+        The Domain to be tested.\n+        \n+    smtp_timeout : int\n+        The SMTP connection timeout in seconds.\n+\n+    smtp_localhost : str\n+        The hostname to use when connecting to SMTP servers.\n+\n+    smtp_ports : obj:`list` of :obj:`str`\n+        A comma-delimited list of ports at which to look for SMTP servers.  \n+        \n+    smtp_cache : bool\n+        Whether or not to cache SMTP results.\n+    \"\"\"\n+    for mail_server in domain.mail_servers:\n+        for port in smtp_ports:\n+            if port not in domain.ports_tested:\n+                domain.ports_tested.append(port)","path":"trustymail/trustymail.py","position":66,"original_position":66,"commit_id":"0ffa888737de4abb99dc763a7e1ca8d2053d9737","original_commit_id":"0ffa888737de4abb99dc763a7e1ca8d2053d9737","user":{"login":"IanLee1521","id":828452,"avatar_url":"https://avatars0.githubusercontent.com/u/828452?v=4","gravatar_id":"","url":"https://api.github.com/users/IanLee1521","html_url":"https://github.com/IanLee1521","followers_url":"https://api.github.com/users/IanLee1521/followers","following_url":"https://api.github.com/users/IanLee1521/following{/other_user}","gists_url":"https://api.github.com/users/IanLee1521/gists{/gist_id}","starred_url":"https://api.github.com/users/IanLee1521/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanLee1521/subscriptions","organizations_url":"https://api.github.com/users/IanLee1521/orgs","repos_url":"https://api.github.com/users/IanLee1521/repos","events_url":"https://api.github.com/users/IanLee1521/events{/privacy}","received_events_url":"https://api.github.com/users/IanLee1521/received_events","type":"User","site_admin":false},"body":"I wonder if it would be clearer to have `domain.ports_tested` be a `set` rather than a `list` and then you could just do: `domain.ports_tested.add(port)` and you don't need to do the conditional check of if it's in there.","created_at":"2017-10-27T15:00:46Z","updated_at":"2017-10-27T15:51:41Z","html_url":"https://github.com/dhs-ncats/trustymail/pull/8#discussion_r147434654","pull_request_url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/comments/147434654"},"html":{"href":"https://github.com/dhs-ncats/trustymail/pull/8#discussion_r147434654"},"pull_request":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8","id":144538669,"html_url":"https://github.com/dhs-ncats/trustymail/pull/8","diff_url":"https://github.com/dhs-ncats/trustymail/pull/8.diff","patch_url":"https://github.com/dhs-ncats/trustymail/pull/8.patch","issue_url":"https://api.github.com/repos/dhs-ncats/trustymail/issues/8","number":8,"state":"open","locked":false,"title":"Added support for STARTTLS.","user":{"login":"jsf9k","id":5521725,"avatar_url":"https://avatars0.githubusercontent.com/u/5521725?v=4","gravatar_id":"","url":"https://api.github.com/users/jsf9k","html_url":"https://github.com/jsf9k","followers_url":"https://api.github.com/users/jsf9k/followers","following_url":"https://api.github.com/users/jsf9k/following{/other_user}","gists_url":"https://api.github.com/users/jsf9k/gists{/gist_id}","starred_url":"https://api.github.com/users/jsf9k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsf9k/subscriptions","organizations_url":"https://api.github.com/users/jsf9k/orgs","repos_url":"https://api.github.com/users/jsf9k/repos","events_url":"https://api.github.com/users/jsf9k/events{/privacy}","received_events_url":"https://api.github.com/users/jsf9k/received_events","type":"User","site_admin":false},"body":"This PR pertains to issue #5.\r\n\r\nThe CSV output now includes ~~two~~several additional columns.  \"Mail Server Ports Tested\" contains a comma-delimited list of the ports that were tested.  \"Mail Server Is Listening\" states whether a given mail server (which comes from an MX record) and port combination is listening for TCP connections. \r\n\"Mail Server Supports SMTP\", states whether a given mail server and port combination really appears to be an SMTP server.  \"Mail Server Supports STARTTLS\" indicates whether the mail server and port combination supports STARTTLS.  I've run most of current-federal.csv though the code, and it appears to be working.\r\n\r\n~~The DNS timeout serves double duty as the SMTP connection timeout\r\nvalue as well.~~","created_at":"2017-10-03T21:55:36Z","updated_at":"2017-10-27T15:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36edc3502bd3ef1b062e073cc04083470497fe29","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8/commits","review_comments_url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8/comments","review_comment_url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dhs-ncats/trustymail/issues/8/comments","statuses_url":"https://api.github.com/repos/dhs-ncats/trustymail/statuses/0ffa888737de4abb99dc763a7e1ca8d2053d9737","head":{"label":"jsf9k:feature/check_for_starttls","ref":"feature/check_for_starttls","sha":"0ffa888737de4abb99dc763a7e1ca8d2053d9737","user":{"login":"jsf9k","id":5521725,"avatar_url":"https://avatars0.githubusercontent.com/u/5521725?v=4","gravatar_id":"","url":"https://api.github.com/users/jsf9k","html_url":"https://github.com/jsf9k","followers_url":"https://api.github.com/users/jsf9k/followers","following_url":"https://api.github.com/users/jsf9k/following{/other_user}","gists_url":"https://api.github.com/users/jsf9k/gists{/gist_id}","starred_url":"https://api.github.com/users/jsf9k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsf9k/subscriptions","organizations_url":"https://api.github.com/users/jsf9k/orgs","repos_url":"https://api.github.com/users/jsf9k/repos","events_url":"https://api.github.com/users/jsf9k/events{/privacy}","received_events_url":"https://api.github.com/users/jsf9k/received_events","type":"User","site_admin":false},"repo":{"id":105546927,"name":"trustymail","full_name":"jsf9k/trustymail","owner":{"login":"jsf9k","id":5521725,"avatar_url":"https://avatars0.githubusercontent.com/u/5521725?v=4","gravatar_id":"","url":"https://api.github.com/users/jsf9k","html_url":"https://github.com/jsf9k","followers_url":"https://api.github.com/users/jsf9k/followers","following_url":"https://api.github.com/users/jsf9k/following{/other_user}","gists_url":"https://api.github.com/users/jsf9k/gists{/gist_id}","starred_url":"https://api.github.com/users/jsf9k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsf9k/subscriptions","organizations_url":"https://api.github.com/users/jsf9k/orgs","repos_url":"https://api.github.com/users/jsf9k/repos","events_url":"https://api.github.com/users/jsf9k/events{/privacy}","received_events_url":"https://api.github.com/users/jsf9k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jsf9k/trustymail","description":"Scan domains and return data based on trustworthy email best practices","fork":true,"url":"https://api.github.com/repos/jsf9k/trustymail","forks_url":"https://api.github.com/repos/jsf9k/trustymail/forks","keys_url":"https://api.github.com/repos/jsf9k/trustymail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsf9k/trustymail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsf9k/trustymail/teams","hooks_url":"https://api.github.com/repos/jsf9k/trustymail/hooks","issue_events_url":"https://api.github.com/repos/jsf9k/trustymail/issues/events{/number}","events_url":"https://api.github.com/repos/jsf9k/trustymail/events","assignees_url":"https://api.github.com/repos/jsf9k/trustymail/assignees{/user}","branches_url":"https://api.github.com/repos/jsf9k/trustymail/branches{/branch}","tags_url":"https://api.github.com/repos/jsf9k/trustymail/tags","blobs_url":"https://api.github.com/repos/jsf9k/trustymail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsf9k/trustymail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsf9k/trustymail/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsf9k/trustymail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsf9k/trustymail/statuses/{sha}","languages_url":"https://api.github.com/repos/jsf9k/trustymail/languages","stargazers_url":"https://api.github.com/repos/jsf9k/trustymail/stargazers","contributors_url":"https://api.github.com/repos/jsf9k/trustymail/contributors","subscribers_url":"https://api.github.com/repos/jsf9k/trustymail/subscribers","subscription_url":"https://api.github.com/repos/jsf9k/trustymail/subscription","commits_url":"https://api.github.com/repos/jsf9k/trustymail/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsf9k/trustymail/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsf9k/trustymail/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsf9k/trustymail/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsf9k/trustymail/contents/{+path}","compare_url":"https://api.github.com/repos/jsf9k/trustymail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsf9k/trustymail/merges","archive_url":"https://api.github.com/repos/jsf9k/trustymail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsf9k/trustymail/downloads","issues_url":"https://api.github.com/repos/jsf9k/trustymail/issues{/number}","pulls_url":"https://api.github.com/repos/jsf9k/trustymail/pulls{/number}","milestones_url":"https://api.github.com/repos/jsf9k/trustymail/milestones{/number}","notifications_url":"https://api.github.com/repos/jsf9k/trustymail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsf9k/trustymail/labels{/name}","releases_url":"https://api.github.com/repos/jsf9k/trustymail/releases{/id}","deployments_url":"https://api.github.com/repos/jsf9k/trustymail/deployments","created_at":"2017-10-02T14:52:02Z","updated_at":"2017-10-02T14:52:04Z","pushed_at":"2017-10-27T14:35:29Z","git_url":"git://github.com/jsf9k/trustymail.git","ssh_url":"git@github.com:jsf9k/trustymail.git","clone_url":"https://github.com/jsf9k/trustymail.git","svn_url":"https://github.com/jsf9k/trustymail","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dhs-ncats:master","ref":"master","sha":"038ae1b7047b56e1beea823430a33a48b0f2a6da","user":{"login":"dhs-ncats","id":18539691,"avatar_url":"https://avatars2.githubusercontent.com/u/18539691?v=4","gravatar_id":"","url":"https://api.github.com/users/dhs-ncats","html_url":"https://github.com/dhs-ncats","followers_url":"https://api.github.com/users/dhs-ncats/followers","following_url":"https://api.github.com/users/dhs-ncats/following{/other_user}","gists_url":"https://api.github.com/users/dhs-ncats/gists{/gist_id}","starred_url":"https://api.github.com/users/dhs-ncats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhs-ncats/subscriptions","organizations_url":"https://api.github.com/users/dhs-ncats/orgs","repos_url":"https://api.github.com/users/dhs-ncats/repos","events_url":"https://api.github.com/users/dhs-ncats/events{/privacy}","received_events_url":"https://api.github.com/users/dhs-ncats/received_events","type":"Organization","site_admin":false},"repo":{"id":95620558,"name":"trustymail","full_name":"dhs-ncats/trustymail","owner":{"login":"dhs-ncats","id":18539691,"avatar_url":"https://avatars2.githubusercontent.com/u/18539691?v=4","gravatar_id":"","url":"https://api.github.com/users/dhs-ncats","html_url":"https://github.com/dhs-ncats","followers_url":"https://api.github.com/users/dhs-ncats/followers","following_url":"https://api.github.com/users/dhs-ncats/following{/other_user}","gists_url":"https://api.github.com/users/dhs-ncats/gists{/gist_id}","starred_url":"https://api.github.com/users/dhs-ncats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhs-ncats/subscriptions","organizations_url":"https://api.github.com/users/dhs-ncats/orgs","repos_url":"https://api.github.com/users/dhs-ncats/repos","events_url":"https://api.github.com/users/dhs-ncats/events{/privacy}","received_events_url":"https://api.github.com/users/dhs-ncats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dhs-ncats/trustymail","description":"Scan domains and return data based on trustworthy email best practices","fork":false,"url":"https://api.github.com/repos/dhs-ncats/trustymail","forks_url":"https://api.github.com/repos/dhs-ncats/trustymail/forks","keys_url":"https://api.github.com/repos/dhs-ncats/trustymail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhs-ncats/trustymail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhs-ncats/trustymail/teams","hooks_url":"https://api.github.com/repos/dhs-ncats/trustymail/hooks","issue_events_url":"https://api.github.com/repos/dhs-ncats/trustymail/issues/events{/number}","events_url":"https://api.github.com/repos/dhs-ncats/trustymail/events","assignees_url":"https://api.github.com/repos/dhs-ncats/trustymail/assignees{/user}","branches_url":"https://api.github.com/repos/dhs-ncats/trustymail/branches{/branch}","tags_url":"https://api.github.com/repos/dhs-ncats/trustymail/tags","blobs_url":"https://api.github.com/repos/dhs-ncats/trustymail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhs-ncats/trustymail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhs-ncats/trustymail/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhs-ncats/trustymail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhs-ncats/trustymail/statuses/{sha}","languages_url":"https://api.github.com/repos/dhs-ncats/trustymail/languages","stargazers_url":"https://api.github.com/repos/dhs-ncats/trustymail/stargazers","contributors_url":"https://api.github.com/repos/dhs-ncats/trustymail/contributors","subscribers_url":"https://api.github.com/repos/dhs-ncats/trustymail/subscribers","subscription_url":"https://api.github.com/repos/dhs-ncats/trustymail/subscription","commits_url":"https://api.github.com/repos/dhs-ncats/trustymail/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhs-ncats/trustymail/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhs-ncats/trustymail/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhs-ncats/trustymail/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhs-ncats/trustymail/contents/{+path}","compare_url":"https://api.github.com/repos/dhs-ncats/trustymail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhs-ncats/trustymail/merges","archive_url":"https://api.github.com/repos/dhs-ncats/trustymail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhs-ncats/trustymail/downloads","issues_url":"https://api.github.com/repos/dhs-ncats/trustymail/issues{/number}","pulls_url":"https://api.github.com/repos/dhs-ncats/trustymail/pulls{/number}","milestones_url":"https://api.github.com/repos/dhs-ncats/trustymail/milestones{/number}","notifications_url":"https://api.github.com/repos/dhs-ncats/trustymail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhs-ncats/trustymail/labels{/name}","releases_url":"https://api.github.com/repos/dhs-ncats/trustymail/releases{/id}","deployments_url":"https://api.github.com/repos/dhs-ncats/trustymail/deployments","created_at":"2017-06-28T02:29:03Z","updated_at":"2017-10-27T01:06:52Z","pushed_at":"2017-10-27T14:35:30Z","git_url":"git://github.com/dhs-ncats/trustymail.git","ssh_url":"git@github.com:dhs-ncats/trustymail.git","clone_url":"https://github.com/dhs-ncats/trustymail.git","svn_url":"https://github.com/dhs-ncats/trustymail","homepage":null,"size":28,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":8,"forks":7,"open_issues":8,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8"},"html":{"href":"https://github.com/dhs-ncats/trustymail/pull/8"},"issue":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/issues/8"},"comments":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/dhs-ncats/trustymail/statuses/0ffa888737de4abb99dc763a7e1ca8d2053d9737"}},"author_association":"NONE"}}
{"actor":{"display_login":"IanLee1521"}}