Deactivate inactive mailboxes

NethServer Version: NethServer 7.9.2009
Module: Email
Hi everyone!! I have a problem, in my job we migrated mailboxes from Microsoft Exchange to NethServer 7.9.2009, I would like to know how to deactivate more than 2000 mailboxes of employees who no longer work in the institution from 2016 to 2022 since doing it one by one is quite time consuming.
Thank you very much for your prompt replies and sorry for my bad English :frowning:

Hi and welcome to NethServer Community,

the user mailbox configuration is stored in the accounts database. To disable a user mailbox on CLI: (to use it in a script)

db accounts setprop username@domain.tld MailStatus disabled

After disabling users you need to apply the changes by firing an event:

signal-event nethserver-mail-server-save

To get โ€œinactiveโ€ users you may use the MinucciTools that shows users that were not logged in for the last x years.

4 Likes