On Tue, 2024/11/12 at 10:11:00 +0000, Nick Howitt via dovecot wrote:
On 12/11/2024 07:12, Sirius via dovecot wrote:
On Tue, 2024/11/12 at 03:45:57 +0100, Ralph Seichter via dovecot wrote: DATESTR=$(date --date='TZ="UTC" 0 2 week ago' +'%d-%b-%Y') doveadm expunge -u <user> mailbox Trash before ${DATESTR}
I'm new to Dovecot. I've seen a few examples on the internet like this and I am wondering what is the advantage of this format of the command over one of these:
doveadm expunge -u <user> mailbox Trash before 14d doveadm expunge -u <user> mailbox Trash before 2w
It seems relatively complicated to manipulate date strings compared to using d or w operators.
:-D
Simply because I did not know you could to "before 2w". Looking in the documentation I found relatively fast what the actual date format had to be and I knew 'date' could be used to generate the correct date string for a time in the past. Once you have a tried and tested way that works, you might not look deeper for other ways to do things, because the way you have works.
Now I know you can do it the way you list, so that would be how I do it in the future.
-- Kind regards,
/S