Email Processing

Sorry if this has been covered before - but I can't find what I'm looking for.
I'd like to check incomming gmail periodically - say every 15 or 30 mins. Then delete all messages that are not in a 'white list' which has previously been set up.
So that needs some extensions:

  • obviously a mail extension (maybe Pura Vida Mail extension?)
  • some extension to trigger the app at fixed intervals (Alarm Manager or Background Manager or ...??)

I'd like this to run in Android 10 and 11. I believe the latter now needs a UI response to come to the foreground, however I don't see the app needing to display anything (except perhaps a notification that it fired at HH:MM)

Would such an app be possible and any suggestions most welcome

GMail can do this ?

In gmail it is possible to set up a 'black list' so that any incomming mail in that list gets deleted. But junk mail is never ending and ever more sneeky - so I'd like the opposite. I don't think gmail provides that facility. (Not in their advertising interests?)
With a 'white list' then only mail received from addresses in that list would be retained all others go to the bin :slight_smile:

You might want to google it

gmail whitelist email filter

No... you will need an IMAP extension...
There is one available... just do a search in the extensions directory App Inventor Extensions | Pura Vida Apps
But the extension will only work if the app is up and running...

Follow @TIMAI2's advice...


Thanks guys. I'd had a look at gmail filters, but it seems to be a one at a time setup process, or negate something sent to span. Not very automated. Looks like not doable with AI2.

If you have google workspace

The above example involves specifying individual email addresses (with some limited wildcard options). This okay to an extent - but not if there are a large number. Is there a way to specify the whitelist being restricted to gmail Contacts without having to set up each one individually?