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

Function imapAcctList

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

Source from the content-addressed store, hash-verified

195}
196
197func imapAcctList(be module.Storage, ctx *cli.Context) error {
198 mbe, ok := be.(module.ManageableStorage)
199 if !ok {
200 return cli.Exit("Error: storage backend does not support accounts management using maddy command", 2)
201 }
202
203 list, err := mbe.ListIMAPAccts()
204 if err != nil {
205 return err
206 }
207
208 if len(list) == 0 && !ctx.Bool("quiet") {
209 fmt.Fprintln(os.Stderr, "No users.")
210 }
211
212 for _, user := range list {
213 fmt.Println(user)
214 }
215 return nil
216}
217
218func imapAcctCreate(be module.Storage, ctx *cli.Context) error {
219 mbe, ok := be.(module.ManageableStorage)

Callers 1

initFunction · 0.85

Calls 3

BoolMethod · 0.80
PrintlnMethod · 0.80
ListIMAPAcctsMethod · 0.65

Tested by

no test coverage detected