{"action":"reopened","number":2624,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624","id":34662744,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/2624","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/2624.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/2624.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2624","number":2624,"state":"open","locked":false,"title":"[Ready For Review] Feature/separate spam assassin service","user":{"login":"himanshuo","id":5808841,"avatar_url":"https://avatars.githubusercontent.com/u/5808841?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshuo","html_url":"https://github.com/himanshuo","followers_url":"https://api.github.com/users/himanshuo/followers","following_url":"https://api.github.com/users/himanshuo/following{/other_user}","gists_url":"https://api.github.com/users/himanshuo/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshuo/subscriptions","organizations_url":"https://api.github.com/users/himanshuo/orgs","repos_url":"https://api.github.com/users/himanshuo/repos","events_url":"https://api.github.com/users/himanshuo/events{/privacy}","received_events_url":"https://api.github.com/users/himanshuo/received_events","type":"User","site_admin":false},"body":"<h1>Purpose</h1>\r\nThis standalone web service allows people to use Spam Assassin for more generic content. In the OSF, this will be used for determining if a comment is spam and determining whether a project is spam (when someone tries to make a project public). There will be a separate PR for the code that integrates with the OSF. This service can also be used for other purposes thus there is extra functionality that is not required for OSF integration.  \r\n\r\nThe code is on https://github.com/himanshuo/spamassassin/tree/master/tornado\r\n\r\n<h1>How does the web service work? (also described on on the github page)</h1>\r\nThis service is written in Tornado. Spam Assassin must be installed and made a daemon to make this work. The service simply calls the bash spamc command with the appropriate parameters. The result is then parsed to determine whether the message is spam or ham. The output of the service is simply SPAM or HAM, as appropriate. \r\n\r\nThe service basically converts the user input into an email message. The input should be json key-value pairs. All key's that are not 'message' will become headers for this email. The 'message' key-value pair will be the content of the email. \r\n\r\nIn addition, the service allows users to send in a message to train spam assassin. It parses the message as noted above, but additionally requires a 'is_spam' key to determine whether to teach spam assassin whether the message is spam or not. Just as above, a process object is created. This time, however, the process object calls the call_sa_learn.sh script which then calls the sa-learn command. This extra level of indirection is due to the fact that sa-learn requires higher user privileges. This was the suggested solution found online (noted in code, along with a link).\r\n\r\nA user can optionally get a full report of why whatever decision was made. A user can also optionally send in a file instead of json key-value pairs for both teaching and  \r\n\r\n \r\n\r\n<h1>Side Effects</h1>\r\nAdded an extra settings in this PR that allows people to use or not use this service. It can be ignored as this will be in the ","created_at":"2015-05-04T18:44:24Z","updated_at":"2015-12-02T01:04:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"131e9f3acac1f156027740ca41a417237aee431b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2624/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/2575071b4fa25faf2d9c5fb665a112e3dbbbcc12","head":{"label":"himanshuo:feature/separate_spam_assassin_service","ref":"feature/separate_spam_assassin_service","sha":"2575071b4fa25faf2d9c5fb665a112e3dbbbcc12","user":{"login":"himanshuo","id":5808841,"avatar_url":"https://avatars.githubusercontent.com/u/5808841?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshuo","html_url":"https://github.com/himanshuo","followers_url":"https://api.github.com/users/himanshuo/followers","following_url":"https://api.github.com/users/himanshuo/following{/other_user}","gists_url":"https://api.github.com/users/himanshuo/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshuo/subscriptions","organizations_url":"https://api.github.com/users/himanshuo/orgs","repos_url":"https://api.github.com/users/himanshuo/repos","events_url":"https://api.github.com/users/himanshuo/events{/privacy}","received_events_url":"https://api.github.com/users/himanshuo/received_events","type":"User","site_admin":false},"repo":{"id":33099847,"name":"osf.io","full_name":"himanshuo/osf.io","owner":{"login":"himanshuo","id":5808841,"avatar_url":"https://avatars.githubusercontent.com/u/5808841?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshuo","html_url":"https://github.com/himanshuo","followers_url":"https://api.github.com/users/himanshuo/followers","following_url":"https://api.github.com/users/himanshuo/following{/other_user}","gists_url":"https://api.github.com/users/himanshuo/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshuo/subscriptions","organizations_url":"https://api.github.com/users/himanshuo/orgs","repos_url":"https://api.github.com/users/himanshuo/repos","events_url":"https://api.github.com/users/himanshuo/events{/privacy}","received_events_url":"https://api.github.com/users/himanshuo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/himanshuo/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/himanshuo/osf.io","forks_url":"https://api.github.com/repos/himanshuo/osf.io/forks","keys_url":"https://api.github.com/repos/himanshuo/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/himanshuo/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/himanshuo/osf.io/teams","hooks_url":"https://api.github.com/repos/himanshuo/osf.io/hooks","issue_events_url":"https://api.github.com/repos/himanshuo/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/himanshuo/osf.io/events","assignees_url":"https://api.github.com/repos/himanshuo/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/himanshuo/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/himanshuo/osf.io/tags","blobs_url":"https://api.github.com/repos/himanshuo/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/himanshuo/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/himanshuo/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/himanshuo/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/himanshuo/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/himanshuo/osf.io/languages","stargazers_url":"https://api.github.com/repos/himanshuo/osf.io/stargazers","contributors_url":"https://api.github.com/repos/himanshuo/osf.io/contributors","subscribers_url":"https://api.github.com/repos/himanshuo/osf.io/subscribers","subscription_url":"https://api.github.com/repos/himanshuo/osf.io/subscription","commits_url":"https://api.github.com/repos/himanshuo/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/himanshuo/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/himanshuo/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/himanshuo/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/himanshuo/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/himanshuo/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/himanshuo/osf.io/merges","archive_url":"https://api.github.com/repos/himanshuo/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/himanshuo/osf.io/downloads","issues_url":"https://api.github.com/repos/himanshuo/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/himanshuo/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/himanshuo/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/himanshuo/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/himanshuo/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/himanshuo/osf.io/releases{/id}","created_at":"2015-03-30T02:46:51Z","updated_at":"2015-04-07T18:36:07Z","pushed_at":"2015-06-10T15:58:02Z","git_url":"git://github.com/himanshuo/osf.io.git","ssh_url":"git@github.com:himanshuo/osf.io.git","clone_url":"https://github.com/himanshuo/osf.io.git","svn_url":"https://github.com/himanshuo/osf.io","homepage":"http://osf.io","size":94580,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"8874bc1a3b345c498fd98c1142c082ac83963709","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-12-01T16:31:23Z","pushed_at":"2015-12-02T00:56:21Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":222864,"stargazers_count":166,"watchers_count":166,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":337,"forks":134,"open_issues":337,"watchers":166,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/2624"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2624"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2624/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2624/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/2575071b4fa25faf2d9c5fb665a112e3dbbbcc12"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"commits":3,"additions":7,"deletions":0,"changed_files":4}}