(be module.Storage, ctx *cli.Context)
| 670 | } |
| 671 | |
| 672 | func msgsMove(be module.Storage, ctx *cli.Context) error { |
| 673 | username := ctx.Args().First() |
| 674 | if username == "" { |
| 675 | return cli.Exit("Error: USERNAME is required", 2) |
| 676 | } |
| 677 | srcName := ctx.Args().Get(1) |
| 678 | if srcName == "" { |
| 679 | return cli.Exit("Error: SRCMAILBOX is required", 2) |
| 680 | } |
| 681 | seqset := ctx.Args().Get(2) |
| 682 | if seqset == "" { |
| 683 | return cli.Exit("Error: SEQSET is required", 2) |
| 684 | } |
| 685 | tgtName := ctx.Args().Get(3) |
| 686 | if tgtName == "" { |
| 687 | return cli.Exit("Error: TGTMAILBOX is required", 2) |
| 688 | } |
| 689 | |
| 690 | if !ctx.Bool("uid") { |
| 691 | fmt.Fprintln(os.Stderr, "WARNING: --uid=true will be the default in 0.7") |
| 692 | } |
| 693 | |
| 694 | seq, err := imap.ParseSeqSet(seqset) |
| 695 | if err != nil { |
| 696 | return err |
| 697 | } |
| 698 | |
| 699 | u, err := be.GetIMAPAcct(username) |
| 700 | if err != nil { |
| 701 | return err |
| 702 | } |
| 703 | |
| 704 | _, srcMbox, err := u.GetMailbox(srcName, true, nil) |
| 705 | if err != nil { |
| 706 | return err |
| 707 | } |
| 708 | |
| 709 | moveMbox := srcMbox.(*imapsql.Mailbox) |
| 710 | |
| 711 | return moveMbox.MoveMessages(ctx.Bool("uid"), seq, tgtName) |
| 712 | } |
| 713 | |
| 714 | func msgsList(be module.Storage, ctx *cli.Context) error { |
| 715 | username := ctx.Args().First() |
no test coverage detected