Disposable webmail server (similar to Mailinator) with built in SMTP, POP3, RESTful servers; no DB required.

Inbucket

Build Status Docker Image

Inbucket is an email testing service; it will accept messages for any email address and make them available via web, REST and POP3 interfaces. Once compiled, Inbucket does not have any external dependencies - HTTP, SMTP, POP3 and storage are all built in.

A Go client for the REST API is available in github.com/inbucket/inbucket/pkg/rest/client - Go API docs

Read more at the Inbucket Website

Screenshot

Development Status

Inbucket is currently production quality: it is being used for real work.

Please see the Change Log and Issues List for more details. If you'd like to contribute code to the project check out CONTRIBUTING.md.

Docker

Inbucket has automated Docker Image builds via Docker Hub. The stable tag tracks our master branch (releases), latest tracks our unstable development branch.

Building from Source

You will need functioning Go and Node.js installations for this to work.

git clone https://github.com/inbucket/inbucket.git
cd inbucket/ui
npm ci
npm run build
cd ..
go build ./cmd/inbucket

For more information on building and development flows, check out the Development Quickstart page of our wiki.

Configure and Launch

Inbucket reads its configuration from environment variables, but comes with reasonable defaults built-in. It should work on most Unix and OS X machines as is. Launch the daemon:

./inbucket

By default the SMTP server will be listening on localhost port 2500 and the web interface will be available at localhost:9000.

See doc/config.md for more information on configuring Inbucket, but you will likely find the Configurator tool the easiest way to generate a configuration.

About

Inbucket is written in Go and Elm.

Inbucket is open source software released under the MIT License. The latest version can be found at https://github.com/inbucket/inbucket

Comments
  • Docker hub builds no longer function

    Docker hub builds no longer function

    Docker hub is eliminating their free build service. We can either get approved as an open source project, or switch to pushing the build we already do via GitHub actions to https://hub.docker.com/

    I'm leaning towards the latter.

  • Concurrency issues

    Concurrency issues

    Inbucket seems to handle poorly multiple emails receiving:

    my test python script:

    from multiprocessing.pool import ThreadPool
    import requests
    import time
    
    p = ThreadPool(500)
    
    eml = """
    To: [email protected]
    From: Empty <[email protected]>
    Subject: Empty message
    Message-ID: <[email protected]>
    Date: Fri, 10 Nov 2017 15:09:34 +0300
    X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
     attachmentreminder=0; deliveryformat=4
    User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
     Thunderbird/52.4.0
    MIME-Version: 1.0
    Content-Type: text/plain; charset=utf-8; format=flowed
    Content-Language: en-US
    Content-Transfer-Encoding: 7bit
    
    Some text
    """
    
    def send(i):   
        import smtplib                                                       
        cli = smtplib.SMTP('localhost', port=10025)                     
        cli.sendmail('[email protected]', ['[email protected]'], eml)
    
    requests.delete('http://localhost:10080/api/v1/mailbox/test')
    print("mailbox size after purge: {}".format(len(requests.get('http://localhost:10080/api/v1/mailbox/test').json())))
    time.sleep(1)
    p.map(send, range(1000))
    time.sleep(1)
    print("mailbox size after send: {}".format(len(requests.get('http://localhost:10080/api/v1/mailbox/test').json())))
    

    Excpected: result:

    mailbox size after purge: 0
    mailbox size after send: 1000
    

    Actual result:

    mailbox size after purge: 0
    mailbox size after send: %MUCH LOWER NUMBER%
    

    Number of emails I see is usually around 20-50, but it differs from run to run

    My inbucket config:

    # inbucket.conf
    # Configuration for Inbucket inside of Docker
    #
    # These should be reasonable defaults for a production install of Inbucket
    
    #############################################################################
    [DEFAULT]
    
    # Not used directly, but is typically referenced below in %()s format.
    install.dir=/opt/inbucket
    default.domain=inbucket.local
    
    #############################################################################
    [logging]
    
    # Options from least to most verbose: ERROR, WARN, INFO, TRACE
    level=INFO
    
    #############################################################################
    [smtp]
    
    # IPv4 address to listen for SMTP connections on.
    ip4.address=0.0.0.0
    
    # IPv4 port to listen for SMTP connections on.
    ip4.port=10025
    
    # used in SMTP greeting
    domain=%(default.domain)s
    
    # optional: mail sent to accounts at this domain will not be stored,
    # for mixed use (content and load testing)
    domain.nostore=bitbucket.local
    
    # Maximum number of RCPT TO: addresses we allow from clients, the SMTP
    # RFC recommends this be at least 100.
    max.recipients=100
    
    # How long we allow a network connection to be idle before hanging up on the
    # client, SMTP RFC recommends at least 5 minutes (300 seconds).
    max.idle.seconds=300
    
    # Maximum allowable size of message body in bytes (including attachments)
    max.message.bytes=20480000
    
    # Should we place messages into the datastore, or just throw them away
    # (for load testing): true or false
    store.messages=true
    
    #############################################################################
    [pop3]
    
    # IPv4 address to listen for POP3 connections on.
    ip4.address=0.0.0.0
    
    # IPv4 port to listen for POP3 connections on.
    ip4.port=10110
    
    # used in POP3 greeting
    domain=%(default.domain)s
    
    # How long we allow a network connection to be idle before hanging up on the
    # client, POP3 RFC requires at least 10 minutes (600 seconds).
    max.idle.seconds=600
    
    #############################################################################
    [web]
    
    # IPv4 address to serve HTTP web interface on
    ip4.address=0.0.0.0
    
    # IPv4 port to serve HTTP web interface on
    ip4.port=10080
    
    # Name of web theme to use
    theme=bootstrap
    
    # Prompt displayed between the mailbox entry field and View button. Leave
    # empty or comment out to hide the prompt.
    mailbox.prompt=@inbucket
    
    # Path to the selected themes template files
    template.dir=%(install.dir)s/themes/%(theme)s/templates
    
    # Should we cache parsed templates (set to false during theme dev)
    template.cache=true
    
    # Path to the selected themes public (static) files
    public.dir=%(install.dir)s/themes/%(theme)s/public
    
    # Path to the greeting HTML displayed on front page, can be moved out of
    # installation dir for customization
    greeting.file=/con/configuration/greeting.html
    
    # Key used to sign session cookie data so that it cannot be tampered with.
    # If this is left unset, Inbucket will generate a random key at startup
    # and previous sessions will be invalidated.
    #cookie.auth.key=secret-inbucket-session-cookie-key
    
    # Enable or disable the live message monitor tab for the web UI. This will let
    # anybody see all messages delivered to Inbucket.  This setting has no impact
    # on the availability of the underlying WebSocket.
    monitor.visible=true
    
    # How many historical message headers should be cached for display by new
    # monitor connections.  It does not limit the number of messages displayed by
    # the browser once the monitor is open; all freshly received messages will be
    # appended to the on screen list.  This setting also affects the underlying
    # API/WebSocket.
    monitor.history=30
    
    #############################################################################
    [datastore]
    
    # Path to the datastore, mail will be written into subdirectories
    path=/con/data
    
    # How many minutes after receipt should a message be stored until it's
    # automatically purged.  To retain messages until manually deleted, set this
    # to 0
    retention.minutes=4320
    
    # How many milliseconds to sleep after purging messages from a mailbox.
    # This should help reduce disk I/O when there are a large number of messages
    # to purge.
    retention.sleep.millis=100
    
    # Maximum number of messages we will store in a single mailbox. If this
    # number is exceeded, the oldest message in the box will be deleted each
    # time a new message is received for it.
    mailbox.message.cap=3000
    

    All emails seem to be present in /con/data/mail/a94/a94a8f/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3/ folder they are just missing in index.

    Any help is much appreciated

  • Add list-all-mails function in WebUI

    Add list-all-mails function in WebUI

    In order not to search for the mailbox containing mails (or even worse trying to find the hash in a hash database) when you do not want to remember which addresses had mails sent to, please allow either a list of mailboxes containing more than zero mails or allow a wildcard in the mailbox name.

    Though it's a bit lazy I'm not able to remember which addresses do have mails sent to but I eventually need to look at those mails. Having the data store metric "Currently Retained: 15" I know there are messages and I could take a look into the filesystem to identify those 15 mails but having a UI method to list those messages either by a list of mailboxes or a * search returning all 15 mails as if they were in a single mailbox would be way more convenient.

  • helm chart using stable tag

    helm chart using stable tag

    Hey there,

    first off, thanks for such an awesome an helpful tool!

    when deploying the provided helm chart into kubernetes using the stable image from hub.docker.com the deployment (readiness and liveness probe) fails because the exposed ports where changed from 10080/10025/10110 to 9000/2500/1100.

    Are you planing to provide a helm chart and docker image(tag) for v2.0.0?

    If I can be of any assistance in that manner please let me know. I rather deploy the chart right from the source than maintain a custom chart in our repo.

  • Current Helm Chart Seems Incompatible w/ Helm 3

    Current Helm Chart Seems Incompatible w/ Helm 3

    Attempting a deployment over an existing deployment w/ the current helm chart results in the following error messages.

    error occurred while rolling back the release. original upgrade error: cannot patch "email-inbucket" with kind Service: Service "email-inbucket" is invalid: spec.clusterIP: Invalid value: "": field is immutable: cannot patch "email-inbucket" with kind Service: Service "email-inbucket" is invalid: spec.clusterIP: Invalid value: "": field is immutable
    

    This issue looks like it can be simply resolved by changing service.yaml to not omit the clusterIP property unless it is defined. See: https://github.com/helm/helm/issues/6378#issuecomment-557746499

    spec:
      type: "{{ .Values.service.type }}"
      {{ with .Values.service.clusterIP }} clusterIP: "{{ . }}"{{ end }}
    

    Unfortunately the old helm repository for storing "all the charts" has been deprecated and they are looking for software maintainers to handle their own helm packages now, so it likely would need to be pulled over here, or into another repository under the /inbucket organization.

    https://helm.sh/blog/charts-repo-deprecation/

  • Increasing disk usage with file storage

    Increasing disk usage with file storage

    Hi, I run a high-traffic instance of inbucket. I realize sometimes, I have 100% disk utilization and need to manually delete inbucket file storage with rm -rf.

    I'm trying to figure out the reason behind it, since the graph of disk usage does not peak in a day, but builds upon slowly by time.

    screen shot 2018-09-07 at 06 45 24

    This graph is strange to me, because my retention period is 24h.

    Another strange thing I noticed is this:

    screen shot 2018-09-07 at 06 46 43

    Last retention scan is 6 days ago (which is the time inbucket crashed and restarted itself) although my retention period is being 24h.

    What am I missing here?

    Can this be fixed by playing with INBUCKET_STORAGE_RETENTIONSLEEP config variable?

    Thanks in advance

  • utf8 in sender name not shown correctly

    utf8 in sender name not shown correctly

    Version:1.2.0-rc1

    When reciving a mail from the sender "XLT-äéßsvu XLT-äéßy" with the mail address [email protected] he is shown in inbucket monitor and mail as "=?utf-8?q?XLT-=C3=A4=C3=A9=C3=9Fw_XLT-=C3=A4=C3=A9=C3=9Ftfucuui?= [email protected]"

    image

    While sending the mail to outlook shows the senders name correctly.

  • Configurable URL base path

    Configurable URL base path

    We can't find a way to use inbucket behind a nginx proxy as a subdirectory since all path are hard-coded to work as root directory.

    Do you have any idea how to do such a thing ?

    It could be nice to have something like this : http://some.domain/inbucket/

  • Docker image should run non-root

    Docker image should run non-root

    Inbucket currently runs as root inside a docker container. The build, install and startup scripts should be modified such that it runs as a non-privileged user account.

  • Issue receiving email from Windows Defender

    Issue receiving email from Windows Defender

    Here is a conversation between an MTA (I've been told this is "Windows Defender mail protection", but I don't know much about the remote system) and inbucket:

    220 bitbucket.bentonvillek12.org Inbucket SMTP ready
    EHLO GCC02-BL0-obe.outbound.protection.outlook.com
    250-Great, let's get this show on the road
    250-8BITMIME
    250-AUTH PLAIN LOGIN
    250 SIZE 10240000
    MAIL FROM:<[email protected]> SIZE=38677 AUTH=<>
    501 Was expecting MAIL arg syntax of FROM:<address>
    QUIT
    

    image

    I don't know enough about SMTP to know who broke protocol here, but the remote system is in production use and sending many emails a day, so I'm guessing inbucket made the mistake.

  • Monitor does not show old messages after restart

    Monitor does not show old messages after restart

    Hi, I'm not sure if this is expected behavior or not.

    I have setup a volume to /storage, and used an environment variable for INBUCKET_STORAGE_PARAMS="path:/storage". Everything works fine until I stop and start the container. Once I do that I no longer see messages on the monitor tab.

    On the Status tab, I do see the Stored Messages show the correct number of messages. When I open a mailbox, those messages are present too. So I know the volume is persisting correctly.

    I'm treating the Monitor tab as the inbox of all inbox. Is it possible to have all the old messages display again on the Monitor tab after a container restart?

  • Find all mailboxes that received emails with specific subject

    Find all mailboxes that received emails with specific subject

    Hi, firstly, I want to say thank you for this great tool! Maybe somebody asked you early, about search mailboxes by email subject. In my case, I need to find all mailboxes that received email with "some specific" subject. Some alternative tools have this feature, but I don't like them )) It will be great if you can realize this feature!

  • ability to disable the

    ability to disable the "Delete" button

    I've added this paragraph to my greetings.html file:

    Pay attention using the  [Delete] / [Trash Icon]  buttons
    they permanently delete the selected files or the ENTIRE mailbox.
    This action cannot be undone.
    

    An environment variable to disable them would be very much appreciated.

    P.S. the use case is similar to the "Temp mail service" described here: https://github.com/inbucket/inbucket/discussions/239

  • Enable STARTTLS option - Intermediate Certificate missing

    Enable STARTTLS option - Intermediate Certificate missing

    I've configured the environment variables: INBUCKET_SMTP_TLSENABLED, INBUCKET_SMTP_TLSPRIVKEY, INBUCKET_SMTP_TLSCERT

    After testing the receipt with https://www.checktls.com/TestReceiver, I got: TLS OK - Cert FAIL

    The connection log provided by checktls.com says: Certificate #1 of 1 (sent by MX): Cert VALIDATION ERROR(S): unable to get local issuer certificate This may help: What Is An Intermediate Certificate So email is encrypted but the recipient domain is not verified

    The workaround is to add the intermediate certificate within the INBUCKET_SMTP_TLSCERT file !! AFTER the domain cert, otherwise it does not work !! result: TLS OK - Cert OK

    Maybe you could add a new environment variable for the intermediate certificate, something like: INBUCKET_SMTP_TLSCERTCHAIN

  • Support for disabling loading any external resource

    Support for disabling loading any external resource

    Love this project and have been using it for a long time. I was wondering if you would be willing to add a setting to disable loading any external resource (images, etc). When you click on an email it will automatically load the HTML view and load any images, alerting the receiver with tracking tags.

    At the very least if we could have an option to default into the plain text view and then only if you click a button would it load the HTML with external dependencies.

    Thanks!

  • Hook/Event interface MVP

    Hook/Event interface MVP

    Add hooks for extensions/plugins:

    • Accept (or reject) inbound message
    • New message stored
    • Message deleted

    Existing MessageHub service could likely be moved to use hooks to help validate the impl.

    Not in scope, potential follow-ups:

    • Plugin infrastructure (dynamic loading, RPC, etc)
    • Rewriting addresses
  • Internationalised Domain Names (IDN) support

    Internationalised Domain Names (IDN) support

    Hi and thanks for the great software! can you add support for internationalised domain names (IDN)? I did try both with unicode and punycode format, but no luck.

This command line tool exports .eml files from POP3 account.

export-mail This command line tool exports .eml files from POP3 account. Install > go get github.com/gonejack/export-mail Usage > export-mail --host i

Dec 6, 2021
golang honeypot smtp server
golang honeypot smtp server

honeygogo-smtp standalone honeypot A lightweight SMTP honeypot server written in Go, leveraging go-smtp. A stand alone version of a module from honeyg

May 4, 2022
Simple SMTP Server for Testing

go-smtptester Simple SMTP Server for Testing. How it works All received mails are saved in a sync.Map with a key: From+Recipient1+Recipient2 Mails to

Nov 18, 2021
Golang package for send email. Support keep alive connection, TLS and SSL. Easy for bulk SMTP.

Go Simple Mail The best way to send emails in Go with SMTP Keep Alive and Timeout for Connect and Send. IMPORTANT Examples in this README are for v2.2

Jan 8, 2023
Lightweight SMTP client written in Go

Hectane Hectane is both a Go package providing an SMTP queue for sending emails and a standalone application that exposes this functionality via an HT

Nov 23, 2022
Web and API based SMTP testing
Web and API based SMTP testing

MailHog Inspired by MailCatcher, easier to install. Download and run MailHog Configure your outgoing SMTP server View your outgoing email in a web UI

Jan 4, 2023
MailHog SMTP Protocol

MailHog SMTP Protocol github.com/mailhog/smtp implements an SMTP server state machine. It attempts to encapsulate as much of the SMTP protocol (plus i

Oct 27, 2022
:incoming_envelope: Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)
:incoming_envelope: Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)

go-mail Lightweight email package with multi-provider support (ses, mandrill, postmark) Table of Contents Installation Documentation Examples & Tests

Dec 10, 2022
envio de email via SMTP com anexo usando Go

gosendmail - SMTP This repo is a simple net/smtp abstraction for sending emails using SMTP. With it we can send emails With copy, with blind copy and

Aug 18, 2022
Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade

smtptest Simple tool to test SMTP mail send with various settings including TLS1.1 downgrade All settings are configurable in the config.yaml file ser

Sep 19, 2022
Pretty wrapper for sending email using go net/smtp

Emailer A pretty wrapper around go net/smtp send multiple email using single client func main() { var client *emailer.Client var clientX sync.Mute

Mar 23, 2022
:inbox_tray: An IMAP library for clients and servers

go-imap An IMAP4rev1 library written in Go. It can be used to build a client and/or a server. Usage Client package main import ( "log" "github.com

Jan 6, 2023
Monitoring and automation for Open Source email servers, starting with Postfix.
Monitoring and automation for Open Source email servers, starting with Postfix.

Welcome to Lightmeter Control Center, the Open Source mailops monitoring application.

Dec 19, 2022
Filtering spam in mail server, protecting both client privacy and server algorithm

HE Spamfilter SNUCSE 2021 "Intelligent Computing System Design Project" Hyesun Kwak Myeonghwan Ahn Dongwon Lee abstract Naïve Bayesian spam filtering

Mar 23, 2022
Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ
Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Sending emails using email server talking to RabbitMQ and send grid server sending emails to email ids consumed from RabbitMQ

Oct 27, 2022
BotHub - BotHub is a web-based robot editor built in go with support for go and python

Robot Simulator This is an application to simulate toy robot moving on a square

May 16, 2022
✉️ Composable all-in-one mail server.

Maddy Mail Server Composable all-in-one mail server. Maddy Mail Server implements all functionality required to run a e-mail server. It can send messa

Dec 27, 2022
Email 2.0 server
Email 2.0 server

RIGEL.Email Secure, fast and free email 2.0 server. Download latest version Linux, BSD, Mac OS X and Windows versions available. Supported fetures in

Jan 7, 2022
A simple Go POP3 client library for connecting and reading mails from POP3 servers.

go-pop3 A simple Go POP3 client library for connecting and reading mails from POP3 servers. This is a full rewrite of TheCreeper/go-pop3 with bug fixe

Dec 17, 2022
Instant, disposable, single-binary web based live chat server. Go + VueJS.
Instant, disposable, single-binary web based live chat server. Go + VueJS.

Niltalk Niltalk is a web based disposable chat server. It allows users to create password protected disposable, ephemeral chatrooms and invite peers t

Jan 4, 2023