I am not trying to remove all the mails.
I googled for mark all mail as read, actually got posts saying how to delete them instead.
I found out using echo p | mail will output first of unread then mark it read, but if I do this, I have to loop through them.
I figured for all read mails, they will be appended to a file named mbox
What I am trying to do is...I want to create a bash file which is then used for crontab that let's say, at the end of each month, change the name of mbox into month-year in this way I can keep track and organize the mails BUT in order to have the mails appended into mbox is reading the mails one by one first.
Am I thinking this in a wrong direction? Or can someone give me some advices?
Thanks in advance for any help
EDIT: I am just using sudo apt install mailutils for my ubuntu server