app

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package app holds the orchestration logic for the imapsync-go CLI subcommands.

Index

Constants

This section is empty.

Variables

View Source
var ErrSilentExit = errors.New("silent exit")

ErrSilentExit signals main to exit with a non-zero code without printing "Error: ...". Use it when ActionSync has already shown a human-friendly summary to stdout and a second copy of the same information through stderr would just clutter the screen.

Functions

func ActionShow

func ActionShow(ctx context.Context, c *cli.Command) error

ActionShow displays information about mailboxes in source and destination IMAP accounts.

func ActionSync

func ActionSync(ctx context.Context, c *cli.Command) error

ActionSync copies messages between IMAP servers according to the provided configuration.

Types

type FolderSyncPlan

type FolderSyncPlan struct {
	SourceFolder            string
	DestinationFolder       string
	SrcUIDs                 []uint32
	NewMessages             int
	NewSize                 uint64
	DestinationFolderExists bool
}

FolderSyncPlan describes how a single source folder should be copied to its destination.

SrcUIDs holds the source UIDs (sorted) for messages present on src but missing on dst; bodies are deliberately not fetched at planning time so a confirm prompt can show counts without materializing potentially many GB of mail in memory.

type SyncSummary

type SyncSummary struct {
	Plans        []FolderSyncPlan
	TotalNew     int
	TotalNewSize uint64
}

SyncSummary aggregates the per-folder plans along with total message counts and an estimated total byte volume.

TotalNewSize is approximate: it scales the source folder's full RFC822.SIZE total by the new-to-total message ratio (NewMessages / SourceMessages). The exact size would require an extra UID FETCH per new UID, which is not worth the round-trips for what is only a preview number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL