More interesting than GmailApp, DriveApp, etc. are the Gmail, Drive etc. classes. They're under the "advanced" services, and far more powerful (and faster). Highly recommend them for more serious uses of Google Apps Script.
See also <a href="https://github.com/ranmocy/gmail-automata" rel="nofollow">https://github.com/ranmocy/gmail-automata</a> for a more generalized variant.
As far as I'm aware, there is no way to trigger an apps script script to run when an email arrives.<p>That leads to polling, which ends up with a lackluster user experience. I don't want a random 30 second delay added to all my mail delivery.
I was placed on some sort of spam list immediately following a PayPal dispute with a seller and found this thread that helped me tame the spam bombing I’ve experienced ever since: <a href="https://webapps.stackexchange.com/questions/89119/how-to-filter-messages-with-animated-emoji-in-the-subject-in-gmail" rel="nofollow">https://webapps.stackexchange.com/questions/89119/how-to-fil...</a><p>The majority of the spam came in with emojis in the from or subject line, so this was immediately helpful for that, then I just add a rule whenever I notice certain phrases popping up more often.<p>I’d be delighted if someone can tell me I’m wrong, but it seems like Gmail filters don’t have built in options for stuff like emojis or regular expressions. Very disappointing that I have to brute force script my own filters.
I've used <a href="https://github.com/mbrt/gmailctl/" rel="nofollow">https://github.com/mbrt/gmailctl/</a> to tame my inbox with some degrees of success, but gmail filters are just so flaky.<p>Next step in my things-to-try list is to just download the inbox via imap and sort it out locally.