|
1 | 1 | # Ansible Role: Mailpit |
2 | 2 |
|
3 | | -Installs [Mailpit](https://github.com/axllent/mailpit), a Go-based SMTP server and web UI/API for displaying captured emails, on RedHat or Debian-based linux systems. |
| 3 | +<p align="center"> |
| 4 | + <a href="LICENSE.md"> |
| 5 | + <img alt="MIT License" src="https://img.shields.io/github/license/roots/ansible-role-mailpit?color=%23525ddc&style=flat-square" /> |
| 6 | + </a> |
4 | 7 |
|
5 | | -If you're using PHP and would like to route all PHP email into Mailpit, you will need to update the `sendmail_path` configuration option in php.ini, like so: |
| 8 | + <a href="https://github.com/roots/ansible-role-mailpit/releases"> |
| 9 | + <img alt="Release" src="https://img.shields.io/github/release/roots/ansible-role-mailpit.svg?style=flat-square" /> |
| 10 | + </a> |
| 11 | + |
| 12 | + <a href="https://github.com/roots/ansible-role-mailpit/actions"> |
| 13 | + <img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/roots/ansible-role-mailpit/ci.yml?branch=main&style=flat-square" /> |
| 14 | + </a> |
6 | 15 |
|
7 | | - sendmail_path = "{{ mailpit_install_dir }}/mailpit sendmail" |
| 16 | + <a href="https://twitter.com/rootswp"> |
| 17 | + <img alt="Follow Roots" src="https://img.shields.io/twitter/follow/rootswp.svg?style=flat-square&color=1da1f2" /> |
| 18 | + </a> |
| 19 | +</p> |
8 | 20 |
|
9 | | -(Replace `{{ mailpit_install_dir }}` with the actual Mailpit installation directory, which is `/opt/mailpit` by default. |
| 21 | +Installs [Mailpit](https://github.com/axllent/mailpit), an email testing tool for developers, on RedHat or Debian-based linux systems. |
| 22 | +Mailpit acts as both an SMTP server, and provides a web interface to view all captured emails. Mailpit is inspired by MailHog, but much, much faster. |
10 | 23 |
|
11 | 24 | This role is based on https://github.com/geerlingguy/ansible-role-mailhog |
12 | 25 |
|
| 26 | +If you're using PHP and would like to route all PHP email into Mailpit, you will need to update the `sendmail_path` configuration option in php.ini, like so: |
| 27 | + |
| 28 | +```yaml |
| 29 | +sendmail_path = "{{ mailpit_install_dir }}/mailpit sendmail" |
| 30 | +``` |
| 31 | + |
13 | 32 | ## Requirements |
14 | 33 |
|
15 | | -* systemd |
| 34 | +A Debian-based (eg: Ubuntu) or RedHat system running systemd. |
16 | 35 |
|
17 | 36 | ## Role Variables |
18 | 37 |
|
19 | 38 | Available variables are listed below, along with default values (see `defaults/main.yml`): |
20 | 39 |
|
21 | | - mailpit_install_dir: /opt/mailpit |
| 40 | +```yaml |
| 41 | +mailpit_install_dir: /opt/mailpit |
| 42 | +``` |
22 | 43 |
|
23 | 44 | The directory into which the MailHog binary will be installed. |
24 | 45 |
|
25 | | - mailpit_version: 1.0.0 |
| 46 | +```yaml |
| 47 | +mailpit_version: 1.3.8 |
| 48 | +``` |
26 | 49 |
|
27 | 50 | The version of Mailpit that will be installed. You can find the latest version by visiting the [Mailpit project releases page](https://github.com/axllent/mailpit/releases). |
28 | 51 |
|
29 | | - mailpit_release_url: "https://github.com/axllent/mailpit/releases/download/v{{ mailpit_version }}/mailhog-linux-amd64" |
| 52 | +```yaml |
| 53 | +mailpit_release_url: "https://github.com/axllent/mailpit/releases/download/v{{ mailpit_version }}/mailhog-linux-amd64" |
| 54 | +``` |
30 | 55 |
|
31 | | -The Mailpit binary that will be installed. You can find the latest version by visiting the [MailHog project releases page](https://github.com/mailpit/MailHog/releases). |
32 | | - |
33 | | - mailpit_daemonize_bin_path: /usr/sbin/daemonize |
34 | | - |
35 | | -The path to `daemonize`, which is used to launch MailHog via init script. |
36 | | - |
37 | | - mhsendmail_version: 0.2.0 |
| 56 | +## Example Playbook |
38 | 57 |
|
39 | | -## Dependencies |
| 58 | +```yaml |
| 59 | +- hosts: servers |
| 60 | + roles: |
| 61 | + - { role: roots.mailpit } |
| 62 | +``` |
40 | 63 |
|
41 | | - - geerlingguy.daemonize |
| 64 | +## Community |
42 | 65 |
|
43 | | -## Example Playbook |
| 66 | +Keep track of development and community news. |
44 | 67 |
|
45 | | - - hosts: servers |
46 | | - roles: |
47 | | - - { role: roots.mailpit } |
| 68 | +- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots) |
| 69 | +- Participate on the [Roots Discourse](https://discourse.roots.io/) |
| 70 | +- Follow [@rootswp on Twitter](https://twitter.com/rootswp) |
| 71 | +- Read and subscribe to the [Roots Blog](https://roots.io/blog/) |
| 72 | +- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/) |
0 commit comments