Author Topic: Hard time setting up bounce.cgi on DreamHost  (Read 6229 times)

  • Guest
Hard time setting up bounce.cgi on DreamHost
« on: September 24, 2006, 07:49:00 pm »
Do I really need to set up everything as described in the Installation Section of Online Help? I am having a very hard time setting up email aliases with dreamhost.

I am stuck at this part for dreamhost


I installed the SSH program and this part is very confusing.

- file start --
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@yourdomain\.com
| /home/yd_bounce/bounce.cgi
-- file end --

This is what I put


- file start --
DEFAULT=mydomainname/mail/
MAILDIR=mydomainname/mail
PMDIR=mydomainname/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@mydomainname.com
| /mydomainname/bounce.cgi
-- file end --

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #1 on: September 25, 2006, 09:04:03 am »
This can certainly be difficult for those who have not done it before.

Where you have:

Code: [Select]
- file start --
DEFAULT=mydomainname/mail/
MAILDIR=mydomainname/mail
PMDIR=mydomainname/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@mydomainname.com
| /mydomainname/bounce.cgi
-- file end --

It should read:
Code: [Select]
- file start --
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@yourdomain\.com
| /home/USER/bounce.cgi
-- file end --

The DreamHost system user "USER" should be attached to the email address bounce@yourdomain.com.

The $HOME variables should stay the same.

"USER" is the name of your system user which you use to login via SSH.

yourdomain\.com should be replaced with your domain.   The backslash is necessary because otherwise the period means "any character".

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

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #2 on: September 25, 2006, 06:42:57 pm »
I still dont get it.

So out of this:
Code: [Select]
- file start --
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@yourdomain\.com
| /home/USER/bounce.cgi
-- file end --


What do I have to change? Do I just change the bottom part of the script?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #3 on: September 26, 2006, 10:00:34 am »
As seen at http://listmailpro.com/help/cgi_dreamhost.html you need to set up a user and an email account, attached to the created user, from the DreamHost control panel.

The part of .procmailrc you must modify is in bold:

DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@yourdomain\.com
| /home/USER/bounce.cgi

Please let me know if I can be of further assistance!

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

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #4 on: September 26, 2006, 05:21:12 pm »
Ok I did that and the next part is even more confusing. It says to copy content from bounce.cgi and copy it to a new file in vi editor??? So I typed vi. bounce.cgi in the SSH client and pasted my content. It says to type chmod +x bounce.cgi which I did and it says no file is found.

My question is What is bounce? And do I really need it if I want to only get signups with autoresponder and send mail weekly?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #5 on: September 26, 2006, 06:01:27 pm »
The DreamHost shell commands are one of the more difficult methods of setting up ListMail.

Step-by-step instructions are as follows:

1. vi bounce.cgi
2. Press I to go into 'insert mode'
3. Paste your bounce.cgi contents (Tip: to avoid word wrap maximize the window)
4. Press ESC then enter :wq and hit enter
5. chmod +x bounce.cgi

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

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #6 on: September 26, 2006, 11:28:51 pm »
ok I did everything and I did not get an email to my administrator email when I tested it so I assume it doesnt work...

you still didnt answer my question if I really need bounce or not?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #7 on: September 27, 2006, 01:29:55 am »
Did you also create the required .forward.postfix file as noted at http://listmailpro.com/help/cgi_dreamhost.html?

Is the email address bounce@example.com set to forward email to the system user you set up and are logging in as?

Bounce is not required but is recommended to avoid placing unnecessary load on your SMTP server as well as to avoid blocks for sending too many erroneous emails.  With a smaller list <5k users or so you shouldn't have too many problems.  With such a small list you also have the option of processing bounces using a standard mailbox instead of difficult-to-configure-on-dreamhost bounce.cgi.

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

mr.trevor

  • Posts: 125
    • View Profile
Hard time setting up bounce.cgi on DreamHost
« Reply #8 on: September 27, 2006, 07:19:05 am »
Dean,
If Deamhost is so difficult to set up, why do you have it listed in your signature block?

Isn't this just asking for trouble?
TrevorW

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #9 on: September 27, 2006, 01:15:51 pm »
DreamHost is one of the cheapest, most reliable and expandable hosts that  fully supports all of ListMail's features.  Almost all other huge providers have  a more strict email policy and limits on sought-after features such as email forwarding to CGI and scheduled cron tasks.
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #10 on: September 27, 2006, 06:21:59 pm »
ok I think I did it. I clicked on test mail setting and got this.

Code: [Select]
[Bounce Handling]
Is enabled?  Yes, Using bounce.cgi
Sending TESTBOUNCE email to bounce address.. Success!

If you receive an email at your "Administrator Email Address" bounce.cgi is configured correctly.


And I got an email sent to bounce@example.com which was forwarded to my administrator@example.com.

Which has a subject "TESTBOUNCE" and message was "test"

And when I get to this page http://listmailpro.com/help/test_mail_settings.html

It says you should of received this instead

Code: [Select]
Subject: ListMail bounce.cgi Test: Success!
Message: The test message was successfully received and processed by ListMail's bounce.cgi.
This most likely means that the script is configured correctly.



So did I do it right or was I suppose to receive the above message?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #11 on: September 28, 2006, 12:35:33 am »
You should have received the success message noted in the help files.  It seems that this is not happening and the "TESTBOUNCE" message, which you shouldn't normally see, is instead being forwarded on to your administrator address.

In your DH control panel you should have 2 users under "Users".  One for FTP to your site and the one for ListMail bounce (and cron).

In the "Mail", "Manage Email" section there should be an address, bounce@example.com, which forwards to the additional user where bounce.cgi is setup via shell.

ie:
Email Address
"Mailbox Name" Login
Disk / Max (%)    

bounce@example.com
"ListMail Bounce and Cron" bounceuser
  0 MB / 20480 MB (0%)*

Also forwards to:
Nothing besides "bounceuser".

In the past I have found DreamHost slightly buggy when applying a new email address to a new user during the new user creation process.  To avoid any problems I usually go into Manage Email, click "Edit" next to the bounce user and then click "Edit Address" to re-update the email account.
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #12 on: September 28, 2006, 01:56:04 am »
ok I think I have everything in SSH shell setup. Where am I suppose to put my bounce.cgi ?  I have one in home/yd_bounce/bounce.cgi and one in home/cgi-bin/bounce.cgi .


Also what do I change in bounce.cgi. I have this.

Code: [Select]
#!/usr/bin/perl
#
# ListMail bounce.cgi
#
# Modify this file to contain your ListMail URL, place it in your cgi-bin directory and CHMOD it to 755.

# Full URL to ListMail, no trailing slash
$listmail_url = "http://www.mydomain.com/mail";

# Program and paramaters to pass URL to
# Usually works as default (may be /usr/local/bin/wget or other)
$http_program = "/usr/bin/wget -O /dev/null " . $listmail_url . "/bounce.php";

# dont need to change anything below here

sub encode {
  my $str = shift || '';
  $str =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg;
  $str;
}

# main

# get piped message
$email = '';
while($line=<>){
 $email = $email . $line;
}

if($email){
 if($email ne ''){
  $sys_cmd = $http_program . "\\?em=" . encode(substr($email,0,4096)) . " 1> /dev/null 2> /dev/null";
 }
 # forward to bounce.php
 system($sys_cmd);
}
# done!




And you said that I should have my bounce@example.com forwarded to my administator email??? in bounce.cgi via shell?? What does this mean?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Hard time setting up bounce.cgi on DreamHost
« Reply #13 on: September 28, 2006, 02:34:01 am »
bounce.cgi does not need to exist in your web or web cgi-bin folder - it only needs to be entered via SSH for the "yd_bounce" user. (yd was actually short for "yourdomain" - the username could be anything you want as long as it matches what's entered in .procmailrc)

The only line you need to change in bounce.cgi before or after pasting it via shell is this one, which should point to your ListMail installation:
Code: [Select]
$listmail_url = "http://www.mydomain.com/mail";
Quote
And you said that I should have my bounce@example.com forwarded to my administator email??? in bounce.cgi via shell?? What does this mean?

No, the bounce@yourdomain.com email address should point to the "yd_bounce" user account.
Quote
Also forwards to:
Nothing besides "bounceuser".

Note that I used bounceuser instead of yd_bounce interchangeably and example.com should be your domain.

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

  • Guest
Hard time setting up bounce.cgi on DreamHost
« Reply #14 on: September 28, 2006, 03:49:34 am »
hmm ok I did everything as said.

vi .forward.postfix is

Code: [Select]
"|/usr/bin/procmail -t"

My vi .procmailrc is

Code: [Select]

DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
SHELL=/bin/sh

:0
* ^TO_bounce@mydomain.com
| /home/bounceuser/bounce.cgi
~



vi bounce.cgi is
Code: [Select]

stMail bounce.cgi
#
# Modify this file to contain your ListMail URL, place it in your cgi-bin directory and CHMOD it to 755.

# Full URL to ListMail, no trailing slash
$listmail_url = "http://www.mydomain.com/mail";

# Program and paramaters to pass URL to
# Usually works as default (may be /usr/local/bin/wget or other)
$http_program = "/usr/bin/wget -O /dev/null " . $listmail_url . "/bounce.php";

# dont need to change anything below here

sub encode {
  my $str = shift || '';
    $str =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg;
      $str;
      }

      # main

      # get piped message
      $email = '';
      while($line=<>){
       $email = $email . $line;
       }

       if($email){
        if($email ne ''){
          $sys_cmd = $http_program . "\\?em=" . encode(substr($email,0,4096)) . " 1> /dev/null 2> /dev/null";
           }
            # forward to bounce.php
             system($sys_cmd);
             }
             # done!



and than I enter
Code: [Select]

chmod +x bounce.cgi


When I enter chmod +x bounce.cgi, nothing happens. Is it suppose to show a message under it???