Skip to content

Commit f86b0b8

Browse files
committed
Replace all mailhog references with mailpit.
- Update CircleCI orb to check for freegle-mailpit container - Update docker-compose.yml SMTP_HOST and MAIL_HOST env vars - Remove mailhog network alias and traefik backward compat - Update status server, test files, and documentation - Remove obsolete MailHogHelper.php test helper
1 parent db26bb1 commit f86b0b8

File tree

14 files changed

+34
-315
lines changed

14 files changed

+34
-315
lines changed

.circleci/orb/freegle-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ commands:
9494
echo ""
9595
echo "=== Verifying container names ==="
9696
# All containers that have container_name set in docker-compose.yml
97-
ALL_CONTAINERS="freegle-traefik freegle-percona freegle-postgres freegle-phpmyadmin freegle-mailhog freegle-beanstalkd freegle-spamassassin freegle-redis freegle-delivery freegle-tusd freegle-status freegle-host-scripts freegle-apiv1 freegle-apiv2 freegle-batch freegle-dev-local freegle-prod-local modtools-dev-local modtools-prod-local freegle-playwright"
97+
ALL_CONTAINERS="freegle-traefik freegle-percona freegle-postgres freegle-phpmyadmin freegle-mailpit freegle-beanstalkd freegle-spamassassin freegle-redis freegle-delivery freegle-tusd freegle-status freegle-host-scripts freegle-apiv1 freegle-apiv2 freegle-batch freegle-dev-local freegle-prod-local modtools-dev-local modtools-prod-local freegle-playwright"
9898
MISSING=""
9999
for container in $ALL_CONTAINERS; do
100100
if docker inspect "$container" >/dev/null 2>&1; then

Dockerfile.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ENV PATH="/usr/local/go/bin:/root/go/bin:${PATH}" \
3939

4040
# ============ PHP 8.1 + WEB SERVER ============
4141
# nginx: serves PHP API via php-fpm
42-
# postfix: mail relay for sending emails (configured to use mailhog)
42+
# postfix: mail relay for sending emails (configured to use mailpit)
4343
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
4444
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
4545
apt-get update && apt-get install -y --no-install-recommends \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Add these to your hosts file:
4242
127.0.0.1 modtools-dev.localhost
4343
127.0.0.1 modtools-prod.localhost
4444
127.0.0.1 phpmyadmin.localhost
45-
127.0.0.1 mailhog.localhost
45+
127.0.0.1 mailpit.localhost
4646
127.0.0.1 tusd.localhost
4747
127.0.0.1 status.localhost
4848
127.0.0.1 apiv1.localhost
@@ -260,7 +260,7 @@ You can see this via 'Pending' calls in the Network tab.
260260

