MCPcopy Create free account
hub / github.com/foxcpp/maddy / imapAcctRemove

Function imapAcctRemove

internal/cli/ctl/imapacct.go:283–301  ·  view source on GitHub ↗
(be module.Storage, ctx *cli.Context)

Source from the content-addressed store, hash-verified

281}
282
283func imapAcctRemove(be module.Storage, ctx *cli.Context) error {
284 mbe, ok := be.(module.ManageableStorage)
285 if !ok {
286 return cli.Exit("Error: storage backend does not support accounts management using maddy command", 2)
287 }
288
289 username := ctx.Args().First()
290 if username == "" {
291 return cli.Exit("Error: USERNAME is required", 2)
292 }
293
294 if !ctx.Bool("yes") {
295 if !clitools2.Confirmation("Are you sure you want to delete this user account?", false) {
296 return errors.New("Cancelled")
297 }
298 }
299
300 return mbe.DeleteIMAPAcct(username)
301}

Callers 1

initFunction · 0.85

Calls 3

ArgsMethod · 0.80
BoolMethod · 0.80
DeleteIMAPAcctMethod · 0.65

Tested by

no test coverage detected