A number of departments in our organization receive a large quantity of email through Distribution lists. These messages are moved to predefined subfolders upon receipt. typically these messages become irrelevant after one of our employees handles them, but are stored for safekeeping.
Now everyone is SUPPOSED to maintain these folders and delete old email, but in practice this doesn't seem to happen
I want to write a script to clear out any message older than 2 months that is still present in these folders by creating a bash script that searches though all relevant accounts using zmmboxsearch to collect the message ID's and then using zmmailbox to delete the individual messages.
Is this the easiest way to go about doing this ?