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

C

cards4success

Guest
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.


How do we need to modify the above to get

a) a copy of each mail to be sent to a specific pop account ([email protected])

and

b) to continue to get the mail piped through the above perl script?
Any help is highly appreciated.

Thanks so much in advance.
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
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?
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
Originally posted by Juanra
What about:

*: [email protected], |/path/to/script

I hope you realise that almost all spam comes with forged From: and Reply-to: headers.
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?
 
C

cards4success

Guest
Originally posted by Juanra
What about:

*: [email protected], |/path/to/script

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 [email protected]

If I switch the order to
*: |/path/to/script, [email protected]
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 [email protected]).

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

Any suggestion would be highly appreciated.

Thanks in advance.
 
C

cards4success

Guest
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...