Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Possible to manually update the non-account forward file?

Discussion in 'E-mail Discussion' started by pjfagen, Nov 24, 2008.

  1. pjfagen

    pjfagen Registered

    Joined:
    Nov 24, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    Hi.
    Still searching for an answer, but I'll post my question(s) here, too...

    I am currently using cpanel to forward a set of email addresses to a pipe program - works fine. These email addresses do NOT have actual accounts on my site, so definedUserName@mysite.com gets piped to my program and processed just fine.

    What I want to do is add many definedUserNames to this same forward-to-pipe scenario without using cpanel to add an entry for each definedUserName, and I'd like to do it programatically. So...

    a. Is this possible?
    b. I assume this forwarding information is contained in a file somewhere. What and where is it?
    c. Is this file a text file that I can append to?

    Thanks much!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I can show you the APIs you can use. However, to use the APIs you need a minimum of reseller access to the server. Do you have reseller or root-level access to the server?
     
  3. pjfagen

    pjfagen Registered

    Joined:
    Nov 24, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    No reseller access at this time. I'll look into it.
    What language are the APIs?
    I'm using perl for everything right at the moment.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The APIs are XML-based. However, reseller access is required to make use of these APIs.
     
  5. rrwh

    rrwh Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    156
    a Yes it is possible.
    b your assumption is correct
    c if you don't have root access to the server you are not going to be able to do it.

    d If your host is willing there is a simple work-around that will allow you to update the file.


    Firstly, the actual file you are wanting to update is the /etc/valiases/domain.com file

    What you need to get your host to do is the following:

    1 mkdir /home/youraccount/etc/valiases
    2 mv /etc/valiases/domain.com /home/youraccount/etc/valiases
    3 cd /etc/valiases
    4 ln -s /home/youraccount/etc/valiases
    5 cd /home/youraccount/etc/
    6 chown youraccount:youraccount valiases
    7 chown youraccount:mail domain.com

    Then you will have the file in your directory structure and you will be able to modify it.

    I have done this for a few accounts because the API is just a real pain when dealing with the forwarders and I have never managed to find the time to make it work. My solution was far easier and allowed user-level control of the valiases file and it works a treat.

    Maybe there is an enhancement somewhere for cpanel in this to make it an option to push the file to the users directory like I have done here.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice