The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Manually creating a mail forwarder

Discussion in 'E-mail Discussions' started by CoolMike, Dec 9, 2003.

  1. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Hi

    I need to create a lot of mail forwarders for a customer. Therefore it would be great, if I could just add this in a file, instead creating them manually in Cpanel.

    I know that this information is stored in this file:

    /etc/valiases/domain.com

    But even I add it there, it looks ok in Cpanel, but the forwarder is not working. Where else do I need to add it?

    Thanks
    Michael
     
  2. thug

    thug Member

    Joined:
    May 27, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Switzerland
    cPanel Access Level:
    Website Owner
    I made a Perl-Script that reads a file with all forwarders and then execute the script /usr/local/cpanel/cpanel-email.

    I can send you my script if you're interessted. send me an email to thu@kkcomp.ch
     
  3. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Sounds great, I sent you a mail...

    Thanks
    Mike
     
  4. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Thanks a lot!

    Mike
     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I have a script I have been considering releasing that manages forwards from the browser.

    The script can bee seen here

    1. You can limit the number of forwards from the config file.
    2. You can set the domain or allow the script to set the domain in the config file (great for sub domains)

    Easy to set up. Copy two files to your server, edit the config file following the instructions.

    Try it out!
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I've just edited the /etc/valiases/domain.com files several times and the forwarders always worked. Are they not supposed to?
     
  7. toeknee

    toeknee Registered

    Joined:
    Dec 9, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I have the same need, but there is no such directory "valiases" in my /etc directory. Is there any other possible place the forwarders are stored? I think I have looked everywhere.

    TIA
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Try
    locate valiases
    in shell.
     
  9. toeknee

    toeknee Registered

    Joined:
    Dec 9, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    no joy

    Tried to sudo it, no luck. Is there any other common place or common name this file would be kept? Or does the fact that I do have have root access on this virtual host that the file is likely there, but i cannot see it.

    Thanks-
    (new to *nix, but learning)
     
  10. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Re: no joy

    That's the problem. Only root or superusers, (like cpanel), have access to that directory.

    As an end user, there is no quick way to add large numbers that I know of. You could try writing the file yourself and see if the server owner will replace it for you.
     
  11. toeknee

    toeknee Registered

    Joined:
    Dec 9, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    thanks

    I appreciate the info.
     
  12. mrbaseball34

    mrbaseball34 Member

    Joined:
    Apr 23, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Well, I would if I knew what one looked like....

    Please post sample..
     
  13. mrbaseball34

    mrbaseball34 Member

    Joined:
    Apr 23, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I see no code....mind posting the code to the script???
     
  14. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    alias@domain.com: realemail@domain.com
    alias2@domain.com: realemail@domain.com
    *: :fail:

    Each alias is on a seperate line with a colon and space seperating the alias from the destination. Note the * entry refers to the default forwarder and would not necessarily point to :fail:
     
  15. mrbaseball34

    mrbaseball34 Member

    Joined:
    Apr 23, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks bunches...
     
  16. mrbaseball34

    mrbaseball34 Member

    Joined:
    Apr 23, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Does this mean that I can send stuff not address to anyone in my domain to the blackhole? If so, would I just do this---

    *: : blackhole

    and then all mail not addressed to anyone in my domain or forwarders would be trashed?
     
  17. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Blackhole would be

    *: :blackhole:
     
Loading...

Share This Page