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.

Catch-All Email?

Discussion in 'E-mail Discussions' started by bpat1434, Feb 9, 2005.

  1. bpat1434

    bpat1434 Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Columbia, MD
    Hey guys. I'm a fairly avid php programmer and am working to create a general php email listproc script. I was wondering if there was a way to create a general catch-all email box?

    I want to set up a sub-domain called: listproc.domain.com. So I automatcially get *@listproc.domain.com. Is there a way through cPanel to set any email sent to @listproc.domain.com to a script?

    Is that possible through cPanel? If so, how would I do it?

    Thanks for the help.

    ~Brett
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    A search would have thrown up any number of threads on this topic for you.

    You need to simply set the Default Address in cPanel. Instead of setting it to an email address you need to pipe it to your script:

    |/path/to/your/script/script.php
     
  3. bpat1434

    bpat1434 Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Columbia, MD
  4. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    If you log into your control panel, and click to chang the default address for the subdomain list.domain.com to a pipe rather than an email address and then don't create any email address with the domain list.domain.com, then all mail sent to anything@list.domain.com will go to the pipe because the pipe is now the catchall.

    That is what chirpy was saying above.
     
  5. bpat1434

    bpat1434 Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Columbia, MD
    Ok, thank you for clearing it up for me.

    Much appreciated.

    ~Brett
     
  6. bpat1434

    bpat1434 Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Columbia, MD
    And out of curiosity:

    I'm on an apache machine. SHould "/path/to/your/script" be in which form:

    A] /usr/username/home/public_html/...
    B] /home/public_html/...
    C] http://www.blah blah blah.com/...

    I'm betting that it's the first, but just want to check to make sure.

    Also, is there a way to remotely create a sub-domain address (@list.domain.com) through php so that I can create an installer and not have to manually create a sub-domain?

    ~Brett
     
  7. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    The path should be the exact path, from the root of the machine, to the actual script.

    99% chance that this is going to be:

    /home/accountusername/script.php

    If you happen to put the script in your public_html directory, then the path might be:

    /home/accountusername/public_html/script.php

    However if the script is just for dealing with mail, I'd recommend putting it outside of the document root so that people can't browse to it and interfere with it - if you can narrow down the input the script will get, you can more easily control what how it will behave and what it will do.

    I put my mail handling scripts in a directory called "mailhandlers", which is in the root of my account's webspace and therefore the path is /home/accountusername/mailhandlers/script.php.
     
  8. bpat1434

    bpat1434 Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Columbia, MD
    Thanks, your help is most appreciated.

    ~Brett
     
Loading...

Share This Page