imap

package
v1.8.11 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Overview

Package imap provides IMAP server of the Bridge.

Methods are called by the go-imap library in parallel. Additional parallelism is achieved while handling each IMAP request.

For example, ListMessages internally uses `fetchWorkers` workers to resolve each requested item. When IMAP clients request message literals (or parts thereof), we sometimes need to build RFC822 message literals. To do this, we pass build jobs to the message builder, which internally manages its own parallelism. Summary:

  • each IMAP fetch request is handled in parallel,
  • within each IMAP fetch request, individual items are handled by a pool of `fetchWorkers` workers,
  • within each worker, build jobs are posted to the message builder,
  • the message builder handles build jobs using its own, independent worker pool,

The builder will handle jobs in parallel up to its own internal limit. This prevents it from overwhelming API.

Index

Constants

View Source
const (
	SubscriptionException = "subscription_exceptions"
)

Cache keys.

Variables

This section is empty.

Functions

func NewIMAPBackend

func NewIMAPBackend(
	panicHandler panicHandler,
	eventListener listener.Listener,
	cache cacheProvider,
	bridge *bridge.Bridge,
) *imapBackend

NewIMAPBackend returns struct implementing go-imap/backend interface.

Types

type Server added in v1.8.7

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

Server takes care of IMAP listening serving. It implements serverutil.Server.

func NewIMAPServer

func NewIMAPServer(
	panicHandler panicHandler,
	debugClient, debugServer bool,
	port int,
	tls *tls.Config,
	imapBackend backend.Backend,
	userAgent *useragent.UserAgent,
	eventListener listener.Listener,
) *Server

NewIMAPServer constructs a new IMAP server configured with the given options.

func (*Server) Address added in v1.8.7

func (s *Server) Address() string

func (*Server) Close added in v1.8.7

func (s *Server) Close()

Close turns off server and monitors.

func (*Server) DebugClient added in v1.8.7

func (s *Server) DebugClient() bool

func (*Server) DebugServer added in v1.8.7

func (s *Server) DebugServer() bool

func (*Server) DisconnectUser added in v1.8.7

func (s *Server) DisconnectUser(address string)

func (*Server) HandlePanic added in v1.8.7

func (s *Server) HandlePanic()

func (*Server) ListenAndServe added in v1.8.7

func (s *Server) ListenAndServe()

ListenAndServe will run server and all monitors.

func (Server) Protocol added in v1.8.7

func (Server) Protocol() serverutil.Protocol

func (*Server) Serve added in v1.8.7

func (s *Server) Serve(listener net.Listener) error

func (*Server) SetLoggers added in v1.8.7

func (s *Server) SetLoggers(localDebug, remoteDebug io.Writer)

func (*Server) StopServe added in v1.8.7

func (s *Server) StopServe() error

func (*Server) TLSConfig added in v1.8.7

func (s *Server) TLSConfig() *tls.Config

func (*Server) UseSSL added in v1.8.7

func (s *Server) UseSSL() bool

Directories

Path Synopsis
Package uidplus DOES NOT implement full RFC4315! Excluded parts are: * Response `UIDNOTSTICKY`: All mailboxes of Bridge support stable UIDVALIDITY so it would never return this response Otherwise the standard RFC4315 is followed.
Package uidplus DOES NOT implement full RFC4315! Excluded parts are: * Response `UIDNOTSTICKY`: All mailboxes of Bridge support stable UIDVALIDITY so it would never return this response Otherwise the standard RFC4315 is followed.

Jump to

Keyboard shortcuts

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