Skip to content

Commit

Permalink
feat!: Add support for catchall addresses (jeboehm#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeboehm committed Jun 8, 2022
1 parent 40d706f commit 061c8c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ up: .env
.PHONY: fixtures
fixtures:
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console domain:add example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console domain:add example.org
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console user:add --admin --password=changeme --enable admin example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console user:add --password=test1234 --enable --sendonly sendonly example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console user:add --password=test1234 --enable --quota=1 quota example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console user:add --password=test1234 disabled example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console user:add --password=test1234 --sendonly disabledsendonly example.com
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console alias:add [email protected] [email protected]
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console alias:add --catchall @example.com [email protected]
$(COMPOSE_PRODUCTION) run --rm web /usr/local/bin/fixtures.sh /opt/manager/bin/console dkim:setup example.com --enable --selector 1337

.PHONY: unofficial-sigs
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Features
- Webmail interface
- Server-side mail filtering, rule configuration via web frontend
- Spam- and malware filter
- Catchall address support
- Spamfilter is trained just by moving emails to or out of the junk folder
- Uses RBL (real time black hole lists) to block already known spam senders
- Greylisting only when incoming mail is likely spam
Expand Down
15 changes: 15 additions & 0 deletions test/rootfs/usr/share/tests/040_mta.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
[ "$status" -eq 0 ]
}

@test "send mail to unknown address (catchall)" {
run swaks -s mta --to [email protected] --body "$BATS_TEST_DESCRIPTION"
[ "$status" -eq 0 ]
}

@test "send mail to unknown address should fail" {
run swaks -s mta --to [email protected] --body "$BATS_TEST_DESCRIPTION"
[ "$status" -eq 24 ]
}

@test "authentification on smtp with disabled account should fail" {
run swaks -s mta --to [email protected] --from [email protected] -a -au [email protected] -ap test1234 -tls --body "$BATS_TEST_DESCRIPTION"
[ "$status" -eq 28 ]
Expand Down Expand Up @@ -91,6 +101,11 @@
[ "$status" -eq 0 ]
}

@test "catchall mail is delivered" {
run grep -r "send mail to unknown address (catchall)" /var/vmail/example.com/admin/Maildir/
[ "$status" -eq 0 ]
}

@test "junk mail is assorted to the junk folder" {
run grep -r "send junk mail to local address" /var/vmail/example.com/admin/Maildir/.Junk/
[ "$status" -eq 0 ]
Expand Down
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM roundcube/roundcubemail:1.5.x-fpm AS roundcube
FROM composer:2.3 AS composer
FROM php:8.1-fpm-alpine

ARG ADMIN_VER=2.0.6 # renovate: depName=jeboehm/mailserver-admin
ARG ADMIN_VER=2.1.0 # renovate: depName=jeboehm/mailserver-admin

LABEL maintainer="[email protected]"
LABEL vendor="https://github.com/jeboehm/docker-mailserver"
Expand Down

0 comments on commit 061c8c4

Please sign in to comment.