Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    1

    Default [Q] Mail Filter: Redirect to Script

    The mail filter docs say one can redirect e-mail to a script:

    Redirect to a script - Enter the full script path
    but does not provide any further details.

    Has anyone implemented this?
    What does the shell of such a script look like?

    Is there any other documentation that goes into more detail?

  2. #2
    Member bamasbest's Avatar
    Join Date
    Jan 2004
    Posts
    531

    Default

    Actually, you "pipe" the email to a script.

    Example:

    parsethis@yourdomain.com -> | /home/user/public_html/cgi-bin/emailparser.php

    The script, in the language of your choice (as supported by your platform/install), would do all of the processing from there, depending upon your needs.

  3. #3
    Member
    Join Date
    Sep 2003
    Posts
    77

    Default

    Hi,

    In PHP, the shell of your script would look like this:

    PHP Code:
    $fd fopen("php://stdin""r");
    $email "";
    while (!
    feof($fd)) {
        
    $email .= fread($fd1024);
    }
    fclose($fd); 
    then the mail is in the var $email, and you can do what you wish with it.

    Hope that helps,

    Peter

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 10-13-2010, 05:43 PM
  2. Create new email from filter? Or cron / script?
    By larkim in forum E-mail Discussions
    Replies: 0
    Last Post: 11-12-2009, 06:27 AM
  3. Mail Filter pipe to PHP script (works but doesn't!)
    By Saiing in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-27-2006, 08:43 AM
  4. Filter Script
    By mazarin17 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-05-2005, 07:51 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube