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.

eMail Piping to perl script PLUS copy to specific pop account (via cPanel)

Discussion in 'E-mail Discussions' started by cards4success, Feb 29, 2004.

  1. We need to realize the following as part of an autoresponder system:

    All unrouted emails are to be piped to a perl script AND a copy of those emails should be send to a specific pop account.

    We have set the default address (through cPanel) to be piped to the perl script as follows:

    PHP:
    default address: |/usr/bin/perl /home/user/public_html/cgi-bin/folder1/script.pl
    All works fine, with the exception that we do not receive the mails which are handled by the perl script.


    Any help is highly appreciated.

    Thanks so much in advance.
     
  2. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Sounds to me like there may be some issues with the perl script itself.

    When you say that "all works fine ...." I can assume that these unrouted emails are being captured. Just seems to be a problem with the algorithms for filtering and mailing?
     
  3. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    What about:

    *: default@address, |/path/to/script

    I hope you realise that almost all spam comes with forged From: and Reply-to: headers.
     
  4. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Certainly!

    Unadressed/unrouted email seems to be piping to your perl script. The question... what is your script doing with it? If it is supposed to validate and filter headers based upon certain regex paramaters, discard those that fail and email those that pass, there may be a syntax error in the code.

    Can you at least execute your script with a -w and pass some test paramaters through to see what/where things may be getting stuck?
     
  5. If I enter the above in the field for the default address and confirm the changes then only the piping will be carried out and the first part (the one in front of the comma) will be neglected. When I check on the settings for the default address only the piping part is showing up: |/path/to/script but not the part that covers the default@address.

    If I switch the order to
    *: |/path/to/script, default@address
    then all unrouted mail is simply going to the default address but not being piped to the script.

    It seems as -when there is a comma- only the part that follows the comma is being saved and carried out.

    Anyhow, the script itself is working fine. I used to run that one on another (virtual) server with a different hosting company, also with cPanel but obviously with a different theme (still figuring out which one). There I had the change through the cPanel to setup a default address in a two step process:

    1. to chose an email address (pop account) where all unrouted email is being sent to

    and in a second step:

    2. to set up a pipe to a script.

    There was a second box for the *additional* piping option.

    In other words the scripts works as it is supposed to but I need to set up the mail server to send a copy of each incoming unrouted mail to the default address AND to pipe the mail to the script.

    As mentioned above I simply need to know the syntax how to make the cPanel default address settings understand that BOTH commands (maill to be piped to script and copy to be sent to default@address).

    The "," solution seems not to work...

    Any suggestion would be highly appreciated.

    Thanks in advance.
     
  6. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Now I See!!!

    Just change your default address to the pipe

    | /path/to/perl/script

    You don't need the

    *: default@address,
     
  7. Forgive me my noobness... but maybe I am blindfolded...

    I had set my default address to: |/usr/bin/perl /home/user/public_html/cgi-bin/folder1/script.pl

    and as I said, the piping works fine, the incoming unrouted emails are being piped to the (autoresponder) script and assigned the individual autoresponder-series. BUT the email itself gets lost as I do NOT get them sent as copy to my pop account. I know that I have to set up that through cPanel, but still don't know how to do that (i.e. how to get

    a) the mail to be piped to the script (that part works fine)

    AND

    b) to get a copy of the mail delivered to a specific email address / pop account (just in case I need to actually READ what is in the mail which was sent and handled by the script).

    Sorry again for my newbie questions... but as I mentioned before, I know that it works somehow but I still do not know the exact settings.

    Confused greetings...
     
Loading...

Share This Page