1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Pipe email from qmail to PHP

Discussion in 'Plesk for Linux - 8.x and Older' started by fishnyc22, May 14, 2007.

  1. fishnyc22

    fishnyc22 Guest

    0
     
    I've been struggling with this for way too long. Can anyone explain what i'm doing wrong here:

    I've set my .qmail file to look like this:
    Code:
    |/etc/bin/php -q |/var/www/vhosts/domain.com/httpdocs/_phpcgi/test.php
    
    or
    Code:
    |/etc/bin/php |/var/www/vhosts/domain.com/httpdocs/_phpcgi/test.php
    
    and my php file simply as:
    Code:
    <?php
    // Send
    mail('test@gmail.com','test subject', 'my message goes here');
    ?>
    
    I'm getting this error:
    May 15 01:25:29 as qmail: 1179206729.939189 delivery 2: deferral: No_input_file_specified./



    When i try and switch it around:

    .qmail looks like this
    Code:
    |/var/www/vhosts/domain.com/httpdocs/_phpcgi/test.php
    
    php file looks like this
    Code:
    #!/usr/bin/php -q
    <?php
    // Send
    mail('test@gmail.com','test subject', 'my message goes here');
    ?>
    
    When set up like this my error is:
    May 15 01:37:36 as qmail: 1179207456.473053 delivery 1: deferral: /bin/sh:_/var/www/vhosts/domain.com/httpdocs/_phpcgi/test.php:_Permission_denied/


    I'm running plesk 8.1 on Fedora, My permissions are as follows:

    -rwxr-xr-x 1 ftpuser psacln 98 May 15 01:37 test.php

    and for qmail:
    -r-------- 1 popuser popuser 73 May 15 01:36 .qmail


    Any help is really appreciated. Is this the latest method or is there some other way to get this going?
     
  2. edacsac

    edacsac Guest

    0
     
    Hi fishnyc22,

    I've been working on this same problem for a week as well, getting nowhere. I see you get an error message. That is way more than I get. Can I ask what file your error message is showing up in?

    As for fixing the error, your second setup gets past finding php, so thats the better route to go at this point. My first thought would be to change the owner of test.php to a user that has executable rights (I would even try root, but just for testing only!).

    I would love to hear some experienced input. I'm going crazy with this.
     
  3. fishnyc22

    fishnyc22 Guest

    0
     
    I'm hardly "experienced" trust me. I gave up on that a while ago. And then changed servers. I'm now on a CentOS server that seems to not have a qmail binary. Everything points to sendmail. very strange.

    a few weeks ago I started looking into other options to parse email. I came across this. Take a look. I got it to a point where it was reading the message in a php page as a test. but had to stop to work on other stuff.

    This is a really powerful script. Take a look at:

    http://ez.no/ezcomponents

    http://ez.no/doc/components/view/latest/(file)/introduction_Mail.html

    Let me know if you figure anythign out.
     
  4. greyman56

    greyman56 Guest

    0
     
    I am not an experienced Plesk user, but very experienced at standard qmail installations.

    The local delivery of the mail system assumes the user/group of the owner of the mailbox in order to do the delivery.

    On the test Plesk system I have just set up (8.1.1), the mailbox files are owned by popuser:popuser.

    Try setting the script with that owner and maybe also the group (should not be necessary but try if owner alone does not work).

    Cheers
    Graham
     
  5. fishnyc22

    fishnyc22 Guest

    0
     
    I believe I tried setting it to popuser. I forget. I will be getting back on that part of the project in a week or so and will let you know what I find out.

    Thanks for the reply.
     
  6. raaqi

    raaqi Guest

    0
     
    Put this in your .qmail

    | /var/qmail/mail.php

    chown popuser:popuser mail.php

    Your script will work now. However not alot of other functions will work so i've realised.

    Any ideas?
     
Loading...