Possible (without writing complex scripts) to log gmail activity, primarily incoming email metadata (headers), send it to a Google Sheet or a bucket somewhere?
Reason I ask: want to run analytics on email headers including spam and other email that has been or is being routinely deleted. In my specific case, I just started receiving boatloads of spam to a specific gmail address ([email protected]) and before I clear it, wanted to log it for future analysis - just the headers.
E.g. "show me top sender's IP addresses for all email marked as spam in the last 30 (90, 10K) days".
Or, "show me top 'to' addresses for all email marked as spam in the last 30 days"
I don't believe there is a simple way to answer the above questions using gmail search - yet if I was able to continuously log the headers as KVs (JSON, XML, CSV, etc.) - then it'd be fairly simple.
I am assuming this isn't trivial - must dive deep into gmail API and write a script - but wanted to confirm in case anyone has done something similar.