Documentation
¶
Overview ¶
Package mailproxy implements a POP/SMTP to Katzenpost proxy server.
Index ¶
- Variables
- type Message
- type Proxy
- func (p *Proxy) GetRecipient(recipientID string) (*ecdh.PublicKey, error)
- func (p *Proxy) IsConnected(accountID string) bool
- func (p *Proxy) ListProviders(authorityID string) ([]*pki.MixDescriptor, error)
- func (p *Proxy) ListRecipients() map[string]*ecdh.PublicKey
- func (p *Proxy) ParseKeyQueryResponse(payload []byte) (string, *ecdh.PublicKey, error)
- func (p *Proxy) QueryKeyFromProvider(senderID, recipientID string) ([]byte, error)
- func (p *Proxy) ReceivePeek(accountID string) (*Message, error)
- func (p *Proxy) ReceivePop(accountID string) (*Message, error)
- func (p *Proxy) RemoveRecipient(recipientID string) error
- func (p *Proxy) ScanRecipientDir() error
- func (p *Proxy) SendKaetzchenRequest(senderID, serviceID, providerID string, payload []byte, wantResponse bool) ([]byte, error)
- func (p *Proxy) SendMessage(senderID, recipientID string, payload []byte) ([]byte, error)
- func (p *Proxy) SetRecipient(recipientID string, publicKey *ecdh.PublicKey) error
- func (p *Proxy) Shutdown()
- func (p *Proxy) Wait()
Constants ¶
This section is empty.
Variables ¶
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") )
var ( // ErrKeyserverSyntaxError is the error returned when the keyserver // rejects a query due to a malformed request. ErrKeyserverSyntaxError = errors.New("keyserver: syntax error") // ErrNoIdentity is the error returned when the keyserver fails to // find the requested user, or the user's public key. ErrNoIdentity = errors.New("keyserver: user or public key not found") )
var ErrGenerateOnly = errors.New("mailproxy: GenerateOnly set")
ErrGenerateOnly is the error returned when the server initialization
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { // Payload is the Message payload. Payload []byte // SenderID is the Message sender's identifier set iff the sender is // a known recipient. SenderID string // SenderKey is the Message sender's public key, if any. SenderKey *ecdh.PublicKey // MessageID is the local unique identifier for the message. MessageID []byte }
Message is the received message.
type Proxy ¶
type Proxy struct { worker.Worker EventSink chan event.Event // contains filtered or unexported fields }
Proxy is a mail proxy server instance.
func (*Proxy) GetRecipient ¶
GetRecipient returns the public key for the provided recipient.
func (*Proxy) IsConnected ¶
IsConnected returns true iff a connection to the provider is established.
func (*Proxy) ListProviders ¶
func (p *Proxy) ListProviders(authorityID string) ([]*pki.MixDescriptor, error)
ListProviders returns a list of Provider identifiers published for the current epoch by the authority identified by authorityID.
func (*Proxy) ListRecipients ¶
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) ParseKeyQueryResponse ¶
ParseKeyQueryResponse parses a response obtained from a key server query.
func (*Proxy) QueryKeyFromProvider ¶
QueryKeyFromProvider enqueues a keyserver lookup from the sender for the specified recipient and returns the message identifier tag.
func (*Proxy) ReceivePeek ¶
ReceivePeek returns the eldest message in the given account's receive queue. The account's receive queue is left intact.
func (*Proxy) ReceivePop ¶
ReceivePop removes and returns the eldest message in the given account's receive queue.
func (*Proxy) RemoveRecipient ¶
RemoveRecipient removes the provided recipient. This has no impact on messages that have already been enqueued for transmission via SendMessage.
func (*Proxy) ScanRecipientDir ¶ added in v0.0.2
ScanRecipientDir looks for for PEM-encoded identities in the ReceipientDir and imports into the recipient Store.
func (*Proxy) SendKaetzchenRequest ¶
func (p *Proxy) SendKaetzchenRequest(senderID, serviceID, providerID string, payload []byte, wantResponse bool) ([]byte, error)
SendKaetzchenRequest enqueues the payload for transmission from the sender to the service on the remote provider, and returns the message identifier tag.
Note: Replies are delivered as `event.KaetzchenReplyEvent`s, via the EventSink channel. It is on the caller to keep track of requests via the message identifier tag to correctly handle responses.
func (*Proxy) SendMessage ¶
SendMessage enqueues payload for transmission from the sender to the recipient (account IDs), and returns he message identifier tag. 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 ¶
SetRecipient sets the public key for the provided recipient.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
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. |