FilterBadRecruiters is a Google Apps Script that processes new messages looking for unwanted email from known third party recruiters. When a match is found, a reply is sent informing the sender that the message is being reported as spam and will not be read. The script then logs matches to a spreadsheet and updates a pie chart displaying what percentage of these type of messages were sent from each domain.<p>The script fetches the list of known third party recruiters and the contents of the email reply message from URLs specified in the script variables. You can easily modify these URLs to point to your own data or use mine.<p>Features
* Searches your gmail account for messages that meet the search criteria, looking for sender domain matches against a list of known bad third party recruiters.
* Searches the email headers of messages not matched to a known recruiter for a string indicating they were sent "via" a known shotgun approach mailing list service.
* Applies a label to message(s) that meet the criteria, reports the message(s) that meet the criteria as spam, sends an automatic reply, and outputs details of the message to a reporting spreadsheet,
* The spreadsheet is created if it doesn't exist.
* Messages that do not match the criteria are cached so they are only checked every six hours. However, if the number of new known recruiter domains or via domains change from the last time the script runs, the cache is cleared so that all messages in the search range are checked for the new domains.
* The reporting spreadsheet also contains a chart tab where a pie chart displays what percentage of all the logged messages were sent from each domain. You can take a look at my reporting spreadsheet on the link of the readme on github
* The script can easily be customized by changing variables to do things like use a different list of known bad third party recruiters, a different canned reply, or a different search range.
* When run, the script creates some variables in the user section of the built in script properties that are specific to your user account. These properties include the current version of the script you are using and the identifier of the spreadsheet in your Google Drive folder once it has been created.