email

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: LGPL-3.0 Imports: 1 Imported by: 0

README

_________                 ______
______  /________   _________  /
_  __  /_  __ \_ | / /  _ \_  / 
/ /_/ / / /_/ /_ |/ //  __/  /  
\__,_/  \____/_____/ \___//_/

dovel development home

Welcome! This is the git repository of the dovel.email project, here you'll find the go code and template pages. Feel free to send us email and contribute.

Some code meta information:

Go Report Card Go Reference

Also, take a look at our landing page:

dovel website

Documentation

Overview

email is a SMTP server that is simple to setup and use.

The binary is the main server, it is configured using a single config file which should be located in ~/.config/dovel/config.json. This server is responsible to receive your emails and save them according to your hooks.

The structure of this config file is git.derelict.garden/dovel/email/config.Config. See that doc for more info.

Setting up your email server

Email works in a complex way, DNS records must match your server's configuration. This guide will try to give more detailed information in comparison with the website tutorial.

An email server typically listens on ports 25, 2525, 587 or 465 for mail exchange. But their use differ:

  • 25: is the original SMTP port and first to be official by RFC.
  • 465: is marked as deprecated.
  • 587: is also official by RFC, this port is used for TLS encrypted mail.

The current recomendation is to use port 586. Dovel works with any port, and the value must be set in the port field of the config file. To configure this server see git.derelict.garden/dovel/email/config.Config.

To receive email only the MX record is enough. Everytime dovel receives an email it searches for an executable file in $XDG_CONFIG_DIR/dovel/hooks/ named receive-DOMAIN, for the DOMAIN receiving the email and executes it passing the email in mbox format as standard input. Then it is up to the script to decide what to do. See the scripts repo for examples.

Hooks

A simple hook is a shell script that simply concatenates the received email to a .mbox file, e.g. to receive email for your domain create a file named receive-<DOMAIN> in the hooks folder with the following content:

#!/bin/sh
cat > ~/mail/dovel.mbox

Be sure to make the file executable.

Configuring DNS records

To receive emails you need to setup the MX record in your domain registrar, sending email is more complicated, some receiving servers only need the SPF and PTR records, some also need DKIM and DMARK, adjust according to your needs.

Sending email

Dovel also sends email, for that it needs a valid VaultFile path on the config. That means you need at least one user descrived on the json file. The format of that file is a JSON array of the User struct.

Dovel is listening to commands on the port specified in the config file use any email client to communicate with dovel.

package email contains interfaces that are passed to the common functions on the server and web projects. You can import this to use on templates and handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.9.0

type Config struct {
	Port      string
	Domain    string
	VaultFile string
}

Config is used to configure your email server. Port is used to specify which port the server should listen to connections, a typicall value is 2525. Domain is what the server should respond in a HELO or EHLO request. VaultFile is the path to a json file containing the list of users that can send email.

type User added in v0.9.0

type User struct {
	Name       string
	Email      string
	Password   string
	PrivateKey crypto.Signer
}

func (User) Login added in v0.9.0

func (w User) Login() string

func (User) Pass added in v0.9.0

func (w User) Pass() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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