mailproxy

package module
v0.0.0-...-259a6ac Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: AGPL-3.0 Imports: 23 Imported by: 0

README

mailproxy - POP/SMTP to Katzenpost proxy server.

Yawning Angel (yawning at schwanenlied dot me)

This is a implementation of a proxy server that exposes a POP/SMTP interface to Katzenpost based mix networks. It is intended to run on a user's localhost to allow standard mail clients to send and receive mail over the mixnet.

Documentation

Overview

Package mailproxy implements a POP/SMTP to Katzenpost proxy server.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownRecipient is the error that is returned when a recipient for
	// which there is no public key is specified.
	ErrUnknownRecipient = errors.New("mailproxy/api: unknown recipient, missing public key")

	// ErrNoMessages is the error that is returned when an account's receive
	// queue is empty.
	ErrNoMessages = errors.New("mailproxy/api: account receive queue empty")
)
View Source
var ErrGenerateOnly = errors.New("mailproxy: GenerateOnly set")

ErrGenerateOnly is the error returned when the server initialization

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	worker.Worker
	// contains filtered or unexported fields
}

Proxy is a mail proxy server instance.

func New

func New(cfg *config.Config) (*Proxy, error)

New returns a new Proxy instance parameterized with the specified configuration.

func (*Proxy) GetRecipient

func (p *Proxy) GetRecipient(recipientID string) (*ecdh.PublicKey, error)

GetRecipient returns the public key for the provided recipient.

func (*Proxy) IsConnected

func (p *Proxy) IsConnected(accountID string) bool

IsConnected returns true iff a connection to the provider is established.

func (*Proxy) ListRecipients

func (p *Proxy) ListRecipients() map[string]*ecdh.PublicKey

ListRecipients returns a map of recipientIDs to public keys consisting of all currently known entries. Modifications to the returned map have no effect.

func (*Proxy) ReceivePeek

func (p *Proxy) ReceivePeek(accountID string) ([]byte, *ecdh.PublicKey, []byte, error)

ReceivePeek returns the eldest message in the given account's receive queue, the sender's public key if any, and a unique identifier tag. The account's receive queue is left intact.

func (*Proxy) ReceivePop

func (p *Proxy) ReceivePop(accountID string) ([]byte, *ecdh.PublicKey, []byte, error)

ReceivePop removes and returns the eldest message in the given account's receive queue, the sender's public key if any, and a unique identifier tag.

func (*Proxy) RemoveRecipient

func (p *Proxy) RemoveRecipient(recipientID string) error

RemoveRecipient removes the provided recipient. This has no impact on messages that have already been enqueued for transmission via SendMessage.

func (*Proxy) SendMessage

func (p *Proxy) SendMessage(senderID, recipientID string, payload []byte) error

SendMessage enqueues payload for transmission from the sender to the recipient (account IDs). The payload MUST be a well formed IMF message.

Any delivery failures after the message has been successfully enqueued will result in a delivery status notification message being sent from the postmaster to the senderID account.

func (*Proxy) SetRecipient

func (p *Proxy) SetRecipient(recipientID string, publicKey *ecdh.PublicKey) error

SetRecipient sets the public key for the provided recipient.

func (*Proxy) Shutdown

func (p *Proxy) Shutdown()

Shutdown cleanly shuts down a given Proxy instance.

func (*Proxy) Wait

func (p *Proxy) Wait()

Wait waits till the Proxy is terminated for any reason.

Directories

Path Synopsis
Package config implements the configuration for the Katzenpost client mail proxy.
Package config implements the configuration for the Katzenpost client mail proxy.
Package event implements the event types returned by the API's event listener.
Package event implements the event types returned by the API's event listener.
internal
account
Package account implements the provider account backend.
Package account implements the provider account backend.
authority
Package authority implements the generic PKI backend.
Package authority implements the generic PKI backend.
glue
Package glue implements the internal interfaces used to glue the various mailproxy components together.
Package glue implements the internal interfaces used to glue the various mailproxy components together.
imf
Package imf implements useful routines for dealing with the Internet Message Format as used by Katzenpost.
Package imf implements useful routines for dealing with the Internet Message Format as used by Katzenpost.
pkiclient
Package pkiclient implements a caching wrapper around core/pki.Client.
Package pkiclient implements a caching wrapper around core/pki.Client.
pop3
Package pop3 implements a minimal POP3 server, mostly intended to be ran over the loopback interface.
Package pop3 implements a minimal POP3 server, mostly intended to be ran over the loopback interface.
proxy
Package proxy implements the support for an upstream (outgoing) proxy.
Package proxy implements the support for an upstream (outgoing) proxy.
recipient
Package recipient implements the recipient public key store.
Package recipient implements the recipient public key store.

Jump to

Keyboard shortcuts

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