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

Function init

internal/cli/ctl/imapacct.go:33–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31)
32
33func init() {
34 maddycli.AddSubcommand(
35 &cli.Command{
36 Name: "imap-acct",
37 Usage: "IMAP storage accounts management",
38 Description: `These subcommands can be used to list/create/delete IMAP storage
39accounts for any storage backend supported by maddy.
40
41The corresponding storage backend should be configured in maddy.conf and be
42defined in a top-level configuration block. By default, the name of that
43block should be local_mailboxes but this can be changed using --cfg-block
44flag for subcommands.
45
46Note that in default configuration it is not enough to create an IMAP storage
47account to grant server access. Additionally, user credentials should
48be created using 'creds' subcommand.
49`,
50 Subcommands: []*cli.Command{
51 {
52 Name: "list",
53 Usage: "List storage accounts",
54 Flags: []cli.Flag{
55 &cli.StringFlag{
56 Name: "cfg-block",
57 Usage: "Module configuration block to use",
58 EnvVars: []string{"MADDY_CFGBLOCK"},
59 Value: "local_mailboxes",
60 },
61 },
62 Action: func(ctx *cli.Context) error {
63 be, err := openStorage(ctx)
64 if err != nil {
65 return err
66 }
67 defer closeIfNeeded(be)
68 return imapAcctList(be, ctx)
69 },
70 },
71 {
72 Name: "create",
73 Usage: "Create IMAP storage account",
74 Description: `In addition to account creation, this command
75creates a set of default folder (mailboxes) with special-use attribute set.`,
76 ArgsUsage: "USERNAME",
77 Flags: []cli.Flag{
78 &cli.StringFlag{
79 Name: "cfg-block",
80 Usage: "Module configuration block to use",
81 EnvVars: []string{"MADDY_CFGBLOCK"},
82 Value: "local_mailboxes",
83 },
84 &cli.BoolFlag{
85 Name: "no-specialuse",
86 Usage: "Do not create special-use folders",
87 Value: false,
88 },
89 &cli.StringFlag{
90 Name: "sent-name",

Callers

nothing calls this directly

Calls 6

openStorageFunction · 0.85
closeIfNeededFunction · 0.85
imapAcctListFunction · 0.85
imapAcctCreateFunction · 0.85
imapAcctRemoveFunction · 0.85
imapAcctAppendlimitFunction · 0.85

Tested by

no test coverage detected