Redirect incorrect email

Aardman

Registered
May 28, 2020
3
0
1
UK
cPanel Access Level
Website Owner
Hi,

I want to redirect emails to a script. I can do this. however what I want to do is a little more unusual and capture any email sent to a unknown subdomain and redirect it to a script:

[email protected]

where '[email protected]' can be any address ie the unknown subdomain
and EMAILREDIRECT.MYDOMAIN.COM is my server.

I have played with setting up redirects which works for [email protected] and setting up MX record for *.EMAILDIRECT.MYDOMAIN.COM

but sending any email to [email protected] just produces a bounceback.

Any help much appreciated.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
I'm not sure I understand what you mean by
however what I want to do is a little more unusual and capture any email sent to a unknown subdomain and redirect it to a script:

[email protected]
You're saying you want to redirect any domain to a subdomain of somedomain.com.emaildirect.mydomain.com? Would this be outbound mail?
 

Aardman

Registered
May 28, 2020
3
0
1
UK
cPanel Access Level
Website Owner
Hi, thanks for the reply,

Its incoming mail only.

For a background to this I am developing a system which packages registered clients email and sends them on to the recipient in a secured manner.

The system needs to capture emails sent to my sub domain however the email address needs to be a catchall. I can get the catchall to work and send to a script however, the problem I am having is the email addresses comprises of someone elses email address pre-pended to my sub domain. so for example:

[email protected]mysubdomain.mydomain.com forwards to catchall correctly BUT:

[email protected].mysubdomain.mydomain.com or [email protected].mysubdomain.mydomain.com both fail to forward to the catchall, with a bounce back message that the domain does not exist or has incorrect dns entry.