imap

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(host string, port int, email, password string) *Client

func (*Client) ListEmails

func (c *Client) ListEmails(ctx context.Context, opts ListEmailsOptions) (emails []domain.EmailMeta, err error)

func (*Client) ListFolders

func (c *Client) ListFolders(ctx context.Context) (names []string, err error)

func (*Client) ReadEmail

func (c *Client) ReadEmail(ctx context.Context, uid string) (message domain.EmailMessage, err error)

func (*Client) TestConnection

func (c *Client) TestConnection(ctx context.Context) (err error)

TestConnection dials the IMAP server and logs in, then immediately logs out, to verify the configured host/port/credentials work without fetching any mailbox data. Unlike connect(), the dial (and the deadline covering the subsequent login) is bounded by ctx's deadline, so a host that never responds fails once ctx expires instead of hanging indefinitely.

type ListEmailsOptions

type ListEmailsOptions struct {
	Limit     int
	AfterUid  *string
	BeforeUid *string
}

ListEmailsOptions bounds a list_emails page. AfterUid/BeforeUid are raw UID strings (same format as ReadEmail's uid param); at most one may be set by the caller.

Jump to

Keyboard shortcuts

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