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.

Cpanel directing mail to script

Discussion in 'E-mail Discussions' started by flashhosts, Oct 2, 2002.

  1. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    WHM News says : &You can now forward mail to a script in cPanel.&

    Anyone tell me if this means we can point all mail to say ticket@domain.com to perldesk or something from inside cpanel? If so how?


    Robert
     
  2. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    [quote:e90cb98a68][i:e90cb98a68]Originally posted by flashhosts[/i:e90cb98a68]

    WHM News says : &You can now forward mail to a script in cPanel.&

    Anyone tell me if this means we can point all mail to say ticket@domain.com to perldesk or something from inside cpanel? If so how?


    Robert[/quote:e90cb98a68]
    create a forwarder like this:

    ticket@domain.com -& |/path/to/gateway.pl
     
  3. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for your prompt reply....
     
  4. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    It doesnt want to work, it redirects to the default address....

    Robert
     
  5. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    [quote:c21cb813ad][i:c21cb813ad]Originally posted by flashhosts[/i:c21cb813ad]

    It doesnt want to work, it redirects to the default address....

    Robert[/quote:c21cb813ad]
    it works from Cpanel 5.0 build 159 (EDGE) and later
    it seems that you have stable build 158
     
  6. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    it shows up as:
    tickets@klooki.net &|/home/klooki/public_html/helpdesk/include/email.pl&@klooki.net
     
  7. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    [quote:2210957db9][i:2210957db9]Originally posted by flashhosts[/i:2210957db9]

    it shows up as:
    tickets@klooki.net &|/home/klooki/public_html/helpdesk/include/email.pl&@klooki.net [/quote:2210957db9]
    I wrote above:
    it works from Cpanel 5.0 build 159 (EDGE) and later
    it seems that you have stable build 158
     
  8. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    I updated to the edge release 159

    Robert
     
  9. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    WHM 5.0.0 Cpanel 5.0.0-E159 RedHat 7.3
     
  10. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    [quote:ed8e987fe8][i:ed8e987fe8]Originally posted by flashhosts[/i:ed8e987fe8]

    WHM 5.0.0 Cpanel 5.0.0-E159 RedHat 7.3[/quote:ed8e987fe8]
    wait for stable build there will be no problem

    Nick:
    Edge = Bleeding Edge (Daily)
    Release = Standard Release (Weekly)
    Stable = A Release build which has proven to be good in the field (Monthly)

    Note: these times are approx.

    In general

    Stability : Stable & Release & Edge : New Features
     
  11. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    OK, I got the latest stable release and it still aint working.....

    Help please
     
  12. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Also for me it's not working, flashhosts have you found a solution?

    I'm using Cpanel 5.0.0-S194

    Mike
     
  13. itf

    itf Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    [quote:9a557d2b51][i:9a557d2b51]Originally posted by CoolMike[/i:9a557d2b51]

    Also for me it's not working, flashhosts have you found a solution?

    I'm using Cpanel 5.0.0-S194

    Mike[/quote:9a557d2b51]
    it works in Cpanel 5 build R244
     
  14. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    do we put the quotes around the script path?

    Robert
     
  15. cjg

    cjg Member

    Joined:
    Nov 20, 2001
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Running WHM 5.0.0
    Cpanel 5.2.0-R2
    RedHat 7.3

    And it is not working correctly in this. Had a customer add it to their account, and it ended up, as others have said with the @ symbol at the end and enclosed in & marks. If you manually remove the quotation marks and the addtional information it works as it should.
     
  16. flashhosts

    flashhosts Active Member

    Joined:
    Sep 1, 2002
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    I got cpanel to setup the forward but now when Im testing it I receive this email back to the email address I sent the request by:

    Child process of virtual_address_pipe transport returned 69 (could mean service or program unavailable) from command:
    /home/klooki/public_html/helpdesk/include/email.pl

    Anyone had this problem before?

    Robert
     
  17. patchwork

    patchwork Well-Known Member

    Joined:
    Nov 2, 2001
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    16
    I had a simalar problem with my php file, I had to put

    #!/bin/php

    as the first line of the file and make the file executable

    chmod +x filename


    It's now half working for me, I now get the original message returned and the script called once, if I parse the variables sent to the script it returns this


    LOCAL_PART =& pete
    LOGNAME =& pete
    USER =& pete
    DOMAIN =& domain.net
    HOME =&
    MESSAGE_ID =& E188NES-00013d-00
    PATH =& /usr/bin
    QUALIFY_DOMAIN =& sub.domain.com
    SENDER =& pete@domain.net
    SHELL =& /bin/sh


    I'm not sure what I have to do next to access the actual message.

    Pete
     
  18. CoolMike

    CoolMike Well-Known Member

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

    You can not collect the global variables, you need to take the stdin stream. I'm using the following script with the file extension .pl and chmod 755.


    [code:1:e0b6e9fbca]
    #!/usr/bin/php -q

    &?
    $fp = fopen(&php://stdin&,&r&) ;
    $buffer = && ;
    while (!feof($fp)) { $string .= fgetc($fp); }

    $fp= fopen(&test.txt&,&w&);
    fputs($fp, $string);
    fclose($fp);
    ?&
    [/code:1:e0b6e9fbca]




    It's just a test script, which stores the email to a file &test.txt&. I created the test.txt file manually and chmod 777.

    It works correct, but I get a mail reply back with the following error:

    [quote:e0b6e9fbca]
    This message was created automatically by mail delivery software (Exim).

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    pipe to |/home/brunner/public_html/testmail.pl
    generated by mailtest2@brunner.ws

    The following text was generated during the delivery attempt:

    ------ pipe to |/home/brunner/public_html/testmail.pl
    generated by mailtest2@brunner.ws ------
    [/quote:e0b6e9fbca]



    Can someone help me with this problem?

    Thanks
    Michael
     
  19. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    I think you have to return a result code, 0 if you processed the message (not sure now, you might want to have a look at exim.org)
     
  20. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    I can't find anything at exim.org. Is nobody using this mail pipe?

    Thanks
    Michael
     
Loading...

Share This Page