(be module.Storage, ctx *cli.Context)
| 281 | } |
| 282 | |
| 283 | func 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 | } |
no test coverage detected