This Google Apps Script performs a very basic check of the email header looking for a fail message from spf or dkim checks. If found, it sends the message to spam and apples a label so you can easily identify the script that placed the message in the spam folder.
This functionality is part of a larger suite of Gmail Management Functions I'm building to reduce the amount of time wasted on worthless or unwanted messages.
This automation is free software for personal use.
If you find any of my work useful and would like to send a donation, you can use any of these options: