Giter Club home page Giter Club logo

ansible-mail-server's Introduction

Ansible playbook to setup a mail server

This is an Ansible-Playbook for the great mail server setup described in this tutorial: https://thomas-leister.de/mailserver-debian-stretch/ written by Thomas Leister.

Requirements

  • Ansible >= 2.7
  • Server with Debian Bullseye operating system
  • SSH key to login to the server
  • Public domain resolving to the server

Configuration

Inventory

Set the hostname in the inventory file hosts

Variables

All variables are stored in the vars file. Set the values according to your server.

Credentials

Credentials are stored in the vault.yml. The Password is "vault". Please change the password with ansible-vault rekey group_vars/all/vault.yml.

  • Database user: "vmail", pass: "vmail" (Please change it)
  • Mail user: "mail", pass: "mail" (Please change it)
  • Rspam admin password: "rspamadmpw"

Run the playbook

ansible-playbook -i ./hosts site.yml --ask-vault-pass

Test

Molecule

The results of the ansible playbook can be tested with Molecule

Test with molecule

Build the mail server

ANSIBLE_VAULT_PASSWORD_FILE=<YOUR_VAULT_PASS_FILE_PATH> molecule converge

Verify the installation

ANSIBLE_VAULT_PASSWORD_FILE=<YOUR_VAULT_PASS_FILE_PATH> molecule verify

Build, test and destroy in one command

ANSIBLE_VAULT_PASSWORD_FILE=<YOUR_VAULT_PASS_FILE_PATH> molecule test

Bats

Send a email on the ready system with bats

mail_user=USER mail_pass=PASS mail_host=HOST:587 bats smtp.bats

ansible-mail-server's People

Contributors

mubn avatar

Watchers

 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.