mailbox

package
v0.0.0-...-8357697 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt struct {
	// Host is the server's hostname.
	Host string `json:"host"`

	// Port is the server port.
	Port int `json:"port"`

	AuthProtocol string `json:"auth_protocol"`

	// Username is the mail server login username.
	Username string `json:"username"`

	// Password is the mail server login password.
	Password string `json:"password"`

	// Folder is the name of the IMAP folder to scan for e-mails.
	Folder string `json:"folder"`

	// Optional TLS settings.
	TLSEnabled    bool `json:"tls_enabled"`
	TLSSkipVerify bool `json:"tls_skip_verify"`

	ScanInterval time.Duration `json:"scan_interval"`
}

Opt represents an e-mail POP/IMAP mailbox configuration.

type POP

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

POP represents a POP mailbox.

func NewPOP

func NewPOP(opt Opt) *POP

NewPOP returns a new instance of the POP mailbox client.

func (*POP) Scan

func (p *POP) Scan(limit int, ch chan models.Bounce) error

Scan scans the mailbox and pushes the downloaded messages into the given channel. The messages that are downloaded are deleted from the server. If limit > 0, all messages on the server are downloaded and deleted.

Jump to

Keyboard shortcuts

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