• This repository has been archived on 13/Feb/2022
  • Stars
    star
    513
  • Rank 86,178 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Self-hosted server for the ProtonMail client

neutron

Build Status GoDoc

Self-hosted server for Protonmail client.

This project is not affiliated or supported by ProtonMail.

What is it?

Neutron is a server that will allow the ProtonMail client to be used with backends. Several backends are available right now:

  • IMAP: this will read and store messages on your IMAP server. Received messages will stay as is (that is, unencrypted) but messages saved from the web client will be encrypted. You will login to the web client with your IMAP username and password.
  • SMTP: this will send messages using your SMTP server. Messages are sent encrypted to the server. If a recipient's public key is not found, the server will decrypt the message before sending it to this recipient.
  • Filesystem: settings, contacts, keys are stored on disk. Keys are always stored encrypted.
  • Memory: all is stored in memory and will be destroyed when the server is stopped.

Neutron is modular so it's easy to create new backends and handle more scenarios.

Keep in mind that Neutron is less secure than ProtonMail: most servers don't use full-disk encryption and aren't under 1,000 meters of granite rock in Switzerland. Also, SRP is not yet supported (#35). If you use Neutron, make sure to donate to ProtonMail!

Install

Configuration

See config.json. You'll have to change IMAP and SMTP settings to match your mail server config.

{
	"Memory": {
		"Enabled": true,
		"Populate": false, // Populate server with default neutron user
		"Domains": ["emersion.fr"] // Available e-mail domains
	},
	"Imap": { // IMAP server config
		"Enabled": true,
		"Hostname": "mail.gandi.net",
		"Tls": true,
		"Suffix": "@emersion.fr" // Will be appended to username when authenticating
	},
	"Smtp": { // SMTP server config
		"Enabled": true,
		"Hostname": "mail.gandi.net",
		"Port": 587,
		"Suffix": "@emersion.fr" // Will be appended to username when authenticating
	},
	"Disk": { // Store keys, contacts and settings on disk
		"Enabled": true,
		"Keys": { "Directory": "db/keys" }, // PGP keys location
		"Contacts": { "Directory": "db/contacts" },
		"UsersSettings": { "Directory": "db/settings" },
		"Addresses": { "Directory": "db/addresses" }
	}
}

Usage

To generate keys for a new user the first time, just click Sign up on the login page and enter your IMAP credentials.

Options

  • -config: specify a custom config file
  • -help: show help

Build

Requirements:

  • Go (to build the server)
  • Node, NPM (to build the client)
# Get the code
go get -u github.com/emersion/neutron
cd $GOPATH/src/github.com/emersion/neutron

# Build the client
git submodule init
git submodule update
make build-client

# Start the server
make start

Docker

make build-docker
docker build -t neutron .
docker create -p 4000:4000 -v $PWD/config.json:/config.json -v $PWD/db:/db neutron

Backends

All backends must implement the backend interface. The main backend interface is split into multiple other backend interfaces for different roles: ContactsBackend, LabelsBackend and so on. This allows to build modular backends, e.g. a MessagesBackend which stores messages on an IMAP server with a ContactsBackend which stores contacts on a LDAP server and a SendBackend which sends outgoing messages to a SMTP server.

Writing a backend is just a matter of implementing the necessary functions. You can read the memory backend to understand how to do that. Docs for the backend are available here: https://godoc.org/github.com/emersion/neutron/backend#Backend

License

MIT

More Repositories

1

mako

A lightweight Wayland notification daemon
C
2,162
star
2

go-imap

πŸ“₯ An IMAP library for clients and servers
Go
2,064
star
3

go-smtp

πŸ“€ An SMTP client & server library written in Go
Go
1,701
star
4

hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
Go
1,190
star
5

slurp

Select a region in a Wayland compositor
C
932
star
6

grim

Grab images from a Wayland compositor
C
831
star
7

kanshi

Dynamic display configuration (mirror)
C
608
star
8

xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
C
591
star
9

mrsh

A minimal POSIX shell
C
478
star
10

go-message

βœ‰οΈ A streaming Go library for the Internet Message Format and mail messages
Go
379
star
11

go-webdav

A Go library for WebDAV, CalDAV and CardDAV
Go
314
star
12

go-autostart

A Go library to run a command after login
Go
139
star
13

go-msgauth

A Go library and tools for DKIM, DMARC and Authentication-Results
Go
129
star
14

soju

IRC bouncer (mirror)
Go
123
star
15

hello-wayland

A hello world Wayland client, 2018 edition
C
106
star
16

bups

Simple GUI for Bup, a very efficient backup system.
Python
96
star
17

wlr-randr

An xrandr clone for wlroots compositors
C
94
star
18

go-sasl

πŸ”‘ A SASL library written in Go
Go
89
star
19

go-vcard

A Go library to parse and format vCard
Go
88
star
20

libliftoff

Lightweight KMS plane library
C
75
star
21

go-mbox

Package mbox parses the mbox file format into messages and formats messages into mbox files
Go
68
star
22

basu

The sd-bus library, extracted from systemd
C
60
star
23

emuarius

Bridge between Twitter and Mastodon
Go
58
star
24

stability-badges

SVG badges for Go projects
55
star
25

go-pgpmail

πŸ”’ PGP-encrypted email library for Go
Go
50
star
26

python-emailthreads

Python library to parse and format email threads
Python
42
star
27

go-milter

Go library to write mail filters
Go
41
star
28

go-ical

An iCalendar library for Go
Go
40
star
29

go-dkim

A Go library to create and verify DKIM signatures (migrated)
Go
38
star
30

wleird

A collection a Wayland clients doing weird things, for compositor testing
C
37
star
31

go-ostatus

An OStatus library written in Go
Go
32
star
32

go-maildir

A maildir library for Go
Go
32
star
33

go-imap-idle

IDLE extension for go-imap
Go
32
star
34

matcha

A read-only web interface for Git repositories
Go
29
star
35

go-smtp-proxy

A go-smtp-server backend that proxies messages to another SMTP server
Go
26
star
36

meltsub

Convert hardsub to softsub
Python
22
star
37

wlhangul

A Hangul input method for Wayland
C
22
star
38

go-imap-proxy

A go-imap backend that proxies all commands and responses to another IMAP server
Go
21
star
39

net-browserify

net module for browserify, with a websocket server proxy
JavaScript
18
star
40

klaes

An OpenPGP keyserver
Go
16
star
41

drm_monitor

A CLI tool to monitor DRM/KMS state
C
16
star
42

passwordmaker

PasswordMaker powered by WebExtension
JavaScript
15
star
43

glider

Experimental libliftoff-based Wayland compositor
C
15
star
44

phproxy

A proxy in PHP
PHP
13
star
45

go-imap-sortthread

SORT and THREAD extensions for go-imap
Go
13
star
46

ganbo

A WebExtension to export cookies into a cookies.txt file
JavaScript
12
star
47

node-i2c-mpu6050

Read data from MPU6050 with i2c
JavaScript
12
star
48

go-outlook-autodiscover

Generate Microsoft Outlook autodiscover files
Go
12
star
49

php-wrappers

High-performance wrappers for native FTP and SFTP functions.
PHP
12
star
50

firefox-passwordmaker

[UNMAINTAINED] PasswordMaker extension for Firefox
JavaScript
11
star
51

go-openpgp-hkp

A Go library for OpenPGP HTTP Keyserver Protocol (HKP)
Go
10
star
52

go-kdeconnect

A Go library for KDEConnect
Go
10
star
53

what-does-a-linker-do

A collection of small examples demonstrating various linker features
Makefile
10
star
54

go-smtp-mta

A Mail Transfer Agent backend for go-smtp
Go
10
star
55

go-apple-mobileconfig

Create Apple mobileconfig configuration files
Go
10
star
56

osu-skin-default

Default osu! skin
10
star
57

voice-recognition.js

A Javascript library for low-level voice recognition.
JavaScript
10
star
58

go-upnp-igd

Minimal Go UPnP InternetGatewayDevice library
Go
10
star
59

tooru

Archive and sync content you want to see twice
Shell
9
star
60

webpass

A web interface for pass, a UNIX password manager
Go
9
star
61

go-imap-uidplus

UIDPLUS extension for go-imap
Go
9
star
62

nanum-gothic-coding

Nanum Gothic Coding font
CSS
9
star
63

go-imap-id

The IMAP ID Extension for go-imap
Go
9
star
64

go-appdir

Go package to get application directories such as config and cache
Go
8
star
65

facebook-irc-bridge

Bridge between IRC channels and Facebook chat
JavaScript
8
star
66

go-tsm

Terminal-emulator State Machine library for Go
Go
8
star
67

go-mpris

A Go library for MPRIS
Go
8
star
68

go-prefixspan

A Go implementation of the PrefixSpan algorithm
Go
8
star
69

go-textwrapper

A writer that wraps long text lines to a specified length
Go
7
star
70

go-imap-multi

A go-imap backend relying on multiple other backends
Go
7
star
71

go-imap-quota

QUOTA extension for go-imap
Go
7
star
72

go-mtasts

A Go library for SMTP MTA Strict Transport Security
Go
7
star
73

tls-browserify

TLS module for Browserify
JavaScript
6
star
74

go-imap-mbox

A go-imap backend that stores mails in a MBOX file
Go
6
star
75

go-imap-appendlimit

The IMAP APPENDLIMIT Extension for go-imap
Go
6
star
76

caddy-wkd

OpenPGP Web Key Directory plugin for Caddy
Go
6
star
77

node-client-vm

Node client virtual machine - Node.js in the browser!
JavaScript
6
star
78

rust-osu-format

A Rust library to parse .osu files
Rust
6
star
79

go-tryalgo

Basic and (maybe) advanced algorithms and data structures in Go
Go
6
star
80

unfacebookify

Allow unregistered Facebook users to access a group's posts
JavaScript
6
star
81

go-openpgp-wkd

A Go library for OpenPGP Web Key Directory
Go
6
star
82

go-imap-specialuse

Special-Use Mailboxes extension for go-imap
Go
5
star
83

go-imap-metadata

IMAP METADATA extension for go-imap
Go
5
star
84

chromiumos-platform2

[fork] CrOS platform Wayland hacks
C++
5
star
85

go-jsonld

A Go library for JSON-LD
Go
5
star
86

gnomeconnect

A GNOME frontend for KDEConnect
Go
5
star
87

rust-edid

EDID parser in Rust
Rust
5
star
88

minilustre

A tiny compiler for a subset of Lustre
Go
5
star
89

node-servoblaster

ServoBlaster library for Node.js
JavaScript
5
star
90

node-mpu6050-server

A simple test server to visualize data from MPU6050
Python
4
star
91

rustre

A Lustre transpiler to Rust
Rust
4
star
92

node-magi-network

An experimental Magi supercomputer network
JavaScript
4
star
93

go-imap-enable

The IMAP ENABLE Extension for go-imap
Go
4
star
94

remark-server

A CLI tool to serve remark presentations
JavaScript
4
star
95

go-imap-disk

A go-imap backend that stores mails to disk
Go
4
star
96

go-oauthdialog

A Go library to present an OAuth dialog to the user
Go
4
star
97

go-js-canvas

GopherJS bindings for <canvas>
Go
4
star
98

do-dyn-domain

Digital Ocean dynamic domain updater
Go
4
star
99

emersion.fr

Personal Website
HTML
4
star
100

node-unparse

An open-source clone of Parse
JavaScript
4
star