[GH-ISSUE #519] [Feature Request] possibility to disable catch all #945

Closed
opened 2026-03-14 11:16:38 +03:00 by kerem · 4 comments
Owner

Originally created by @MyUncleSam on GitHub (Sep 19, 2023).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/519

Hi there,

I would love to disable the catch-all feature for the instance I am hosting for myselfe. As far as I know I can simply empty the environment variable "ANONADDY_ADMIN_USERNAME" but this seem to just work a bit. It disables the automatically alias generation for my admin user which is fine. But on the other hand every email sent to the service is fully accepted even if it is not delivered anywhere. In my eyes those mails should be immediatly been blocked/rejected. Because if they are not rejeceted, the sender is keep on sending mails as he thinks someone is getting them. This could take resources over time if the domains get more known.

Originally created by @MyUncleSam on GitHub (Sep 19, 2023). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/519 Hi there, I would love to disable the catch-all feature for the instance I am hosting for myselfe. As far as I know I can simply empty the environment variable "ANONADDY_ADMIN_USERNAME" but this seem to just work a bit. It disables the automatically alias generation for my admin user which is fine. But on the other hand every email sent to the service is fully accepted even if it is not delivered anywhere. In my eyes those mails should be immediatly been blocked/rejected. Because if they are not rejeceted, the sender is keep on sending mails as he thinks someone is getting them. This could take resources over time if the domains get more known.
kerem closed this issue 2026-03-14 11:16:43 +03:00
Author
Owner

@willbrowningme commented on GitHub (Oct 23, 2023):

This has been fixed in the latest release, if you do not have ANONADDY_ADMIN_USERNAME set then messages to aliases that do not exist (at the apex domains) will be rejected with the message 550 5.1.1 Address does not exist.

<!-- gh-comment-id:1774910089 --> @willbrowningme commented on GitHub (Oct 23, 2023): This has been fixed in the latest release, if you do not have `ANONADDY_ADMIN_USERNAME` set then messages to aliases that do not exist (at the apex domains) will be rejected with the message `550 5.1.1 Address does not exist`.
Author
Owner

@masterjg commented on GitHub (Mar 11, 2024):

This has been fixed in the latest release, if you do not have ANONADDY_ADMIN_USERNAME set then messages to aliases that do not exist (at the apex domains) will be rejected with the message 550 5.1.1 Address does not exist.

@willbrowningme erm, is it still working as written here? In my compose I do not have ANONADDY_ADMIN_USERNAME set, however if I try some non existing email address with swaks anonaddy does not return 550.

swaks --to mzy@m.server.domain --from fromemail@email.com --server server.domain --ehlo server.domain
=== Trying server.domain:25...
=== Connected to server.domain.
<-  220 server.domain ESMTP
 -> EHLO server.domain
<-  250-server.domain
<-  250-PIPELINING
<-  250-SIZE 26214400
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250-DSN
<-  250-SMTPUTF8
<-  250 CHUNKING
 -> MAIL FROM:<fromemail@email.com>
<-  250 2.1.0 Ok
 -> RCPT TO:<mzy@m.server.domain>
<-  250 2.1.5 Ok
 -> DATA
<-  354 End data with <CR><LF>.<CR><LF>
 -> Date: Mon, 11 Mar 2024 19:26:06 +0200
 -> To: mzy@m.server.domain
 -> From: fromemail@email.com
 -> Subject: test Mon, 11 Mar 2024 19:26:06 +0200
 -> Message-Id: <20240311192606.313390@>
 -> X-Mailer: swaks v20201014.0 jetmore.org/john/code/swaks/
 -> 
 -> This is a test mailing
 -> 
 -> 
 -> .
<-  250 2.0.0 Ok: queued as CB0BBFA40D
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.

<!-- gh-comment-id:1989028939 --> @masterjg commented on GitHub (Mar 11, 2024): > This has been fixed in the latest release, if you do not have `ANONADDY_ADMIN_USERNAME` set then messages to aliases that do not exist (at the apex domains) will be rejected with the message `550 5.1.1 Address does not exist`. @willbrowningme erm, is it still working as written here? In my compose I do not have ANONADDY_ADMIN_USERNAME set, however if I try some non existing email address with swaks anonaddy does not return 550. ``` swaks --to mzy@m.server.domain --from fromemail@email.com --server server.domain --ehlo server.domain === Trying server.domain:25... === Connected to server.domain. <- 220 server.domain ESMTP -> EHLO server.domain <- 250-server.domain <- 250-PIPELINING <- 250-SIZE 26214400 <- 250-ETRN <- 250-STARTTLS <- 250-ENHANCEDSTATUSCODES <- 250-8BITMIME <- 250-DSN <- 250-SMTPUTF8 <- 250 CHUNKING -> MAIL FROM:<fromemail@email.com> <- 250 2.1.0 Ok -> RCPT TO:<mzy@m.server.domain> <- 250 2.1.5 Ok -> DATA <- 354 End data with <CR><LF>.<CR><LF> -> Date: Mon, 11 Mar 2024 19:26:06 +0200 -> To: mzy@m.server.domain -> From: fromemail@email.com -> Subject: test Mon, 11 Mar 2024 19:26:06 +0200 -> Message-Id: <20240311192606.313390@> -> X-Mailer: swaks v20201014.0 jetmore.org/john/code/swaks/ -> -> This is a test mailing -> -> -> . <- 250 2.0.0 Ok: queued as CB0BBFA40D -> QUIT <- 221 2.0.0 Bye === Connection closed with remote host. ```
Author
Owner

@willbrowningme commented on GitHub (Mar 11, 2024):

It should fall into this else statement - https://github.com/anonaddy/anonaddy/blob/master/postfix/AccessPolicy.php#L132

and return a Does not exist response.

If you log $adminUsername what does it return?

<!-- gh-comment-id:1989243516 --> @willbrowningme commented on GitHub (Mar 11, 2024): It should fall into this else statement - https://github.com/anonaddy/anonaddy/blob/master/postfix/AccessPolicy.php#L132 and return a `Does not exist` response. If you log `$adminUsername` what does it return?
Author
Owner

@MyUncleSam commented on GitHub (Mar 11, 2024):

I tested this in my anonaddy docker environment and it works for me as expected and declines the mail with 550 (ip and domain anonymized)

Mar 11 20:23:57 mail postfix/smtpd[941]: connect from mail.domain.tld[123.123.123.123]
Mar 11 20:23:57 mail postfix/smtpd[941]: Anonymous TLS connection established from mail.domain.tld[123.123.123.123]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384
Mar 11 20:23:57 mail postfix/smtpd[941]: NOQUEUE: reject: RCPT from mail.domain.tld[123.123.123.123]: 550 5.1.1 <test2@higon.de>: Recipient address rejected: Address does not exist; from=<my@mail.tld> to=<test2@anon.addy> proto=ESMTP helo=<mail.domain.tld>
Mar 11 20:23:57 mail postfix/smtpd[941]: disconnect from mail.domain.tld[123.123.123.123] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8
<!-- gh-comment-id:1989262776 --> @MyUncleSam commented on GitHub (Mar 11, 2024): I tested this in my anonaddy docker environment and it works for me as expected and declines the mail with 550 (ip and domain anonymized) ``` Mar 11 20:23:57 mail postfix/smtpd[941]: connect from mail.domain.tld[123.123.123.123] Mar 11 20:23:57 mail postfix/smtpd[941]: Anonymous TLS connection established from mail.domain.tld[123.123.123.123]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 Mar 11 20:23:57 mail postfix/smtpd[941]: NOQUEUE: reject: RCPT from mail.domain.tld[123.123.123.123]: 550 5.1.1 <test2@higon.de>: Recipient address rejected: Address does not exist; from=<my@mail.tld> to=<test2@anon.addy> proto=ESMTP helo=<mail.domain.tld> Mar 11 20:23:57 mail postfix/smtpd[941]: disconnect from mail.domain.tld[123.123.123.123] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8 ```
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#945
No description provided.