Coder Social home page Coder Social logo

docker-mailcollect's Introduction

docker-mailcollect

What is this image intended for?

This Image can be used to create a container which offers a smtp service to other docker containers and collects all mails in one place. This service is not intented to send mails to their receipients. Its a service that helps developers to build mail-sending applications without mockups on application layer.

All sent mails appear in one developer inbox as they would appear in a real receipients inbox.

How to use this image

To run the Container do

docker run --name mailcollect -d -p 127.0.0.1:143:143 docker.io/useltmann/mailcollect

this starts the container named mailcollect and listens on localhost port 143 for your mail client.

To access all mails you have to set up your mail client to connect to the imap service the container provides:

  • server: localhost or 127.0.0.1
  • port: 143 (the default imap port)
  • username: dev
  • password: dev

All settings to send mails are regardless since this container only delivers mail. If you have to fill in something, feel free to make them up and hope your mail client does not verify them.

Add custom ip address ranges to allowed networks

By default the smtp service only takes emails from hosts within private ip address ranges. However, if you want to allow custom ip addresses or ranges to allowed networks you can add them with the environment variable NETWORKS. Multiple address ranges are delimited by comma.

docker run --name mailcollect -d -p 127.0.0.1:143:143 \
  -e NETWORKS=123.45.6.7/32,8.9.0.0/16 \
  docker.io/useltmann/mailcollect

Alternative access via Maildir

Since the service is configured to save the emails in Maildir format you can easily access this folder via dockers volume sharing. Therefore you have to run the container with the parameter -v /path/to/local/Maildir:/home/dev/Maildir to bind your hosts folder which is accessable by the developer to the Maildir folder of the containers user all mail is sent to.

After that you can configure your mail client which obviously needs to be cabable to access mails in Maildir format to access that folder. Therefore you can omit the port redirection parameter which binds the imap port to your local interface.

Usage in other containers

In order to receive all mails at one place that mails have to be sent in the first place, right? So how does that work?

The container - once up - has to be linked into the container that shall use its smtp service. to do so you have to run your mail sending container with the parameter

`--link mailcollect:smtp`

this tells docker to expose the - already up and running - container mailcollect to the container you are intended to start. once up you can reach the smtp service on

  • host smtp, the alias you specified as above
  • port 25, the default smtp port

you can now configure your application to use this as smtp

neither is there a login required, nor are other security related mechanism at work. this service is not to be meant secure.

there is at least one image that makes use of this image for development purposes: docker.io/useltmann/dev-dotdeb which is a development testing environment for php/mysql applications.

docker-mailcollect's People

Contributors

smoebody avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.