imap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

This module listens on an IMAP connection, initially reading all mail in the given folder, then starting an IDLE connection, and reading new mail. Whenever it has processed an email (successfully or failed due to some parsing error), it deletes it.

Index

Constants

View Source
const Xoauth2 = "XOAUTH2"

The XOAUTH2 mechanism name.

Variables

This section is empty.

Functions

func NewXoauth2Client

func NewXoauth2Client(username, token string) sasl.Client

An implementation of the XOAUTH2 authentication mechanism, as described in https://developers.google.com/gmail/xoauth2_protocol.

Types

type Session

type Session struct {
	Db           db.DB
	ShutdownChan chan struct{}
	Dkim         string
	Host         string
	User         string
	Mailbox      string
	TokenCmd     []string
	IdlePoll     time.Duration
	Delegate     bool
	LocalDkim    bool
}

func (*Session) Listen

func (s *Session) Listen() error

type Xoauth2Error

type Xoauth2Error struct {
	Status  string `json:"status"`
	Schemes string `json:"schemes"`
	Scope   string `json:"scope"`
}

An XOAUTH2 error.

func (*Xoauth2Error) Error

func (err *Xoauth2Error) Error() string

Implements error.

Jump to

Keyboard shortcuts

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