{"id":20947552,"url":"https://github.com/kristijorgji/docker-mailserver","last_synced_at":"2026-03-27T04:57:23.054Z","repository":{"id":46784239,"uuid":"513583373","full_name":"kristijorgji/docker-mailserver","owner":"kristijorgji","description":"A docker image providing a working mailserver","archived":false,"fork":false,"pushed_at":"2022-07-27T10:40:06.000Z","size":451,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T22:14:16.677Z","etag":null,"topics":["dovecot","imap","mailserver","pop3","postfix","smt"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kristijorgji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T15:53:52.000Z","updated_at":"2023-07-11T14:39:47.000Z","dependencies_parsed_at":"2022-09-07T02:11:08.377Z","dependency_job_id":null,"html_url":"https://github.com/kristijorgji/docker-mailserver","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fdocker-mailserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fdocker-mailserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fdocker-mailserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristijorgji%2Fdocker-mailserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristijorgji","download_url":"https://codeload.github.com/kristijorgji/docker-mailserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243345570,"owners_count":20275869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dovecot","imap","mailserver","pop3","postfix","smt"],"created_at":"2024-11-19T00:12:01.040Z","updated_at":"2025-12-29T02:11:05.959Z","avatar_url":"https://github.com/kristijorgji.png","language":"Jinja","readme":"# docker-mailserver\n\n[![ci::status]][ci::github] [![docker::pulls]][docker::hub] \n\n[ci::status]: https://img.shields.io/github/workflow/status/kristijorgji/docker-mailserver/Publish?color=blue\u0026label=CI\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge\n[ci::github]: https://github.com/kristijorgji/docker-mailserver/actions\n[docker::pulls]: https://img.shields.io/docker/pulls/kristijorgji/docker-mailserver.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white\n[docker::hub]: https://hub.docker.com/r/kristijorgji/docker-mailserver/\n\n1. [About](#about)\n2. [Requirements](#requirements)\n3. [How to use](#how-to-use)\n   1. [How to update domains and users on fly](#how-to-update-domains-and-users-on-the-fly)\n   2. [How to setup email aliases](#setting-up-aliases)\n4. [How to connect via a mail client (Thunderbird)](docs/thunderbird/how-to-connect-with-thunderbird.md)\n5. [How to develop locally](#how-to-develop-locally)\n6. [How to test and troubleshoot the setup](docs/how-to-test-and-troubleshot-the-setup.md)\n\n# About\n\nA docker image that will provide an out of the box mailserver using\n\n* postfix\n* dovecot\n* IMAP and POP with mysql driver so you can use mail clients like Thunderbird with ease\n* Multiple domains supported, you can have send or receive emails coming for both me@example.com and me@whatever.com\n* roundcube UI to send and check the received emails [WIP] \n\n# Requirements\n\n**Tools**\n- [Docker](https://www.docker.com/) installed\n- [Docker compose](https://docs.docker.com/compose/) installed\n\n**Prerequisites** \n- Your **mx record** points to the machine where you will use this docker mailserver will run\n  - ![MX Record Namescheap Example](./docs/mx-record-example.png)\n- Your _mailserver domain_ **A record (or cname)** points to the machine where  this docker mailserver will run.\n  - ![CNAME Mailserver Domain Record Namescheap Example](./docs/maildomain-cname-example.png)\n- Your webserver is configured to listen for your _mailserver domain_ port 80, so letsencrypt can generate and renew the ssl certificate\n- You need to expose the ports that you will use through your security group or firewall. Port 465 and 143 must be available, the rest are optional only if you use them\n  - 25     # smtp\n  - 465    # smtps\n  - 110    # pop3\n  - 143    # imap\n  - 993    # imaps\n  - 995    # pop3s\n\n**System requirements**\n\n**Recommended**:\n\n- 1 Core\n- 2GB RAM\n- Swap enabled for the container\n\n**Minimum**:\n\n- 1 vCore\n- 512MB RAM\n- You'll need to deactivate some services like ClamAV to be able to run on a host with 512MB of RAM. Even with 1G RAM you may run into problems without swap\n\n# How to use\n\nFirst execute the following command to download and install the tool.\nYou can change `docker-mailserver` in the third line with whatever path you want for the install\n\n```shell\ncurl -LJO https://raw.githubusercontent.com/kristijorgji/docker-mailserver/main/install.sh \\\n \u0026\u0026 chmod a+x install.sh \\\n \u0026\u0026 ./install.sh docker-mailserver\n```\n\nAfter the installation you will see a message of what configurations you can make before starting the docker container of the mailserver\n\nYou can modify those variables to your wishes, those involve things like\n* your mailserver domain name\n* your mailserver supported domains (can have more than one)\n* your mailserver users\n* etc\n\nIf you want to make more changes to the configurations of postfix/dovecot or any tool, just modify the `jinja2` templates at configs folder after the tool installs the mailserver.\n\n\nEverything else is auto-generated during the start of the container including the self signed ssl certificates with the domain name provided\nThe provisioning is done via ansible and jinja2 templates, that is why the configuration templates end in `.j2` extension\n\n## How to update domains and users on the fly\n\nFirst change the configuration at `configs/vars/vault.yml` which contains your email accounts and domains.\n\nAfterward from the root of this project run\n```shell\n. update.sh\n```\n\nThat is all.\n\n## Setting up aliases\nExample: All emails targeting myfriend@example.com should be received only by me@example.com\n\nNOTE: myfriend@example.com will not receive anything in this setup.\n\nThis is very easy to setup.\n\nChange configs/vars/vault.yml `mail_virtual_aliases` variable and list the alias there like below:\n```yaml\nmail_virtual_aliases:\n  - { id: 1, domainId: 1, source: \"myfriend@example.com\", destination: \"me@example.com\" }\n```\n\nPS: The domainId will be the id of the domain you use, but technically it does not matter much redirect will even work across domains for same mailserver\n\nFinally run the update script\n```shell\n. update.sh\n```\n\n# How to develop locally\n\nRun `make ress` to create a docker image and log into one container created from the created image\n\nAfterward you can execute the boot provisioning by going to \n`cd /dev-docker-data`\n\nthen `bash entrypoint.sh`\n\nOr if you want only to execute the ansible provisioning, can do:\n```shell\ncd /dev-docker-data/ansible\nansible-playbook playbook.yml\n```\n\n# [How to test and troubleshoot the setup](docs/how-to-test-and-troubleshot-the-setup.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristijorgji%2Fdocker-mailserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristijorgji%2Fdocker-mailserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristijorgji%2Fdocker-mailserver/lists"}