I'm guessing it's one of the following:
a) The file that's throwing this error is not in the same directory as the vpopmail, domains, or domain directories.
b) The user that's running the script does not have permission to vpopmail/domains/domain.
I'm guessing it's a
- it's very easy for a particular directory to not contain another particular directory
If it's a), you may be missing a package that will create the appropriate directories. Google vpopmail and see what it belongs to.
You may want to check at some other Linux-specific forums. Some of my favorites: linuxforum.com and linuxquestions.org. You may be able to get some CentOS specific help from a CentOS forum, but I'm not sure what kind of support the Red Hat family has, these days.