« Return to Thread: Run PHP script to do stuff to an email in the inbox

Re: Run PHP script to do stuff to an email in the inbox

by Duncan Clarkson-3 :: Rate this Message:

Reply to Author | View in Thread

Thanks for the reply. I've installed the spam_buttons plugin and configured it to use a custom function. Here is my simple test function:

function hello_world($message_ids, $passed_ent_id) {
  echo 'Hello World!';
  touch('/tmp/mrchicken');
  return '';
}

In this case I know the function executes as the file is created (although I'm not sure where the output from the echo has gone as it doesn't appear in the source of the page that is returned).

What's not clear to me is how to use this custom function to launch a window with a form the user can interact with (or redirect to a page with a form). How can I achieve this kind of behaviour with the plugin?

Duncan

2008/10/24 Paul Lesniewski <paul@...>
On Fri, Oct 24, 2008 at 6:10 AM, Duncan Clarkson <dnc@...> wrote:
> Hi,
>
> We want to add functionality to a web-based email client that will allow us
> to classify each email in the inbox and create a record in a database with
> some of the content of that email. For example, a link would be available
> when viewing each email that would launch a window with the classification
> options and a submit button. When the submit button is clicked some of the
> content of the email is added to the database with classification
> information.
>
> Assuming the classification system already exists as a PHP script, how easy
> would it be to integrate into SquirrelMail using the plugin architecture? Is
> the plugin arhitecture designed for this type of customisation?

Using the Spam Buttons plugin, you merely need to use your script as
the "report by custom function" backend.  So you don't need to build a
plugin - just configure Spam Buttons to use your script.

Cheers,

Paul

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-plugins@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-plugins@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins

 « Return to Thread: Run PHP script to do stuff to an email in the inbox