Remove all mail from Sogo

hello, this is probably an odd question but I am done testing and will be migrating my existing mail-server from Merak (terrible support, terribly expensive) to NS with SoGo, using imapsync. it works great.

NS is joined to my UCS (univention corporate) domain, not local.

Is there a way to delete all mail from all mailboxes but leave accounts intact??

Thanks !

The not-smart way could be access via IMAP with an email client, and delete all messages. Compact folders and move to the next step.
Maybe there’s a smarter way deleting some sort of data on nethserver filesystem…

well… i have about 80 accounts I would need passwords for… which I do not have since it’s all linked to a domain controller.

I was hoping for a cli command or database delete somehow.

I think you can delete emails stored into /var/lib/nethserver/vmail with rm -rf command.
In this directory you can find all accounts folder and for each folder all subfolder of these accounts.

An helpful command could be rm -rf /var/lib/nethserver/vmail/*/.INBOX/* and delete inbox emails for all accounts. Check path and test it, but it should works.
Maybe you can check if it works with mv or cp command by moving or copying to another directory messages.


that seems to work so far

Thank you.

1 Like