MCPcopy Index your code
hub / github.com/foxcpp/maddy / init

Function init

internal/cli/ctl/imap.go:38–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36)
37
38func init() {
39 maddycli.AddSubcommand(
40 &cli.Command{
41 Name: "imap-mboxes",
42 Usage: "IMAP mailboxes (folders) management",
43 Subcommands: []*cli.Command{
44 {
45 Name: "list",
46 Usage: "Show mailboxes of user",
47 ArgsUsage: "USERNAME",
48 Flags: []cli.Flag{
49 &cli.StringFlag{
50 Name: "cfg-block",
51 Usage: "Module configuration block to use",
52 EnvVars: []string{"MADDY_CFGBLOCK"},
53 Value: "local_mailboxes",
54 },
55 &cli.BoolFlag{
56 Name: "subscribed",
57 Aliases: []string{"s"},
58 Usage: "List only subscribed mailboxes",
59 },
60 },
61 Action: func(ctx *cli.Context) error {
62 be, err := openStorage(ctx)
63 if err != nil {
64 return err
65 }
66 defer closeIfNeeded(be)
67 return mboxesList(be, ctx)
68 },
69 },
70 {
71 Name: "create",
72 Usage: "Create mailbox",
73 ArgsUsage: "USERNAME NAME",
74 Flags: []cli.Flag{
75 &cli.StringFlag{
76 Name: "cfg-block",
77 Usage: "Module configuration block to use",
78 EnvVars: []string{"MADDY_CFGBLOCK"},
79 Value: "local_mailboxes",
80 },
81 &cli.StringFlag{
82 Name: "special",
83 Usage: "Set SPECIAL-USE attribute on mailbox; valid values: archive, drafts, junk, sent, trash",
84 },
85 },
86 Action: func(ctx *cli.Context) error {
87 be, err := openStorage(ctx)
88 if err != nil {
89 return err
90 }
91 defer closeIfNeeded(be)
92 return mboxesCreate(be, ctx)
93 },
94 },
95 {

Callers

nothing calls this directly

Calls 13

openStorageFunction · 0.85
closeIfNeededFunction · 0.85
mboxesListFunction · 0.85
mboxesCreateFunction · 0.85
mboxesRemoveFunction · 0.85
mboxesRenameFunction · 0.85
msgsAddFunction · 0.85
msgsFlagsFunction · 0.85
msgsRemoveFunction · 0.85
msgsCopyFunction · 0.85
msgsMoveFunction · 0.85
msgsListFunction · 0.85

Tested by

no test coverage detected