restoring e-mail forwarders form cpbackup?

yemoller

Member
Jun 3, 2003
24
0
151
I had to restore a couple of accounts on my server form cpbackups today and now I'm noticing that e-mail forwarders were not restored on some accounts.

I have a couple of older cpbackups of the accounts but I'm unable to find any files in the backups that contain the forwarders.


How do i restore e-mail forwarders only form a cpbackup (what file do i copy to the users account)?


Any help is appreciated!
 

tweakservers

Well-Known Member
Mar 30, 2006
379
0
166
there is an option in the WHM Backup > restore backup function that shows " Restore Mail Config", try that out.
 

Messiah

Member
PartnerNOC
Jul 5, 2006
22
0
151
Mail forwarders are listed in text files contained within /etc/valiases/. For example, an alias [email protected] that forwards to [email protected] would be recorded as the following entry in /etc/valiases/google.com
[email protected]: [email protected]

So basically, all the forwarders for example.com are contained within /etc/valiases/example.com. The entire valiases directory is backed up with cpbackups. You'll need to extract the tarball then copy the domain's valias file to /etc/valiases/. Here's an example:
I'll pretend you're restoring forwarders for example.com, and that your backup directory is /backup, and that you are restoring the daily backup:
tar -xzf /backup/cpbackup/daily/dirs/_etc_valiases.tar.gz
cp -p /backup/cpbackup/daily/dirs/etc/valiases/example.com /etc/valiases/example.com

You'll be prompted to overwrite. Confirm. That should do it.
 

yemoller

Member
Jun 3, 2003
24
0
151
Thanks Messiah, found the forwarders !! :D

Strange though, that only some accounts were affected.