Gmail – How to filter messages with animated emoji in the subject in Gmail

emojigmailgmail-filters

I was trawling through my spam folder (which I rarely do, because Gmail rarely has false positives) and I noticed something interesting:

sample list of spam messages

Something like over half of the messages have at least one animated emoji in the subject.

None of my friends would use that crap. No valid company that I'd do business with would ever do that either.

How can I create a filter to, perhaps, auto-delete messages with animated emoji in the subject?

Using jamesmstone's clue below, I tried a search with subject:=?UTF-8? and subject:"=?UTF-8?" and several other permutations, but none worked.

Here's a sample set of headers from one of these steaming piles:

Delivered-To: [redacted]@gmail.com
Received: by 10.107.28.200 with SMTP id c191csp1104992ioc;
        Sun, 24 Jan 2016 19:07:16 -0800 (PST)
X-Received: by 10.107.38.5 with SMTP id m5mr15068933iom.15.1453691236564;
        Sun, 24 Jan 2016 19:07:16 -0800 (PST)
Return-Path: <VivaLoan@mythirdxyz.xyz>
Received: from mythirdxyz.xyz ([2a04:5b00:a2d0:3d74:37fd:ee71:efe6:6e11])
        by mx.google.com with ESMTP id o10si8722554igw.41.2016.01.24.19.07.15
        for <[redacted]@gmail.com>;
        Sun, 24 Jan 2016 19:07:16 -0800 (PST)
Received-SPF: pass (google.com: domain of VivaLoan@mythirdxyz.xyz designates 2a04:5b00:a2d0:3d74:37fd:ee71:efe6:6e11 as permitted sender) client-ip=2a04:5b00:a2d0:3d74:37fd:ee71:efe6:6e11;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of VivaLoan@mythirdxyz.xyz designates 2a04:5b00:a2d0:3d74:37fd:ee71:efe6:6e11 as permitted sender) smtp.mailfrom=VivaLoan@mythirdxyz.xyz;
       dkim=pass header.i=@mythirdxyz.xyz;
       dmarc=pass (p=REJECT dis=NONE) header.from=mythirdxyz.xyz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mythirdxyz.xyz; 
 i=@mythirdxyz.xyz; q=dns/txt; s=default; t=1453691229; 
 bh=GuM9JCP4yh7WfVbRBortR7UAr6DAtlgy0oTCna0iWQk=; h=MIME-Version : 
 Content-Type : Content-Transfer-Encoding : To : From : Subject : Date : 
 Message-ID : From : Subject : Date; 
 b=e/zS14UB4o5MhYlfbpsy0h2G/oZyoC5H3ouyhNh13zcSHSNXzI6uvJpIy9a+za2ng26Xe2
 NfAI7nenAMCdHJSGF4yfmtTi3+XrR2MqQPHQ1fzTXGhRy/ktCj4tEqt7DhSxnRCqkYFUNaLA
 wh3FMLr6IxPi2Z7xUXm3JBffhDcSU=
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64
To: [redacted]@gmail.com
From: "APPROVAL DEPARTMENT" <VivaLoan@mythirdxyz.xyz>
Subject: =?utf-8?q?=F3=BE=93=A0_Personal_loan_as_soon_as_tomorrow_=F3=BE=93=A0?=
Date: Sun, 24 Jan 2016 19:07:09 -0800
Message-ID: <A112ED51-1674-4902-BF73-F2EBCBA42CAF@mythirdxyz.xyz>

Best Answer

Short answer

Instead of using Gmail Filters that depends on the Gmail search feature to search for the encoded emojis in the orignal messages, create a script using the GmailMessage::getRawContent() method of Google Apps Script to process the messages.

Related questions

The following are links to answers to similar questions in this site including scripts using the referred method.