Author Topic: Setup bounce.cgi under CPanel  (Read 3174 times)

Charybdis

  • Posts: 31
    • View Profile
Setup bounce.cgi under CPanel
« on: June 23, 2007, 04:29:40 am »
Greetings,

bounce.cgi is not working under cpanel     10.9.0-RELEASE-7965.

I have setup e-mail alias in cpanel like this:

bounce@mysite.com --> |/home/username/public_html/cgi-bin/bounce.cgi

where username is correct.

If I test the mail settings, then it said: Bounce and SMTP settings are correct. But then I receive only 1 e-mail, (smtp success), but not bounce success.

bounce@mysite.com is set up in configuration panel, and it is not listed under standard accounts. And the permission of bounce.cgi is 755. What can be the problem? The path to cgi is wrong?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Setup bounce.cgi under CPanel
« Reply #1 on: June 23, 2007, 06:23:25 pm »
Try sending a manual email to the bounce address with TESTBOUNCE in the subject.  You may receive a bounce back containing more information.

Your host/server may have restricted access to the /usr/bin/wget utility used by the script.  I have seen cPanel servers where /usr/bin/wget is restricted to users in the "get-users" group.  Two possible solutions to allow the mailer to be able to access wget:

1. Add the mailer user to the "get-users" group.  This is unlikely to be allowed.

2. Have a copy of 'wget' placed in your home folder with a random/unguessable filename and full access to all users.  The .cgi scripts will need to be updated to change /usr/bin/wget to the path and filename of the copy.

To use /usr/bin/wget for your dailymail cron job you may need to have your FTP user added to the "get-users" group or, again, use a copy of wget hosted in your home folder.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Charybdis

  • Posts: 31
    • View Profile
Setup bounce.cgi under CPanel
« Reply #2 on: June 24, 2007, 03:54:37 am »
But cron is working, and cron uses wget, too. So whats the problem with wget in bounce.cgi?

I can ask my host for this, but could you tell me exactly what I should tell to my host?

(And I managed to forward an email address to a cgi script with the same format, so it is also works.)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Setup bounce.cgi under CPanel
« Reply #3 on: June 24, 2007, 04:34:59 am »
We might not need to contact the host... If dailymail works then I recommend double-checking bounce.cgi (ListMail URL, permissions, etc) and attempting a manual email with TESTBOUNCE in the subject (then check for returned mail containing an error).

The following code, entered to a .php file, uploaded and browsed to, will show the exact owner and permissions of the wget utility:
Code: [Select]
<?php
echo shell_exec("ls -al /usr/bin/wget");
?>

Also, please double-check that the bounce address does not exist under standard mailboxes - it must only exist as an email forwarder.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Charybdis

  • Posts: 31
    • View Profile
Setup bounce.cgi under CPanel
« Reply #4 on: June 27, 2007, 02:44:25 am »
bounce.cgi has permission 755. The listmail url is correct in bounce.cgi (no trailing slash).

bounce@mysite.com is not listed under standers mail accounts in cpanel.

I tried this php snippet, but shell_exec is disabled due to security reasons.

But I sent an email to bounce@mysite.com with TESTBOUNCE in subject, and the response is this:


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

 pipe to |/home/username/public_html/cgi-bin/bounce.cgi
   generated by bounce@mysite.com
   local delivery failed

------ This is a copy of the message, including all the headers. ------

Then the copy of the message...


The mail server and the listmail maybe (but Im not sure) are in different servers, could this cause problems?

Forward email to cgi script is working, I have tested it with another program, and cgi is able to handle the mail.

(|/home/username/public_html/cgi-bin/bounce.cgi --> the username here is my username, but I have changed it here in forum, and mysite.com is my domain name, but I have changed it here, too)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Setup bounce.cgi under CPanel
« Reply #5 on: June 27, 2007, 02:48:54 pm »
Quote
The mail server and the listmail maybe (but Im not sure) are in different servers, could this cause problems?

Yes, absolutely.  The bounce.cgi script must be installed on the actual mail server receiving the mail.

Try an IP lookup of www.example.com vs. mail.example.com.  If the IPs are different you may be on to something!

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Charybdis

  • Posts: 31
    • View Profile
Setup bounce.cgi under CPanel
« Reply #6 on: June 28, 2007, 03:38:43 am »
No, their IPs are the same...

So, what can be the problem?...

I can ask my host about this problem, but what should I ask exactly? (to resolve the problem)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Setup bounce.cgi under CPanel
« Reply #7 on: June 28, 2007, 07:50:05 am »
I have not seen this before on a cPanel server.  You might want to do a "View" on the remote bounce.cgi file using your FTP client to make sure the file was uploaded properly.  An incorrect transfer mode (ASCII vs Binary) can cause things like double linebreaks that can cause the script not to work.

If you do decide to contact your host I would simply mention that you are trying to set up an email to CGI forwarder but when emailing the address you get a bounce:
Quote
pipe to |/home/username/public_html/cgi-bin/bounce.cgi
generated by bounce@mysite.com
local delivery failed

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting