5 ms·
If anybody wants to do this to their own GMail account without putting trust in a third party, this is pretty easy to do with the little-known Google Apps Scrip
by wolfgang42 8y ago
If anybody wants to do this to their own GMail account without putting trust in a third party, this is pretty easy to do with the little-known Google Apps Script. You can write JavaScript that will run on Google's servers and do whatever you want to your account. (I use this to archive various automated emails if I haven't bothered to look at them, to keep them from cluttering my inbox after they're obsolete.)
Here's a script which I think should do the job, assuming you have a filter set up to move all incoming mail to a label called 'hidden_mail' (warning: untested!):
function checkMail() {
GmailApp.moveThreadsToInbox(GmailApp.search('label:hidden_mail'));
}
Just create a new project on https://script.google.com/ https://script.google.com/ , paste in this code, and then Edit > Current Project's Triggers and add a trigger to run checkMail() on whatever schedule you want.
- the_duke 8y agoThat's an awesome solution, thanks!
- buremba 8y agoYou could automatically archive the emails with that labeling feature as well, no need for the Google Scripts.
- wolfgang42 8y agoReally, how? I've never seen any options anywhere to apply labels after a certain time. Or is there a trick I missed?
- fgheorghe 8y agoNo trick - you only need to roght click and email, create filtre, and choose to archive it along with croteria for matching emails.
- rco8786 8y agoPresumably you would write the code to do it...
- wolfgang42 8y agoburemba specifically said that there wasn't any need for Google Scripts.
- buremba 8y agoWhat I understood is to add labels to e-mails and archive the emails that match those labels immediately. That way, you won't get any notification for those emails. Instead, you can open the emails whenever you want. Here it is: https://cl.ly/122f791d609c https://cl.ly/122f791d609c
- h1d 8y agoOff topic but I wonder why people, especially usually privacy sensitive HN readers use Gmail and turn themselves into Google's better product with nothing to gain? Running your own server or use a more privacy catered provider with Thunderbird or whatever client isn't so hard.
- Tracist 8y agoNothing to gain? How about time? That's the common benefit of every *AAS product, both free and paid. I could self host my own email server, cloud storage and backup solution, calendar software, facebook-alternative node, blog. Or I could use gmail, GDrive, google calendar, facebook and wordpress. Yes, I can do everything myself, but now I'm spending my time maintaining each of those different self hosted solutions.
- h1d 8y agoYou seem to care more about the one time setup effort than continuously feeding yourself to Google. Besides, there are providers like Proton if you can't afford to set one up.
- jensv 8y agoConvenience and security are often at odds with one another. Not that Gmail search is any good but you can't search through encrypted mail, as an example.
- hnmonkey 8y agoTo pile on, gmail is also well-known to have fantastic spam and phishing prevention abilities compared to most other email solutions, something you could literally never do at home yourself without some incredible software that you run yourself (and even then probably not). That's a huge value-add for a ton of users I'd imagine. 'Nothing to gain' is incredibly hyperbolic I think or this person has never read about gmail/used gmail before.
- kimburgess 8y agoThis is awesome. I've been wanting to setup this functionality for a while, but wasn't aware of Apps Script. One thing missing in the above is to remove the 'hidden' label. var buffer = GmailApp.getUserLabelByName('buffered'); function release() { buffer.getThreads().map(unbuffer); } function unbuffer(thread) { thread.moveToInbox(); thread.removeLabel(buffer); }