The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Piping exim mail to perl

Discussion in 'E-mail Discussions' started by hostito, Jun 3, 2003.

  1. hostito

    hostito Active Member

    Joined:
    Mar 9, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    Been trying to pipe an email to a perl script:

    tried this:

    1) edit /etc/valiases/domain.name

    email@domain.name: "/path/to/script.pl"

    When I send email I get this:

    2003-06-03 11:12:14 19NDSO-00087w-00 Neither the virtual_aliases_nostar director nor the address_file transport set a uid for local delivery of /path/to/script.pl

    I tried setting it with mail,and the account owner but it will not mail.

    I tried SUID with both mail and user also onthe script and still ti does not work.

    Anyone run into this one before?

    Thanks :)

    cPanel.net Support Ticket Number:
     
  2. hostito

    hostito Active Member

    Joined:
    Mar 9, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    update

    Ok, I am pretty sure now that some how exim is unable to determine what the uid is for the script.

    The forwarding is working ok, I am pretty certain.

    Any ideas on editing the exim.conf so you can pipe to a perl script?

    I don't believe I ever changed it from when I first got the cpanel system.

    Thanks again ...

    cPanel.net Support Ticket Number:
     
  3. dRiver

    dRiver Active Member

    Joined:
    Aug 11, 2002
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    maybe try following:

    email@domain.name: |/full/path/to/script.pl

    cPanel.net Support Ticket Number:
     
  4. hostito

    hostito Active Member

    Joined:
    Mar 9, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Thanks dRiver.

    I did as you said to begin with and I keep getting this:

    2003-06-03 13:24:16 19NFWB-0001dv-00 Neither the virtual_aliases_nostar director nor the address_file transport set a uid for local delivery of /home/hostito/gateway.pl


    I looked at the virtual_alias_nostar directive and I tried to set a user and group as

    So I edited the virtual_alias_nostar and address_file directive to have this:

    user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"

    and I moved kept getting this error that said could not write lock file. Then, after changing moving it to mail since exim runs as mail, and so it can write the lock file, every time the script runs it changes permissionns to

    -rw-------

    I am getting closer, but still not there.

    Thanks again.

    cPanel.net Support Ticket Number:
     
  5. hostito

    hostito Active Member

    Joined:
    Mar 9, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    sorry for my unintelligible reply.

    I am getting it to work, but for some reason my script is not wroking, most likely due to umask and such.

    Thanks for your help earlier.

    cPanel.net Support Ticket Number:
     
  6. MySundown

    MySundown Well-Known Member

    Joined:
    Jun 2, 2003
    Messages:
    128
    Likes Received:
    0
    Trophy Points:
    16
    Whenever I have a perl script that needs to get emails piped into it, I go into cPanel and setup a fowarder for to: |/home/whatever/script.pl and it works fine. Maybe you're trying too hard. Try the simple way first and then try messing around with the files ;)

    cPanel.net Support Ticket Number:
     
  7. mitul

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    I had the same problem executing a php script. Following solved my problem.....

    If you have something like this in the top line

    #!/usr/bin/php

    then you need to modify it to say

    #!/usr/bin/php -q

    this causes php to go into quiet and only produce messages if it encounter problems due to commands in the script (e.g. the same you would see if there were problems with a script when its run from a website)

    cPanel.net Support Ticket Number:
     
  8. hostito

    hostito Active Member

    Joined:
    Mar 9, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    I just started over, set exim to defaults and got it to work on a real account, but not on a virtual one. I think this was my problem all along. Either way it is working for me now to what I need.

    Thanks to all for the tips !!!!

    cPanel.net Support Ticket Number:
     
  9. neufusion

    neufusion Registered

    Joined:
    Oct 15, 2002
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Sorry to bring this back up but I'm having the exact same problem when trying to pipe things to perldesk. How exactly did you get it working? Not using the forwarder or chmod or what? Thanks

    cPanel.net Support Ticket Number:
     
  10. infinityws

    infinityws Well-Known Member

    Joined:
    Feb 20, 2003
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    The closest I got to Exim piping email was it sending the mail to the appropriate address, but also returning a failed message.

    cPanel.net Support Ticket Number:
     
  11. howard

    howard Well-Known Member

    Joined:
    Apr 20, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    for what its worth you can remove the return_output to prevent output from the script (that is output which not directed into a script / file / etc) causing exim to fail the message the following except frm the exim docs may help to explain this

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page