Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Junior Member
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    14

    Default Form Mail config error

    I'm a new user with problems setting up Form Mail.

    I get an "Internal Server Error or misconfiguration", identical to the one described in the thread at

    http://forums.westhost.com/phpBB2/viewtopic.php?t=1669

    I have studied all the FormMail-related posts on this forum (especially the one above) with no good results.

    Some added info:

    (1) I already had a catch-all email account (as noted in that thread). I removed and re-installed the catch-all; nothing changed.

    (2) I have the reseller package, with quite a few domains installed. The problem surfaced in "www.onelowdomain.com". I copied the form to "www.mytopdomain.com" and got the same error. This does not rule out a multiple-domain problem, but neither does it confirm it.

    (3) I modified FormMail.pl to add "onelowdomain" to the Referers array; made no other changes. (I don't know Perl; I assume that file doesn't need to be compiled?????)

    (4) The "recipient" field in my form is a valid email User account, not an alias, and is formatted as "username@mytopdomain.com".

    (5) I wonder if the problem may still be related to the catch-all configuration. My catch-all account is called "mytopdomain@mytopdomain.com". That has worked for the past month to gather up all my email from the various domains, but maybe it's not right for FormMail.

    (6) I also wonder if I have been blinded by that post, and am looking in the wrong place!!!

    I've spent several hours trying to test this out for myself. I have a few ideas for other tests (all too lengthy to do before I sleep), with a fresh start tomorrow. In the meantime, I'll throw myself on the mercy of you experts. Any ideas? Thanks for the help!
    ________
    RM85
    Last edited by walt; 01-23-2011 at 06:03 AM.

  2. #2
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    The error usually means there was an error running the script. Probably nothing to do with domains or email accounts.

    Likely problems are:
    1. The script has been saved in Windows format
    2. It has been uploaded 'badly' (line endings converted).
    3. The path to perl is wrong in the first line of the script.
    [ed]4. You have added some invalid perl code into the file.

    One way to check is to shell into your account and then run the scipt manually. That will give a you a clearer error and help you find the problem.

  3. #3

    Default

    Often in a perl script an email address needs an escape before @ ("mytopdomain\@mytopdomain.com"). I don't know Formmail.
    Second comment, just to make sure you haven't inadvertantly made a syntax error, have you tried it without your single change (add "onelowdomain" to the Referers array) just to see if it works that way.
    btw no need to compile.

  4. #4
    Junior Member
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    14

    Default

    Thanks a lot for your suggestions, jalal. The comments about line endings and invalid perl code appear to be in the right neighborhood.

    I have isolated the problem, but don't know how to fix it.

    The root of the problem is, in fact, multiple domains, but there is another issue. I re-installed FormMail and copied my form to "mytopdomain.com" where it runs perfectly, catching required fields, etc. But in order to run the form at "onelowdomain.com" I <<must>> add the lower domain to the @referer array (a config variable) in FormMail.pl ("must", at least, according to Matt's documentation and my tests so far).

    And there is the rub: When I try to edit FormMail.pl, I corrupt the file, producing the Internal Server error. I have tried the following:
    (1) edit FormMail.pl directly using the Site Manager edit feature;
    (2) copy/paste the file (using SM edit feature) to Notepad, then FTP'ing the file back, changing to 755, etc.
    (3) MERELY opening the file using SM edit feature, touching NO KEYS, and then saving the file <<unchanged>> (but, obviously, not really unchanged!)

    All of those actions corrupt the file. The form works perfectly before the attempts to change FormMail.pl (after reverting to the original file), and generates the Internal Server error after each attempt.

    So my question now is simply: How do I edit FormMail.pl? Any suggestions for the proper tool? And if that tool is on my computer, how do I download a clean copy of FormMail.pl to that editing tool? Is there another editing script on WH?

  5. #5
    Junior Member
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    14

    Default

    Thanks, sunzon. We were both apparently writing at the same time; mine took longer.

    Your diagnosis was correct; I had in fact corrupted the .pl file while making the @referer change (explained in my previous post).

  6. #6

    Default

    If you are corrupting the file with your changes, either you are making syntax errors, or making an impossible config.
    I took a quick look at:
    http://www.scriptarchive.com/downloa...t&f=README

    As I interpret what you seek to do, you need to set:

    @referers = ('mytopdomain.com','onelowdomain.com');

    and

    @recipients = &fill_recipients('mytopdomain.com','onelowdoma in.com');


    but the proof will be in the eating :-)

  7. #7
    Junior Member
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    14

    Default

    sunzon, the proof indeed is in the eating, and the pudding is sour!

    After extensive tests, I have verified my diagnosis and am ready to put in a help ticket with WH. All the evidence points to a problem with Site Manager.

    (Before explaining my diagnosis, let me comment on sunzon's last post. What I tried to do originally was to make the exact change sunzon suggests to the @referers array, but that corrupted the file. BTW, I don't believe I need to change @recipients, as long as the recipient is on-site; I anticipate needing to change that later. In any case, that's not the problem.)

    The key to analyzing this problem is in recognizing that I can (and have) replicated the symptoms repeatedly by simply opening and saving the FormMail.pl file WITHOUT MAKING ANY CHANGES -- literally, never touching the keyboard. Whatever is happening is completely hidden to me.

    Every time I tried to change FormMail.pl, I corrupted the file. That led me to the following possible conclusions:
    (1) I'm crazy
    (2) I have a problem with my computer (spyware???) perhaps interfering with a simple edit. (I run Ad-Aware and Spybot S&D, so that's not likely.)
    (3) I have a problem with the particular copy of Site Manager installed on my domain.
    (4) There is a more generalized problem with Site Manager.

    Earlier this evening, I re-installed FormMail on my domain. Then I performed the following steps:
    (a) Ran the form from my computer; verified that it works perfectly, including blank-field checking and redirecting to a specified page after completing the form.
    (b) From a computer 800 miles away (thereby eliminating my ISP and local switches as part of the problem) I had my son open and save FormMail.pl on his computer.
    (c) Tried to run the form again from my computer -- et voila! "Internal Server Error" !!!

    I'm satisfied that eliminates possible conclusions (1) and (2) (Well, I may still be crazy, but for other reasons.) That leaves me with (3) and (4). I find it hard to believe that the problem is unique to my installation (3), as I don't know enough to change anything that would have affected Site Manager. That leaves me with (4), a generalized problem with Site Manager.

    I will put in a help request with WH to see if they can track down the problem.

    In the meantime, I'm curious: has anyone else seen this problem before? Can anyone else replicate this problem from your domain? I'm sure it would help WH if we could demonstrate whether others have the same experience.

    To test, do the following:
    (1) Pick a form that uses Form Mail. Verify that it runs correctly.
    (2) Make a duplicate copy of /cgi-bin/formmail/FormMail.pl (You can't copy directly, so copy up or down one level, rename, and then move the file back.) An alternative is to be willing to re-install FormMail if you happen to corrupt your file.
    (3) Simply open and then save FormMail.pl using Site Manager's editor.
    (4) Run the form again to see if it works correctly, or produces an Internal Server error.
    (5) If you get an error, revert to a good copy of FormMail.pl.

    One other question comes to mind: If indeed there is a problem with the editor on FormMail.pl, does the same problem apply to other perl files? I'm sure it does NOT affect HTML files, as I have used the editor for those hundreds of times.

    Thanks, everyone, for the help.

  8. #8
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Just by opening a file, you are changing it.
    Sounds strange, but its possible that what is known as the 'atime' is changed, and maybe the permissions. Of course, Site Manager shouldn't be changing the permissions, but that is one possibility. Certainly if Site Manager was opening the file and closing it and turning off the executabel bit, then that would cause the problems you are experiencing.

    If I have time later, I'll take a look at one of my sites and see what happens.

    If you know how to log in to the shell (if not, forget it) then you can try this:
    Login to your site
    Run this command:
    ls -al /var/www/cgi-bin/
    Do what you do with the site manager, then run that command again and see if any of the flags for that file have changed.

    Good luck

  9. #9
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Ho yey!

    Can't believe no-one noticed this before. When you open a file to edit it in the FileManager and then save it (even when you make no changes) it saves the file in DOS format!

    This isn't a problem for HTML files, but for a Perl script its a disaster. Definitely a bug so file a report for it.

    For now, if you make changes to a script, then you will probably need to run something like:
    dos2unix FormMail.pl
    from the 'Execute a Shell Command' feature of the File Manager, this will change the format of the file back to Unix and it should work.

  10. #10
    Junior Member
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    14

    Default

    I'm beginning to remember why I hate programming!

    First, thanks jalal for confirming the problem. It may be that no one found it before because they're using better techniques than I am, so they never thought of doing it my way. My technique is to develop and test one small part at a time, writing the code in WordPerfect and then copy/paste to the web site using SM's editor. Then I test it in IE to see if it works. (May be a lousy technique, but it matches the way I think. I keep all three windows open, and things usually move very quickly.) So....it was natural for me to try to edit the .pl file online.

    I admitted in my first post that I don't know perl. I also don't know linux. I've done no real programming in 20 years, and I don't really want to now (I don't count HTML as programming). So I'm taking baby steps to get up to speed--like learning to use dos2unix!!!

    That said, running dos2unix does not seem to be doing anything. My screen blinks, the taskbar shows "done", but nothing appears in the "Results:" area. Is this normal?

    When I look at the directory, the date does not change; more importantly, the form will not run.

    I have tried these variations in the shell command line (all from the /cgi-bin/formmail/ directory:

    dos2unix FormMail.pl
    dos2unix -n FormMail.pl FormMail.plnew
    dos2unix /var/www/cgi-bin/formmail/FormMail.pl

    BTW, the second variation does not create a new file -- or perhaps it puts it in Neverland.

    I really hate to keep asking for help, but I would certainly be grateful if you could suggest something.

Similar Threads

  1. Replies: 10
    Last Post: 07-06-2005, 10:53 AM
  2. "Bad Referer" for form mail
    By rameygifts in forum CGI Scripts / Perl
    Replies: 2
    Last Post: 10-16-2004, 06:34 PM
  3. Error in recipient of form mail
    By rameygifts in forum CGI Scripts / Perl
    Replies: 3
    Last Post: 10-16-2004, 03:06 PM
  4. MojoMail subscription form gives 500 error
    By DylanW in forum E-mail / FTP Management
    Replies: 1
    Last Post: 03-02-2004, 01:31 PM
  5. Mail error 550 5.7.1 "Relaying Denied"
    By summitlake in forum E-mail / FTP Management
    Replies: 15
    Last Post: 10-05-2003, 09:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •