I have a fresh install of a Dovecot (and Postfix) setup on Ubuntu Server 22.04
The configuration is exclusively for local mail between desks and the messages are in practice instant only
in few words , the drive storage is limited and this is not the office official mail
These mails will be just instant messages between users and the history will be kept in the respective Thunderbird clients.
Please note that for that same reson dovecot-imapd is NOT installed at all
I need to set a script that will erase all the users messages older than 30 days
So far, reading the documentation, I have found that these commands should be the right ones
doveadm expunge -A mailbox Inbox savedbefore 30d
doveadm expunge -A mailbox Sent savedbefore 30d
doveadm expunge -A mailbox Trash savedbefore 30d
P.S. as Dovecot provides the -A
switch for selecting ALL the users, do you kindly know if it is available a similar switch to select ALL the maiboxes types (sent received trash etc etc altogether, this to be sure to have matched all at once in one line only) , thank you
please note that dovecot-imapd is NOT installed
Well, when I run just one of them, e.g. doveadm expunge -A mailbox Inbox savedbefore 30d
, I get this output
doveadm(nobody): Error: mkdir(/nonexistent/mail/.imap) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup))
doveadm(nobody): Error: mkdir(/nonexistent/mail/.imap) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup))
doveadm(nobody): Error: Syncing mailbox 'Trash' failed: Mailbox doesn't exist: Trash
doveadm(robert): Error: Syncing mailbox 'Trash' failed: Mailbox doesn't exist: Trash
doveadm(lxd): Error: mkdir(/var/snap/lxd/common/lxd/mail/.imap) failed: Permission denied (euid=999(lxd) egid=100(users) missing +w perm: /var/snap/lxd/common/lxd, dir owned by 0:0 mode=0711)
doveadm(lxd): Error: mkdir(/var/snap/lxd/common/lxd/mail/.imap) failed: Permission denied (euid=999(lxd) egid=100(users) missing +w perm: /var/snap/lxd/common/lxd, dir owned by 0:0 mode=0711)
doveadm(lxd): Error: Syncing mailbox 'Trash' failed: Mailbox doesn't exist: Trash
Permission to who?
doveadm is a command theoretically run by the dovecot user which theoretically is the one that manages the mailboxes
Really confused
Thank you for hinting about this
Also, any acknowledge about the command lines, would be welcome as well. Thank you