Temporary "disable" or put an mail account on "hold"

Your question

If i like to temporary put a mail account on hold, what is the best way? I.e I like the mailbox to stay like it is, don’t delete anything, but block new files to be uploaded, new mail to be sent etc. After action taken by user, i like to “enable” the account again.

And yes, i like it to be done via the api. Programatically.

Idea: Express the feature request at the Feature Ideas section.

Additional idea: Suggest a compact name for the “non paying customer should pay first before sending further emails” feature.

There is no dedicated enable/disable or hold flag on an account, so the answer is that the feature does not exist as such. The reversible substitute is the permission system: set the account’s permissions to Merge with disabledPermissions listing the ones you want gone. Disabled permissions take precedence over anything inherited from roles, groups or the tenant, so nothing can quietly undo them from elsewhere.

"permissions": { "@type": "Merge", "disabledPermissions": ["authenticate", "emailSend"] }

Undo is the same call with an empty array. authenticate blocks every login (IMAP, JMAP, submission, admin UI), which also stops uploads; emailSend blocks outbound; emailReceive blocks inbound, but note that means incoming mail is rejected rather than held, so for a “freeze the user but keep their mail arriving” hold you probably want just the first two. Nothing touches the mailbox, quota or blobs either way, so it is fully reversible.

That goes over x:Account/set, or stalwart-cli update Account <id> --field permissions='...' if you prefer the CLI.

Thanks. in this case emailSend will do it.

I assume there could be different needs, i.e. “suspended” account could be defined differently in different organisations. in my case, stop people from sending new mail will do it. In some case, like when an employee quit, maybe account should be transferred to someone, or disabled but not deleted due to some policy that may vary at different company. Most likely 100 page long compliance document today…