(be module.Storage, ctx *cli.Context)
| 630 | } |
| 631 | |
| 632 | func msgsCopy(be module.Storage, ctx *cli.Context) error { |
| 633 | username := ctx.Args().First() |
| 634 | if username == "" { |
| 635 | return cli.Exit("Error: USERNAME is required", 2) |
| 636 | } |
| 637 | srcName := ctx.Args().Get(1) |
| 638 | if srcName == "" { |
| 639 | return cli.Exit("Error: SRCMAILBOX is required", 2) |
| 640 | } |
| 641 | seqset := ctx.Args().Get(2) |
| 642 | if seqset == "" { |
| 643 | return cli.Exit("Error: SEQSET is required", 2) |
| 644 | } |
| 645 | tgtName := ctx.Args().Get(3) |
| 646 | if tgtName == "" { |
| 647 | return cli.Exit("Error: TGTMAILBOX is required", 2) |
| 648 | } |
| 649 | |
| 650 | if !ctx.Bool("uid") { |
| 651 | fmt.Fprintln(os.Stderr, "WARNING: --uid=true will be the default in 0.7") |
| 652 | } |
| 653 | |
| 654 | seq, err := imap.ParseSeqSet(seqset) |
| 655 | if err != nil { |
| 656 | return err |
| 657 | } |
| 658 | |
| 659 | u, err := be.GetIMAPAcct(username) |
| 660 | if err != nil { |
| 661 | return err |
| 662 | } |
| 663 | |
| 664 | _, srcMbox, err := u.GetMailbox(srcName, true, nil) |
| 665 | if err != nil { |
| 666 | return err |
| 667 | } |
| 668 | |
| 669 | return srcMbox.CopyMessages(ctx.Bool("uid"), seq, tgtName) |
| 670 | } |
| 671 | |
| 672 | func msgsMove(be module.Storage, ctx *cli.Context) error { |
| 673 | username := ctx.Args().First() |
no test coverage detected