Unfortunately, I tend to get a lot of duplicate e-mails: same sender, same subject, same content. Gmail recognizes the duplication, and minimizes these e-mails when I view them, so I’d like to tap into that recognition.
Specifically, I would like a filter that archives an e-mail, if it is a duplicate of an e-mail already archived, and to mark the e-mail as read, if it is a duplicate of an e-mail already read.
Is there any way to do this?
Best Answer
Here is a script that may help with the issue. It takes the sender and subject of the 1st message in every inbox thread, and runs a search for them. There isn't a search parameter for the body of the message, so instead every candidate message is compared to the inbox message. If a match is found, its state is determined and the inbox message is treated accordingly.
The script editor has an option (under Resources) to install a time-based trigger that executes the script periodically: every day, every hour, every minute, or at some other intervals. (There is no "new email" event-based trigger.)
Note: I haven't tested the script, since I don't have such duplicates.
Reference: GmailApp documentation and pages linked from there.