1

Topic: Catch-all address for a domain + all subdomains

Hi,

Is there a way to configure iRedmail to accept all emails sent to "*.example.com"?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Catch-all address for a domain + all subdomains

There is a dcoumentation, why dont you look at it before you ask here?

https://docs.iredmail.org/sql.create.catch-all.html

3 (edited by selea 2022-08-15 20:10:19)

Re: Catch-all address for a domain + all subdomains

Cthulhu wrote:

There is a dcoumentation, why dont you look at it before you ask here?

https://docs.iredmail.org/sql.create.catch-all.html

Am aware that this catch-all if for *@example.com - but that is not my usecase here.
*@example.com/*@*.example.com is a more accurate description.

4 (edited by Cthulhu 2022-08-15 23:45:39)

Re: Catch-all address for a domain + all subdomains

if a subdomain is not added as maildomin in the virtual table, then mail will get rejected unless it is a virtual forwarding, you can only use regex in this case then

5

Re: Catch-all address for a domain + all subdomains

Cthulhu wrote:

if a subdomain is not added as maildomin in the virtual table, then mail will get rejected unless it is a virtual forwarding, you can only use regex in this case then

Yes, I am aware that the email will be rejected.
But are you saying that iRedmail is capable of regexes like this?
([a-z0-9](?:[a-z0-9-]{1,61}[a-z0-9])?[.])*sub[12][.]example[.]com

So if I just add the catch all like the docs described, but instead uses the regex - that would work according to you?

6 (edited by Cthulhu 2022-08-16 09:02:27)

Re: Catch-all address for a domain + all subdomains

more like:

(^|.+\.)domain\.tld$

but be aware, that only works if that subdomain has an MX entry aswell

OR

you add a wildcard MX entry, but this will open huge space for dictionary attacks and be aware that you will get a shitton of spam

7

Re: Catch-all address for a domain + all subdomains

Cthulhu wrote:

more like:

(^|.+\.)domain\.tld$

Thanks, I'll try that.
Also, I am fully aware of the rest. But recieving spam is what I want to achieve with this wink

8

Re: Catch-all address for a domain + all subdomains

selea wrote:

Am aware that this catch-all if for *@example.com - but that is not my usecase here.
*@example.com/*@*.example.com is a more accurate description.

Would you mind sharing why you need to support such addresses?

9

Re: Catch-all address for a domain + all subdomains

ZhangHuangbin wrote:
selea wrote:

Am aware that this catch-all if for *@example.com - but that is not my usecase here.
*@example.com/*@*.example.com is a more accurate description.

Would you mind sharing why you need to support such addresses?

Honeypot basically.
A very edge-case smile

10

Re: Catch-all address for a domain + all subdomains

Cthulhu wrote:

more like:

(^|.+\.)domain\.tld$

but be aware, that only works if that subdomain has an MX entry aswell

Appreciate the reply!

I added the following:

INSERT INTO forwardings (address, forwarding, domain, dest_domain) VALUES ('(^|.+\.)domain\.tld$', 'catch-all@domain.tld', '(^|.+\.)domain\.tld$', '(^|.+\.)domain\.tld$');

As that is how I understand how it should be in this case, right?

I am getting "relay access denied", I suppose I also need to change something in iredapd to be able to relay emails from *.domain.tld to the catch-all address?

Thanks!

11 (edited by Cthulhu 2022-09-03 08:57:26)

Re: Catch-all address for a domain + all subdomains

this does not work with sql, needs to be implemented as virtual mailbox in postfix