mailproxy: Index | Files

package account

import ""

Package account implements the provider account backend.


Package Files

account.go db.go recv.go send.go store.go worker.go

type Account Uses

type Account struct {

    InsecureKeyDiscovery bool
    // contains filtered or unexported fields

Account is a Provider account and it's associated client instance.

func (*Account) Deref Uses

func (a *Account) Deref()

Deref decrements the reference count of the Account. If the reference count reaches 0, the Account will be torn down and removed from it's associated Store.

func (*Account) EnqueueKaetzchenRequest Uses

func (a *Account) EnqueueKaetzchenRequest(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)

EnqueueKaetzchenRequest enqueues a Katzchen request for transmission.

Note: Kaetzchen requests are treated as "urgent" and will skip to the head of the transmit queue. Additonally, the requests are considered one-shot and not retransmitted.

func (*Account) EnqueueMessage Uses

func (a *Account) EnqueueMessage(recipient *Recipient, msg []byte, isUnreliable bool) ([]byte, error)

EnqueueMessage enqueues a message for transmission.

func (*Account) GetID Uses

func (a *Account) GetID() string

GetID returns the user@provider string

func (*Account) IsConnected Uses

func (a *Account) IsConnected() bool

IsConnected returns true iff the account is connected.

func (*Account) ReceivePeekPop Uses

func (a *Account) ReceivePeekPop(isPop bool) ([]byte, *ecdh.PublicKey, []byte, error)

ReceivePeekPop returns the eldest message in the receive queue, the sender's public key, and a unique identifier, optionally after removing the message from the queue.

func (*Account) StoreReport Uses

func (a *Account) StoreReport(payload []byte) error

StoreReport stores a locally generated report directly in the account's receive spool.

type Recipient Uses

type Recipient struct {
    ID        string
    User      string
    Provider  string
    PublicKey *ecdh.PublicKey

Recipient is a outgoing recipient.

type Store Uses

type Store struct {
    // contains filtered or unexported fields

Store is a group of Account instances.

func NewStore Uses

func NewStore(g glue.ProxyInternals) *Store

NewStore constructs a new Store instance.

func (*Store) Get Uses

func (s *Store) Get(id string) (*Account, error)

Get returns the Account identified by id, after incrementing the reference count.

func (*Store) NewSession Uses

func (s *Store) NewSession(user, pass []byte) (pop3.BackendSession, error)

NewSession creates a new pop3.BackendSession backed by the specified user, where the user is of the form `user@provider`.

func (*Store) Reset Uses

func (s *Store) Reset()

Reset clears the existing Store instance, terminating clients associated with each account entry.

func (*Store) Set Uses

func (s *Store) Set(id string, cfg *config.Account) error

Set sets the Account identified by id, to a new Account parameterised by the provided config.Account cfg.

Package account imports 35 packages (graph) and is imported by 2 packages. Updated 2019-06-25. Refresh now. Tools for package owners.