Forward domain emails to another include new subdomains

qunted

Registered
Mar 7, 2021
2
0
1
Indonesia
cPanel Access Level
Root Administrator
Hi, I found a problem to forward all emails comes to a domain (ex. domain2.com) to another (ex. domain1.com) include all new subdomain created in domain1.com

Here what I have done,

I have email
[email protected]

And I already add a domain email forwarder (mail/fwds.html) : domain2.com to domain1.com

So if I send email to [email protected] it will forwarded to [email protected] 's mailbox

So far there's no problem

now
I made a subdomain named project.domain1.com
and I made email [email protected]1.com

PROCESS XXX {

I made same subfolder for domain2.com : project.domain2.com
and add a domain email forwarder (mail/fwds.html) : project.domain2.com to projects.domain1.com

}

So if I send email to [email protected]2.com it will forwarded to [email protected]1.com 's mailbox

there is no problem till now.

The question is,
Can we automate 2 process between PROCESS XXX bracket (add subdomain and add domain email forwarder ?


all I want is just Add new sub domain in domain1.com (ex. newsubdomain.domain1.com) and add new email address [email protected]1.com and if I send email to [email protected]2.com , the email will automatically send to [email protected]1.com 's mailbox

Hope there's solution for helping this process..... because my client quite often create new subdomains and create email account for users inside its subdomain.

Thank you for helping me....
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,951
921
313
cPanel Access Level
Root Administrator
Hey there! This work may be possible, but it would require some custom coding through our hookable events tools here:


These tools allow you to add a "hookable event" such as running a custom script after account creation or subdomain creation. However, it does require custom programming in order to create and implement the hook.

If you'd like to see something easier for this specific work I'd recommend using the link in my signature to submit a feature request to ask for that to be included in a future version of cPanel.