pop3

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pop3 is the POP3 receiving backend (ADR 0037, spec #627). A POP3 server has one inbox and no flags: a message's server location is its UIDL, flags and moves stay local, and only Purge writes back (DELE).

Index

Constants

View Source
const (
	ReasonLocalMove  = "pop3.local_move"  // moves happen on this computer only
	ReasonLocalFlags = "pop3.local_flags" // flags are kept on this computer only
	ReasonInboxOnly  = "pop3.inbox_only"  // a POP3 server has only an inbox
	ReasonNone       = "pop3.not_provided"
	ReasonNoUIDL     = "pop3.no_uidl"
)

Reason keys, translated by the UI and Wit.

View Source
const Inbox backend.FolderRef = "INBOX"

Inbox is the one folder's ref.

Variables

View Source
var ErrNoUIDL = errors.New(ReasonNoUIDL)

ErrNoUIDL means the server lacks UIDL, so messages cannot be told apart across sessions. Its message is ReasonNoUIDL.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host        string
	Port        int
	Security    conn.Security
	Credentials backend.CredentialsFunc
	// PageBytes bounds the raw mail one sync page holds before it is
	// committed, as whole messages can be large; 0 for 32 MiB.
	PageBytes int64
}

Config is where a POP3 account's server is and how to sign in to it.

type Receiver

type Receiver struct {
	// contains filtered or unexported fields
}

Receiver is a POP3 account's receiving backend. Message numbers hold only within a session, so each call signs in, works and QUITs.

func New

func New(cfg Config) *Receiver

New is a Receiver on the account cfg reaches.

func (*Receiver) Apply

func (r *Receiver) Apply(ctx context.Context, op backend.Op) (backend.Result, error)

Apply implements backend.Receiver. Flags are kept locally and the server has only the inbox, so only Purge reaches the server.

func (*Receiver) Check

func (r *Receiver) Check(ctx context.Context) (backend.CheckResult, error)

Check implements backend.Receiver: signing in and UIDL must work.

func (*Receiver) Close

func (r *Receiver) Close() error

Close implements backend.Receiver: no connection outlives a call.

func (*Receiver) Describe

func (r *Receiver) Describe(ctx context.Context) (backend.Description, error)

Describe implements backend.Receiver. It signs in once per Receiver, as core takes its answer for the credentials working (ErrAuthFailed).

func (*Receiver) Fetch

Fetch implements backend.Receiver: the whole message with RETR, header fields with TOP n 0. POP3 gives no parts.

func (*Receiver) Find

func (r *Receiver) Find(ctx context.Context, _ backend.FolderRef, messageID string, size int64) ([]backend.MessageRef, error)

Find implements backend.Receiver: it reads the header of each message in the inbox, of those of the size when one is given.

func (*Receiver) Headers

func (r *Receiver) Headers(ctx context.Context, _ backend.FolderRef, refs []backend.MessageRef, fields []string) (map[backend.MessageRef][]byte, error)

Headers implements backend.Receiver, with TOP n 0 for each.

func (*Receiver) Sync

func (r *Receiver) Sync(ctx context.Context, req backend.SyncRequest, commit func(backend.Page) error) (more bool, err error)

Sync implements backend.Receiver. Gone locations are reported one by one, not as a snapshot, which would reset the local-only flags. The first round takes the window's mail as backfill, page by page; later rounds take what came after the cursor's message as new; Older takes mail before the oldest one held.

func (*Receiver) Watch

func (r *Receiver) Watch(context.Context, func([]backend.FolderRef)) error

Watch implements backend.Receiver: POP3 cannot push.

Jump to

Keyboard shortcuts

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