SOLVED Email Forwarders -- How to send a list of current forwarders to an email address

martin MHC

Well-Known Member
Sep 14, 2016
212
34
28
UK
cPanel Access Level
Root Administrator
I have an account which has numerous email forwarders in place.
I'm curious as to if and how I can set some sort of cronjob to send the current list of forwarders as text to an external email address;

Example;
Code:

I have read that Forwarders | cPanel & WHM Documentation states about pipping to a program but this doesn't seem to be what I need. I need to find the server list of forward addresses and destinations and then take some of this data and put it in an email to an external destination and use a cron job to send this every few months.

Any guidance on how this can be achieved would be wonderful. My coding of choice is PHP but I'm very wary of letting PHP loose on system files if they're outside of the /home/account/ directory.

Cheers
 
Last edited by a moderator:

martin MHC

Well-Known Member
Sep 14, 2016
212
34
28
UK
cPanel Access Level
Root Administrator
This thread can be deleted. I solved this problem by finding the forwarders listed in `/etc/valiases/domainname.com` and then building a perl script to use them.