Delete messages by timeframe

106 views
Skip to first unread message

Eric Downing

unread,
Apr 17, 2023, 3:25:42 PM4/17/23
to GAM for Google Workspace
Hello,

A user inadvertently created a routing rule that directs all mail to a particular inbox. We found this rule after 2 hours so we would like to create a GAM command to delete all mails from the recipients inbox within a certain time frame. Is this possible?

Here's what we have so far:

gam user x...@xx.com delete messages query 'label:Inbox'

I don't know how to specify within a certain time range.

As well we would like to test this command prior to running it - I didn't see in the command reference if there was a way to do that.

Thanks for any replies!

Ross Scroggs

unread,
Apr 17, 2023, 4:07:43 PM4/17/23
to google-ap...@googlegroups.com
Eric,


Use after and before.

No messages are deleted unless you supply the doit argument; omit doit and you get an indication on how many messages will be deleted.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/c6a2851d-9871-4df5-9db5-0665faebca5fn%40googlegroups.com.


--

Eric Downing

unread,
Apr 19, 2023, 3:19:12 PM4/19/23
to google-ap...@googlegroups.com
Thank you so much Ross!

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/ovQaEqE_MGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAJkvRS_BNS35xhBSiqn%3Dh4JdKPq_PLS9oKUfNfRBVOQnmiNO2Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages