pgpmail

package module
v0.0.0-...-03c895a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: MIT Imports: 2 Imported by: 0

README

go-pgpmail

A mail library that encrypts messages with PGP. It contains:

Usage

This example creates a server that acts as a proxy to another server, but automatically decrypts and encrypts messages that are downloaded and uploaded.

package main

import (
	"log"

	"github.com/emersion/go-imap/server"
	"github.com/emersion/go-imap-proxy"
	pgp "github.com/emersion/go-pgpmail/imap"
	"github.com/emersion/go-pgpmail/local"
)

func main() {
	be := pgp.New(proxy.NewTLS("mail.example.org:993", nil), local.Unlock)

	// Create a new server
	s := server.New(be)
	s.Addr = ":1143"
	// Since we will use this server for testing only, we can allow plain text
	// authentication over unencrypted connections
	s.AllowInsecureAuth = true

	log.Println("Starting IMAP server at localhost:1143")
	if err := s.ListenAndServe(); err != nil {
		log.Fatal(err)
	}
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnlockFunction

type UnlockFunction func(username, password string) (openpgp.EntityList, error)

func UnlockRemember

func UnlockRemember(f UnlockFunction) UnlockFunction

func UnlockSync

func UnlockSync(f UnlockFunction) UnlockFunction

Directories

Path Synopsis
Package imap provides a go-imap backend that encrypts and decrypts PGP messages.
Package imap provides a go-imap backend that encrypts and decrypts PGP messages.
Uses the local GPG key store.
Uses the local GPG key store.
Package smtp provides a go-smtp-server backend that encrypts messages with PGP.
Package smtp provides a go-smtp-server backend that encrypts messages with PGP.

Jump to

Keyboard shortcuts

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