Incoming Email - kicks off an action: possible?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Courtly
    Member
    • Sep 2004
    • 35

    Incoming Email - kicks off an action: possible?

    Is it possible, using Dathorn's services, to initiate a process based on an incoming email?

    Let's say, for example, that I had a 'news' page on one of my websites, and I'd like to be able to send emails containing a one-time-use key and a formatted update to a certain address, and have the update appear on the news page... is that something which could be done?

    I was contemplating having a CRON task periodically review the mailbox, but I don't know if I'm getting way too complicated. Certainly not if there's something already out there I can use.

    If not, I guess I should move this thread to "what's missing".
    Ok, you guys start coding.
    I'll go find out what the customer wants.
  • Buddha
    Senior Member
    • Mar 2004
    • 825

    #2
    Might check out Easy Moblog. I think it should work here a Dathorn. We do have PHP socket access right?
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

    Comment

    • Eric
      Junior Member
      • Mar 2004
      • 22

      #3
      In the general purpose case of running email through a script, you can create a "pipe" ( the | character) to direct the email to a program instead of to a mailbox. If you go to cpanel --> mail --> aliases you can add the pipe there. First you'll need a perl script or php script to pipe the email to though, You can Google "pipe .forward php" for examples and more info.

      For blogs with an email interface, refer to the previous post, as that's a lot simpler than what I've mentioned.

      Eric
      Last edited by Eric; 09-25-2004, 11:02 AM.

      Comment

      • Courtly
        Member
        • Sep 2004
        • 35

        #4
        Originally posted by Eric
        If you go to cpanel --> mail --> aliases you can add the pipe there. First you'll need a perl script or php script to pipe the email to though, You can Google "pipe .forward php" for examples and more info.
        Thank you sirs! That's precisely what I was looking for, especially Eric's response.
        Ok, you guys start coding.
        I'll go find out what the customer wants.

        Comment

        • Frank Hagan
          Senior Member
          • Mar 2004
          • 724

          #5
          I'm looking to forward emails to a php script that imports them into a Phorum bulletin board. I don't see the cpanel -> mail -> aliases link in Cpanel any longer (I understand this post is being resurrected from a long time ago).

          So here's my question: Can I add a pipe to a program from the cpanel -> mail -> forwarders link?

          I have one set up with this in the forward box:

          |home/public_html/subdirectory/forum/phorummail.php 2

          From the webmail interface, if I click on "forwarders", it does confirm the forward:

          A copy of your mail is currently being forwarded to:
          |/home/public_html/subdirectory/forum/phorummail.php 2

          I sent an email about 30 minutes ago. So far, the email hasn't shown up in either my program or the mailbox in webmail. Nor is there any mention in the error logs about it.

          Is the path correct? Should the username be before /home/?

          Comment

          • Frank Hagan
            Senior Member
            • Mar 2004
            • 724

            #6
            OK, finally got a response:

            Code:
            This message was created automatically by mail delivery software.
            
            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/public_html/somedir/forum/phorummail.php 2
                generated by emailforum@mydomain.com
                local delivery failed
            
            ------ This is a copy of the message, including all the headers. ------
            "Local delivery failed" sounds better than a file not found or similar message. Anyone have any ideas on this one?

            Comment

            • Denny
              Junior Member
              • Jun 2006
              • 12

              #7
              I've always found email piping to be rather finicky in cPanel, but I think you problem here is that you do need to include the username in the directory structure. So it would be:
              Code:
              |/home/username/public_html/somedir/forum/phorummail.php
              I'm not sure if just that alone will work, though. I've had to do one or the either of these in the past:

              Code:
              |/usr/local/bin/php -q /home/username/public_html/script.php
              |/usr/local/bin/php /home/username/public_html/script.php
              Denny Cave
              Cave Interactive Media
              http://caveim.com

              Comment

              • Frank Hagan
                Senior Member
                • Mar 2004
                • 724

                #8
                Originally posted by Denny
                I've always found email piping to be rather finicky in cPanel, but I think you problem here is that you do need to include the username in the directory structure. So it would be:
                Code:
                |/home/username/public_html/somedir/forum/phorummail.php
                I'm not sure if just that alone will work, though. I've had to do one or the either of these in the past:

                Code:
                |/usr/local/bin/php -q /home/username/public_html/script.php
                |/usr/local/bin/php /home/username/public_html/script.php

                Thanks for your help, Denny. I've got it at least throwing significant error messages now, so it is finding the .php script and trying to process it (the last option seemed to work).

                The .php script calls the PEAR "mimeDecode.php" function in this fashion on line 46 (which the error message reports):

                Code:
                require_once 'Mail/mimeDecode.php';
                And the mail bounce is giving me this error message:

                Code:
                Fatal error: main(): Failed opening required 'Mail/mimeDecode.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/somedir/forum/phorummail.php on line 46
                The include_path seems correct to me, and I thought PEAR was part of all php installs after a much lower version than ours. Anyone have any ideas?

                Comment

                • AndrewT
                  Administrator
                  • Mar 2004
                  • 3653

                  #9
                  It's possible that that PEAR module is not installed. If you submit a trouble ticket I can double check this.

                  Comment

                  • Frank Hagan
                    Senior Member
                    • Mar 2004
                    • 724

                    #10
                    Thanks, Andrew. I just did.

                    BTW - my last ticket was responded to once again just minutes after I posted it, and it was in the middle of the night. You guys are amazing!

                    Comment

                    • Frank Hagan
                      Senior Member
                      • Mar 2004
                      • 724

                      #11
                      Thanks for the fast response! Within 5 minutes of my trouble ticket everything was done (and the initial response that it was being looked into was emailed in less than a minute!)

                      It seems to be working, but I disabled the forward until I can do some more rigorous testing. I want to make sure it doesn't do anything it shouldn't! I have been burned by mail lists in the past.

                      For the record, the second format in Denny's suggestion worked in this case:

                      |/usr/local/bin/php /home/username/public_html/script.php

                      Comment

                      • Frank Hagan
                        Senior Member
                        • Mar 2004
                        • 724

                        #12
                        Alas, the Mailman to Phroum bridge is not quite ready for prime time. I like the Phorum software, but the Phorummail.php script chokes on nested quotes and has some trouble stripping out the ill-behaved HTML that email clients such as Incredimail and Outlook Express insist on using.

                        (Not that HTML should be used ... EVER ... in email, but that's another rant entirely!)

                        Has anyone use Mhonarc to "pretty up" the Mailman archives, and provide search ability with it? I'm not sure it can be used in a shared environment (looks like it requires root access to install).

                        Or, has anyone used the phpBB Mail2Forum script to import Mailman messages into phpBB? The only other forum I've found that can bridge to Mailman is the unfortunately named FudForum, but it will not install on the server (it has an install script that throws errors ... I'd rather just upload the files myself, thank you, but that doesn't seem to be an option).

                        Comment

                        • Frank Hagan
                          Senior Member
                          • Mar 2004
                          • 724

                          #13
                          For anyone else looking to get a more accessible archive of a Mailman mailing list, our friends at Google have done it.

                          Go to groups.google.com and create a group, then log in to "Manage" the group. Select "Group Settings" and then the "Advanced" tab, and select "This group is hosted on another mailing list host". You enter the email address of your mailing list, and then enter a subscription for the Google Groups page (they give you the email to use to subscribe the Google group to your mail list).

                          Your users can choose to read the archives and post from there if they register with the Google group, or continue to use the Mailman mailing list. Seems to work fine.

                          Comment

                          Working...