261261
## Development Tools
262262
* **[PhpMyAdmin](https://phpmyadmin.localhost)** - Database management (Login: `root` / `iznik`)
263-
* **[MailHog](https://mailhog.localhost)** - Email testing interface
263+
* **[Mailpit](https://mailpit.localhost)** - Email testing interface
264264
* **[TusD](https://tusd.localhost)** - Image upload service
265265
* **[Image Delivery](https://delivery.localhost)** - Image processing service (weserv/images)
266266
* **[Traefik Dashboard](http://localhost:8080)** - Reverse proxy dashboard

docker-compose.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ services:
102102
image: axllent/mailpit:latest
103103
container_name: freegle-mailpit
104104
networks:
105-
default:
106-
aliases:
107-
- mailhog
105+
- default
108106
ports:
109107
- "0.0.0.0:8025:8025"
110108
- "0.0.0.0:1025:1025"
@@ -135,7 +133,7 @@ services:
135133
start_period: 10s
136134
labels:
137135
- "traefik.enable=true"
138-
- "traefik.http.routers.mailpit.rule=Host(`mailpit.localhost`) || Host(`mailhog.localhost`)"
136+
- "traefik.http.routers.mailpit.rule=Host(`mailpit.localhost`)"
139137
- "traefik.http.routers.mailpit.entrypoints=web"
140138
- "traefik.http.services.mailpit.loadbalancer.server.port=8025"
141139

@@ -407,7 +405,7 @@ services:
407405
- IMAGE_DOMAIN=apiv1
408406
- SPAMD_HOST=spamassassin-app
409407
- SPAMD_PORT=783
410-
- SMTP_HOST=mailhog
408+
- SMTP_HOST=mailpit
411409
- TUS_UPLOADER=http://freegle-tusd:8080/tus
412410
- SMTP_PORT=1025
413411
- IMAGE_DELIVERY=http://freegle-delivery
@@ -946,7 +944,7 @@ services:
946944
- QUEUE_CONNECTION=redis
947945
- SESSION_DRIVER=redis
948946
- MAIL_MAILER=smtp
949-
- MAIL_HOST=mailhog
947+
- MAIL_HOST=mailpit
950948
- MAIL_PORT=1025
951949
- MAIL_ENCRYPTION=null
952950
- MAIL_EHLO_DOMAIN=freegle-batch

iznik-batch/.env.testing

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ QUEUE_CONNECTION=database
3737

3838
CACHE_STORE=file
3939

40-
# Mail - use MailHog for local testing
40+
# Mail - use Mailpit for local testing
4141
MAIL_MAILER=smtp
42-
MAIL_HOST=mailhog
42+
MAIL_HOST=mailpit
4343
MAIL_PORT=1025
4444
MAIL_USERNAME=null
4545
MAIL_PASSWORD=null

iznik-batch/CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All domain-specific configuration is in `config/freegle.php` and can be overridd
2727
# Run all unit and feature tests (uses iznik_test database)
2828
docker exec freegle-batch php artisan test --testsuite=Unit,Feature
2929

30-
# Run integration tests (requires MailHog)
30+
# Run integration tests (requires Mailpit)
3131
docker exec freegle-batch php artisan test --testsuite=Integration
3232

3333
# Run specific test
@@ -38,7 +38,7 @@ docker exec freegle-batch php artisan test --filter="test_method_name"
3838

3939
- **Unit** - Unit tests using iznik_batch_test database
4040
- **Feature** - Feature tests using iznik_batch_test database
41-
- **Integration** - Tests that require external services (MailHog)
41+
- **Integration** - Tests that require external services (Mailpit)
4242

4343
## Database Migrations
4444

iznik-batch/tests/Feature/Mail/ChatNotificationIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function setUp(): void
3838
$this->testRunId = uniqid("chat_", TRUE);
3939

4040
Config::set("mail.default", "smtp");
41-
Config::set("mail.mailers.smtp.host", "mailhog");
41+
Config::set("mail.mailers.smtp.host", "mailpit");
4242
Config::set("mail.mailers.smtp.port", 1025);
4343

4444
Config::set("freegle.spam_check.enabled", true);
@@ -47,7 +47,7 @@ protected function setUp(): void
4747
Config::set("freegle.spam_check.rspamd_host", "rspamd");
4848
Config::set("freegle.spam_check.rspamd_port", 11334);
4949

50-
$this->mailpit = new MailpitHelper("http://mailhog:8025");
50+
$this->mailpit = new MailpitHelper("http://mailpit:8025");
5151
$this->mailpit->deleteAllMessages();
5252
}
5353

@@ -302,7 +302,7 @@ public function test_user2mod_notification_passes_spam_checks(): void
302302
protected function isMailpitAvailable(): bool
303303
{
304304
try {
305-
$ch = curl_init("http://mailhog:8025/api/v1/messages");
305+
$ch = curl_init("http://mailpit:8025/api/v1/messages");
306306
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
307307
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
308308
curl_setopt($ch, CURLOPT_TIMEOUT, 5);

iznik-batch/tests/Feature/Mail/WelcomeMailIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function setUp(): void
3232

3333
// Configure for actual SMTP sending (override phpunit.xml array mailer).
3434
Config::set('mail.default', 'smtp');
35-
Config::set('mail.mailers.smtp.host', 'mailhog');
35+
Config::set('mail.mailers.smtp.host', 'mailpit');
3636
Config::set('mail.mailers.smtp.port', 1025);
3737

3838
// Enable spam checking.
@@ -43,7 +43,7 @@ protected function setUp(): void
4343
Config::set('freegle.spam_check.rspamd_port', 11334);
4444

4545
// Set up Mailpit helper with docker network URL.
46-
$this->mailpit = new MailpitHelper('http://mailhog:8025');
46+
$this->mailpit = new MailpitHelper('http://mailpit:8025');
4747

4848
// Clear all messages before each test.
4949
$this->mailpit->deleteAllMessages();
@@ -264,7 +264,7 @@ public function test_welcome_email_passes_spam_checks(): void
264264
protected function isMailpitAvailable(): bool
265265
{
266266
try {
267-
$ch = curl_init('http://mailhog:8025/api/v1/messages');
267+
$ch = curl_init('http://mailpit:8025/api/v1/messages');
268268
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
269269
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
270270
curl_setopt($ch, CURLOPT_TIMEOUT, 5);

iznik-batch/tests/Feature/Mail/WelcomeMailTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
use App\Mail\Welcome\WelcomeMail;
66
use Illuminate\Support\Facades\Mail;
7-
use Tests\Support\MailHogHelper;
7+
use Tests\Support\MailpitHelper;
88
use Tests\TestCase;
99

1010
class WelcomeMailTest extends TestCase
1111
{
12-
protected MailHogHelper $mailHog;
12+
protected MailpitHelper $mailpit;
1313

1414
protected function setUp(): void
1515
{
1616
parent::setUp();
1717

18-
// Set up MailHog helper with docker network URL.
19-
$this->mailHog = new MailHogHelper('http://mailhog:8025');
18+
// Set up Mailpit helper with docker network URL.
19+
$this->mailpit = new MailpitHelper('http://mailpit:8025');
2020
}
2121

2222
/**

0 commit comments

Comments
 (0)