Skip to content

Commit d8471cf

Browse files
committed
replaces mailhog with mailpit
1 parent 9c5aebb commit d8471cf

File tree

13 files changed

+85
-121
lines changed

13 files changed

+85
-121
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ DISCLAMER: since it is a community driven project it is only smoke-tested and co
88

99
# Addons list
1010

11-
| Name | Description | Requirements |
12-
|--- |--- |--- |
13-
| **[example](example)** | A working documentation on what is Docksal addon and how it works | |
14-
| [adminer](adminer) | [Adminer](https://www.adminer.org/) database management tool | MySQL |
15-
| [andock](andock) | [Andock](https://andock.readthedocs.io/en/latest/) makes it dead simple to get Docksal environments up on your server. | Docksal |
16-
| [artisan](artisan) | Runs [Laravel's Artisan](https://laravel.com/docs/artisan) command in `cli`. **Requires** artisan pre-installed inside `cli`. | Laravel, Artisan |
17-
| [blt](blt) | Acquia BLT tool launcher (requires [BLT installation](https://blog.docksal.io/docksal-and-acquia-blt-1552540a3b9f)) | Drupal |
18-
| [codeclimate](codeclimate) | [CodeClimate](https://codeclimate.com/) code quality tool | |
19-
| [dbeaver](dbeaver) | Launches [DBeaver](https://dbeaver.io/) with the connection information for current project. | macOS, Linux |
20-
| [mailhog](mailhog) | [Mailhog](https://github.com/mailhog/MailHog) e-mail capture service for current project | |
21-
| [meilisearch](meilisearch) | [Meilisearch](https://www.meilisearch.com/) search for local development | |
22-
| [mkcert](mkcert) | [mkcert](https://github.com/FiloSottile/mkcert) addon for Docksal | |
23-
| [phpcs](phpcs) | PHP Code Sniffer and Code Beautifier | |
24-
| [phpunit](phpunit) | Creates a phpunit.xml file and runs PHPUnit tests | Drupal |
25-
| [pma](pma) | [PhpMyAdmin](https://www.phpmyadmin.net/) database management tool | MySQL |
26-
| [pull](pull) | Pull assets from hosting environment to local | Drupal |
27-
| [rabbitmq](rabbitmq) | [RabbitMQ](https://www.rabbitmq.com/) Message Broker | RabbitMQ |
28-
| [redis](redis) | Add [Redis](https://redis.io/) to current project | |
29-
| [sequelace](sequelace) | Launches [SequelAce](https://github.com/Sequel-Ace/Sequel-Ace) with the connection information for current project. | macOS |
30-
| [sequelpro](sequelpro) | Launches [SequelPro](https://www.sequelpro.com) with the connection information for current project. | macOS |
31-
| [simpletest](simpletest) | Runs SimpleTest tests in Drupal 7 and 8 | Drupal |
32-
| [sitediff](sitediff) | Runs Sitediff tests in your Docksal project | |
33-
| [soketi](soketi) | [Socketi](https://docs.soketi.app/) Soketi is your simple, fast, and resilient open-source WebSockets server | |
34-
| [solr](solr) | [Apache Solr](http://lucene.apache.org/solr/) search service for current project | |
35-
| [tableplus](tableplus) | Launches [TablePlus](https://www.tableplus.com) with the connection information for current project. | macOS |
36-
| [uli](uli) | Generate one time login url for current site | Drupal |
37-
| [wkhtmltopdf](wkhtmltopdf) | Installs wkhtmltopdf 0.12.5 with QT compiled in. | |
38-
| [xdebug](xdebug) | Turns [xdebug](https://docs.docksal.io/tools/xdebug/) on or off and restarts docksal | |
11+
| Name | Description | Requirements |
12+
|----------------------------|--- |--- |
13+
| **[example](example)** | A working documentation on what is Docksal addon and how it works | |
14+
| [adminer](adminer) | [Adminer](https://www.adminer.org/) database management tool | MySQL |
15+
| [andock](andock) | [Andock](https://andock.readthedocs.io/en/latest/) makes it dead simple to get Docksal environments up on your server. | Docksal |
16+
| [artisan](artisan) | Runs [Laravel's Artisan](https://laravel.com/docs/artisan) command in `cli`. **Requires** artisan pre-installed inside `cli`. | Laravel, Artisan |
17+
| [blt](blt) | Acquia BLT tool launcher (requires [BLT installation](https://blog.docksal.io/docksal-and-acquia-blt-1552540a3b9f)) | Drupal |
18+
| [codeclimate](codeclimate) | [CodeClimate](https://codeclimate.com/) code quality tool | |
19+
| [dbeaver](dbeaver) | Launches [DBeaver](https://dbeaver.io/) with the connection information for current project. | macOS, Linux |
20+
| [mailpit](mailpit) | [Mailhog](https://github.com/axllent/mailpit) email capture service for current project | |
21+
| [meilisearch](meilisearch) | [Meilisearch](https://www.meilisearch.com/) search for local development | |
22+
| [mkcert](mkcert) | [mkcert](https://github.com/FiloSottile/mkcert) addon for Docksal | |
23+
| [phpcs](phpcs) | PHP Code Sniffer and Code Beautifier | |
24+
| [phpunit](phpunit) | Creates a phpunit.xml file and runs PHPUnit tests | Drupal |
25+
| [pma](pma) | [PhpMyAdmin](https://www.phpmyadmin.net/) database management tool | MySQL |
26+
| [pull](pull) | Pull assets from hosting environment to local | Drupal |
27+
| [rabbitmq](rabbitmq) | [RabbitMQ](https://www.rabbitmq.com/) Message Broker | RabbitMQ |
28+
| [redis](redis) | Add [Redis](https://redis.io/) to current project | |
29+
| [sequelace](sequelace) | Launches [SequelAce](https://github.com/Sequel-Ace/Sequel-Ace) with the connection information for current project. | macOS |
30+
| [sequelpro](sequelpro) | Launches [SequelPro](https://www.sequelpro.com) with the connection information for current project. | macOS |
31+
| [simpletest](simpletest) | Runs SimpleTest tests in Drupal 7 and 8 | Drupal |
32+
| [sitediff](sitediff) | Runs Sitediff tests in your Docksal project | |
33+
| [soketi](soketi) | [Socketi](https://docs.soketi.app/) Soketi is your simple, fast, and resilient open-source WebSockets server | |
34+
| [solr](solr) | [Apache Solr](http://lucene.apache.org/solr/) search service for current project | |
35+
| [tableplus](tableplus) | Launches [TablePlus](https://www.tableplus.com) with the connection information for current project. | macOS |
36+
| [uli](uli) | Generate one time login url for current site | Drupal |
37+
| [wkhtmltopdf](wkhtmltopdf) | Installs wkhtmltopdf 0.12.5 with QT compiled in. | |
38+
| [xdebug](xdebug) | Turns [xdebug](https://docs.docksal.io/tools/xdebug/) on or off and restarts docksal | |

mailhog/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

mailhog/conf/mailhog.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

mailhog/conf/mailhog.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

mailhog/mailhog.filelist

Lines changed: 0 additions & 10 deletions
This file was deleted.

mailhog/mailhog.post-install

Lines changed: 0 additions & 6 deletions
This file was deleted.

mailpit/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# mailpit
2+
3+
Easily install Mailpit email catcher for your Docksal project
4+
5+
```bash
6+
fin addon install mailpit
7+
```
8+
9+
## Usage once installed
10+
11+
- `fin mailpit disable` to disable
12+
- `fin mailpit enable` to re-enable

mailpit/conf/mailpit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Mailpit
2+
mail:
3+
extends:
4+
file: ${HOME}/.docksal/stacks/services.yml
5+
service: mail

mailhog/mailhog renamed to mailpit/mailpit

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

3-
## Enable/disable mailhog for current project
3+
## Enable/disable mailpit for current project
44
##
55
## Sub-commands:
6-
## enable Enable mailhog
7-
## disable Disable mailhog
6+
## enable Enable mailpit
7+
## disable Disable mailpit
88

99
red='\033[0;31m'
1010
green='\033[0;32m'
@@ -22,9 +22,7 @@ DOCKSAL_YML=".docksal/docksal.yml"
2222
DOCKSAL_YML_NEW=".docksal/docksal.yml.new"
2323
DOCKSAL_ENV=".docksal/docksal.env"
2424
DOCKSAL_STACKS="$HOME/.docksal/stacks"
25-
PHP_INI=".docksal/etc/php/php.ini"
26-
MAILHOG_INI="$ADDON_ROOT/conf/mailhog.ini"
27-
MAILHOG_YML="$ADDON_ROOT/conf/mailhog.yml"
25+
MAILPIT_YML="$ADDON_ROOT/conf/mailpit.yml"
2826

2927
#----------------------------------- YML & config functions ------------------------------------------
3028

@@ -92,74 +90,44 @@ yml_remove_service ()
9290
fin exec "$CODE_TO_EXEC"
9391
}
9492

95-
#-------------------------------------- MailHog functions ---------------------------------------------
93+
#-------------------------------------- mailpit functions ---------------------------------------------
9694

97-
# Set/remove proper setting into php.ini
98-
# $1 - enable/disable
99-
mailhog_php_support ()
100-
{
101-
case "$1" in
102-
enable)
103-
# Create file if not exists
104-
if [[ ! -f "$PHP_INI" ]]; then
105-
mkdir -p $(dirname "$PHP_INI")
106-
echo -e "[php]\n" > "$PHP_INI"
107-
fi
108-
# Append sendmail setting
109-
cat "$MAILHOG_INI" >> "$PHP_INI"
110-
# Remove double empty lines for clarity
111-
cat -s "$PHP_INI" | tee "$PHP_INI" >/dev/null
112-
;;
113-
disable)
114-
[[ ! -f "$PHP_INI" ]] && return
115-
php_ini_contents=$(cat "$PHP_INI")
116-
mailhog_ini_contents=$(cat "$MAILHOG_INI")
117-
# Remove all lines that present in mailhog.ini from php.ini
118-
php_ini_contents=${php_ini_contents/$mailhog_ini_contents/}
119-
echo -e "$php_ini_contents" > "$PHP_INI"
120-
;;
121-
esac
122-
}
12395

12496
# Enable container and settings
125-
mailhog_enable ()
97+
MAILPIT_enable ()
12698
{
127-
# Check that mailhog is not already enabled
128-
if (in_config "image: mailhog\/mailhog"); then
129-
echo " Mailhog support is already enabled." && exit
99+
# Check that mailpit is not already enabled
100+
if (in_config "image: axllent\/mailpit"); then
101+
echo " Mailpit support is already enabled." && exit
130102
fi
131103

132-
echo " Enabling mailhog..."
104+
echo " Enabling mailpit..."
133105
yml_prepare
134-
# Add mailhog service to docksal.yml
135-
yml_add_service "$MAILHOG_YML"
136-
# Add php.ini setting
137-
mailhog_php_support enable
106+
# Add mailpit service to docksal.yml
107+
yml_add_service "$MAILPIT_YML"
138108
# Apply stack changes.
139109
fin stop cli
140110
fin up
141111
}
142112

143113
# Disable container and settings
144-
mailhog_disable ()
114+
MAILPIT_disable ()
145115
{
146116
echo " Running checks..."
147117
# Make sure cli container is running
148118
if ! (fin ps | grep "_cli_" | grep "Up" >/dev/null); then
149119
echo " ERROR: Start the project with fin start first" && exit 1
150120
fi
151121

152-
# Make sure mailhog is installed
153-
if ! in_config "image: mailhog\/mailhog"; then
154-
echo " Mailhog support is not enabled at the moment." && exit
122+
# Make sure mailpit is installed
123+
if ! in_config "image: axllent\/mailpit"; then
124+
echo " Mailpit support is not enabled at the moment." && exit
155125
fi
156126

157-
echo " Preparing to remove mailhog service..."
127+
echo " Preparing to remove mailpit service..."
158128
yml_install_tools
159-
# Remove mailhog service from docksal.yml
129+
# Remove mailpit service from docksal.yml
160130
yml_remove_service "mail"
161-
# Remove php.ini setting
162-
mailhog_php_support disable
163131
# Apply stack changes
164132
COMPOSE_FILE="" fin stop cli
165133
fin up
@@ -171,13 +139,13 @@ cd "$PROJECT_ROOT"
171139

172140
case "$1" in
173141
enable)
174-
mailhog_enable
142+
MAILPIT_enable
175143
;;
176144
disable)
177-
mailhog_disable
145+
MAILPIT_disable
178146
;;
179147
*)
180-
echo "Usage: fin mailhog <enable|disable>"
148+
echo "Usage: fin mailpit <enable|disable>"
181149
exit 1
182150
;;
183151
esac

mailpit/mailpit.filelist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Hooks
2+
mailpit.pre-install
3+
mailpit.post-install
4+
mailpit.pre-uninstall
5+
6+
# Container config
7+
conf/mailpit.yml

0 commit comments

Comments
 (0)