pyimaplib

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 20 Imported by: 0 modules, 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 pyimaplib is an IMAP4 client with the command, response and error behaviour of CPython imaplib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Class string
	Msg   string
}

Error is an IMAP4.error, IMAP4.abort or IMAP4.readonly raised by a command, its str the message

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsAbort

func (e *Error) IsAbort() bool

Whether the error is an abort, a service failure that needs a fresh connection

func (*Error) PyTypeName

func (e *Error) PyTypeName() string

type IMAP4

type IMAP4 struct {

	// Capabilities the server advertised, upper cased
	Capabilities []string
	// contains filtered or unexported fields
}

One IMAP4 connection with its protocol state and pending responses

func Open

func Open(ctx context.Context, host string, port int, timeout time.Duration, tlsConfig *tls.Config) (*IMAP4, error)

Opens a connection, over implicit TLS when a config is given, reads the greeting and the capabilities

func (*IMAP4) Login

func (m *IMAP4) Login(user, password string) (string, []any, error)

Identifies the client with a plain text password and enters the authenticated state

func (*IMAP4) Logout

func (m *IMAP4) Logout() (string, []any, error)

Ends the session with LOGOUT and closes the socket

func (*IMAP4) Select

func (m *IMAP4) Select(mailbox string) (string, []any, error)

Selects a mailbox for read and write access, the state falling back to authenticated when the server refuses

func (*IMAP4) Shutdown

func (m *IMAP4) Shutdown()

Closes the socket

func (*IMAP4) Starttls

func (m *IMAP4) Starttls(ctx context.Context, tlsConfig *tls.Config) error

Upgrades the connection to TLS and relearns the capabilities

func (*IMAP4) UID

func (m *IMAP4) UID(command string, args ...string) (string, []any, error)

Runs SEARCH, FETCH or STORE addressed by UID and returns the matching untagged data

func (*IMAP4) Xatom

func (m *IMAP4) Xatom(name string, args ...string) (string, []any, error)

Runs an extension command the server advertises, legal from now on in the current state

type Literal

type Literal struct {
	Line []byte
	Data []byte
}

Literal is one untagged response item that carried a literal, the tuple of its line and the literal bytes

type OSError

type OSError struct {
	Class string
	Text  string
}

OSError is a socket or TLS failure raised outside the IMAP error classes, its str the Python text

func (*OSError) Error

func (e *OSError) Error() string

func (*OSError) PyTypeName

func (e *OSError) PyTypeName() string

Jump to

Keyboard shortcuts

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