Email archive server with SysLog support and web interface.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GRMrGecko 2f58894648 first commit 3 years ago
www first commit 3 years ago
.gitignore first commit 3 years ago
License.txt first commit 3 years ago first commit 3 years ago
api.go first commit 3 years ago
config.go first commit 3 years ago
database.go first commit 3 years ago
go.mod first commit 3 years ago
go.sum first commit 3 years ago
http.go first commit 3 years ago
mail.go first commit 3 years ago
main.go first commit 3 years ago
smtp.go first commit 3 years ago
syslog.go first commit 3 years ago
websocket.go first commit 3 years ago
websocket_handler.go first commit 3 years ago

Mail Archive

Mail Archive is a tool designed to store email copied to it for a limited period of time. It comes with a syslog server designed for use with an email spam gateway, such as Proxmox Mail Gateway, to store logs associated with an email alongside the email itself. The syslog server is designed for use with Postfix, however it can easily be adjusted to work with other email server log messages.

Use with a spam gateway

  1. Configure a (sub)domain with proper mx records for Mail Archive.
  2. Setup Mail Archive with a configuration that meets your need; review the config.go file for available configurations.
  3. Setup your email server to BCC all email to the Mail Archive server.
  4. Setup your syslog server to send copies of messages over to Mail Archive.

Example configuration for rsyslog

# Mail Archive syslog server
*.* @

Use as a debug mail server

Mail Archive can be used as a debug mail server for testing software fairly easily.

Example config

  "http_port": 1080,
  "smtp_port": 1025,
  "syslog_udp": false,
  "ui_disable_spam_reporting": true,
  "ui_disable_logs": true

After saving the config, simply start Mail Archive and configure your software accordingly.

Use with Ruby on Rails

Edit environments/development.rb:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => '', :port => 1025 }
config.action_mailer.raise_delivery_errors = false

Use with PHP

You will have to use PHPMailer for this, as PHP is deisnged to use sendmail to send email. You can configure postfix to copy email to Mail Archive, but that gets complicated.

$mail = new PHPMailer();

$mail->CharSet = 'UTF-8';

$mail->Host       = "";
$mail->Port       = 1025;
$mail->SMTPDebug  = true;

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';


Use with Django

Add the following configuration to your project's

    EMAIL_HOST = ''
    EMAIL_PORT = 1025
    EMAIL_USE_TLS = False


The API is available at path /api and is fairly feature rich.


Test to see that the server responds correctly.


Retrieve the configuration for the web UI and current message count.


Pull a list of messages from the message log along with metadata.

Supported parameter:

Parameter Description
q Search query
p Page number


Returns the log associated with a message.


Returns the original email source.


Returns the email's text body.


Returns the email's html body.


Report a message as ham to your spam reporting API.


Report a message as spam to your spam reporting API.


Pull metadata on a specific message.


There are a few items that must be gathered first before Mail Archive will work.

Bower Components

Bower is a browser package manager which is installable via npm. Once bower is available on your computer, simply go into the www directory and run the following.

bower install

Building Mail Archive

Go into the main directory for Mail Archive and run the following to build. You will need golang to build.

go build