Piping email to php problem...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdezela
    Junior Member
    • May 2004
    • 3

    #1

    Piping email to php problem...

    I've got this script set up (pLog - blogging script) that has support for remote blogging through a file "moblog.php" which takes the email contents and passes it to the rest.

    The server needs to pass the email to "moblog.php" and it takes over from there, problem is, the server is not passing the information. The script calls for this:

    Code:
    moblog: "|curl -F message='<-' http://yourhost.com/moblog.php"
    ...but since we don't have access to aliases, I have to use Cpanel to do this.

    Now, the way to do this in Cpanel is to set up the following forwarder:

    Code:
     mail@yourhost.com >> |/home/user/public_html/script.php
    But that isn't working, so looking around and asking, I've tried all the following scenarios, with varying degrees of success:

    1
    Code:
    mail@yourhost.com >> |/home/user/public_html/script.php
    
    Bounces with "local delivery failed"
    2
    Code:
    mail@yourhost.com >> "|/home/user/public_html/script.php"
    
    Bounces with "local delivery failed"
    3
    Code:
    mail@yourhost.com >> |"/home/user/public_html/script.php"
    
    Bounces with "local delivery failed"
    4
    Code:
    mail@yourhost.com >> |curl -F message='<-' http://www.consultatium.com/tmp/moblog.php
    
    Passes only "<-" to the script, which generates the following output:
    
    21-08-2005 07:15:38 DEBUG - [mobloglogger.class.php:21 (logger:debug)] -- message --
    21-08-2005 07:15:38 DEBUG - [mobloglogger.class.php:21 (logger:debug)] '<-'
    21-08-2005 07:15:38 DEBUG - [mobloglogger.class.php:21 (logger:debug)] -- end --
    I emailed Cpanel for support and they told me that the first attempt should work, and that if it doesnt, I should ask my host what they have changed so I can get the correct syntax or if they have disabled it on my server.

    However, when submitting a trouble ticket, I'm told I can't get trouble ticket support for 3d party scripts and should post in the forums...so here I am, anyone have any idea what I can do?

    Also, now I have a bunch of forwarders I can't erase (the ones with curl) for some reason....aaarghgh.
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    I've had no success in getting this to work either, so it will be interesting to see if anyone has.

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • Chris
      Junior Member
      • Mar 2004
      • 10

      #3
      I have remote blogging working with Wordpress - there's a script thats built into it that actually checks the email rather than piping the email into a database with any. I think its mailsomething.php that does all the work..

      Comment

      • hdezela
        Junior Member
        • May 2004
        • 3

        #4
        Apparently, on Dathorn, the way to do this is:

        Code:
        |/usr/local/bin/php /home/user/public_html/path/to/script
        That is, pipe, NO SPACE, path to php, SPACE, full path to script.

        Thank Andrew for answering this in my trouble ticket. (Sorry to have been such a bother with this, Andrew )

        Comment

        • Buddha
          Senior Member
          • Mar 2004
          • 825

          #5
          Thanks for sharing hdezela.
          Last edited by Buddha; 08-24-2005, 04:06 PM. Reason: Intuition
          "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

          Comment

          • sdjl
            Senior Member
            • Mar 2004
            • 502

            #6
            Indeed. Works here
            -----
            Do you fear the obsolescence of the metanarrative apparatus of legitimation?

            Comment

            • cohesive
              Junior Member
              • Jan 2005
              • 5

              #7
              So how is message passed so it can be worked on via PHP? Is it some sort of POST or GET argument, or something else? I don't get how the script can know anything about the message ... or at least how a programmer can use that information.

              Comment

              • sdjl
                Senior Member
                • Mar 2004
                • 502

                #8
                I found this article on Evolt helped me greatly in getting this to work.

                Founded in 1998, evolt.org was one of the oldest Web development communities in existence. Through our mailing lists, articles, and archives, we have strived to work together in sharing our collective knowledge to improve the Web for all of us.


                The way PHP reads the information is via something called stdin, of which more information can be found at the PHP website.

                David
                -----
                Do you fear the obsolescence of the metanarrative apparatus of legitimation?

                Comment

                • ZYV
                  Senior Member
                  • Sep 2005
                  • 315

                  #9
                  "Something called stdin" is actually the pipe to the standard input device which is created by default on every php script execution. The same for stderr, stdout etc.

                  Comment

                  Working...