Move a filtered thread that skips INBOX to INBOX in Gmail if you reply to a message there or Star it

Published: by

  • Categories:

If there is a a mailing list which is filtered and doesn't pass my INBOX, even if I reply to a thread in it, it'll still goto the filter and skip in INBOX. Well, this is perfectly defined behaviour but due to this, I sometimes miss mails. Another scenarios is when you want Starred conversations to never skip INBOX.

The script below solves this problem.

function move_to_inbox(threads) {
   for each (thread in threads) {
	   if (thread.isInInbox() != 'true') { 

function main() {
	move_to_inbox('in:sent OR is:starred -label:Inbox', 0, 50));
	//MailApp.sendEmail("", "Script Log", Logger.getLog());

Goto and copy the above script there. Then, setup triggers (Resources->All Your Triggers) to execute main() every minute.


save the script in your google account by visiting this link.

Make sure that triggers are set to work correctly.