proxy

package module
v0.0.0-...-f221f67 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: MIT Imports: 6 Imported by: 0

README

go-imap-proxy

A go-imap backend that proxies all commands and responses to another IMAP server.

Usage

package main

import (
	"log"

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

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

	// 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 Backend

type Backend struct {
	Addr      string
	Security  Security
	TLSConfig *tls.Config
	// contains filtered or unexported fields
}

func New

func New(addr string) *Backend

func NewTLS

func NewTLS(addr string, tlsConfig *tls.Config) *Backend

func (*Backend) Login

func (be *Backend) Login(username, password string) (backend.User, error)

type Security

type Security int
const (
	SecurityNone Security = iota
	SecuritySTARTTLS
	SecurityTLS
)

Jump to

Keyboard shortcuts

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