Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

FormMail Brevity

by Reality Theorist (Initiate)
on Jan 12, 2002 at 17:53 UTC ( #138266=perlquestion: print w/ replies, xml ) Need Help??
Reality Theorist has asked for the wisdom of the Perl Monks concerning the following question:

Hi - Newbie question on tweaking scripts here (I've never done it before) While I've used Matt's Script for FormMail-based contact pages numerous times just fine, I now want to use it for a different purpose - to send a text page to my Handspring VisorPhone. I've gotten it working (the PDA receives the message) but there's a 120 character limit to text pages, and so all the garbage that matt's script puts in the message (as well as the default subject WWW Form Submission uses up all the space. I've tried deleting chunks of the file & trying it, but everytime I do the form stops working. I assume I'm doing something wrong :) What chunks do you recommend removing in order to achieve the shortest possible message? I'd prefer to use only two fields' variables: put their name as the from address (is this permissible in send mail?) and then have only their message in the body.

Comment on FormMail Brevity
Re: FormMail Brevity
by Corion (Pope) on Jan 12, 2002 at 18:40 UTC

    You should be aware (and wary) that Matt Wrights scripts, and especially the FormMail script, have many security holes. The FormMail script can be used easily to mail spam in your name all over the world.

    There are replacements that are more secure and that are programmed in a much better style than the scripts by Matt Wright.

    I suggest as a first step that you move over to the NMS scripts as replacements to Matts scripts. As the second step, you should either learn how to use the Perl mail modules from CPAN, as there are Net::SMTP, Mail::Sendmail or other stuff a search or Super Search turns up on "mail" on this site.

    As for your strategy of asking questions, the quality of the answers you get depends directly on the quality of your question. turnsteps home node has many good hints, Are there questions to basic? contains a discussion on how we could approach answers, and (again) Super Search will most likely turn up more hints on how to ask good questions that give you the answers you really need.

    Here are some shallow hints your question should give to the person :

    • The relevant code. Trim this down to the shortest possible code that reproduces the phenomenon, but no shorter. Try to make it that the posted code actually works. The posted code should be similar in form and style to what you actually use.
    • Input you gave to your code
    • Output you got from your code
    • Output you expected from your code
    • Resources you have already contacted about your problem (man pages, books, colleagues, other fora), and subsummation of the answers you got there (if any).

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: FormMail Brevity
by Reality Theorist (Initiate) on Jan 12, 2002 at 20:30 UTC
    thanks for the good tips on Matt Wright stuff (and how to get better assistance on Perl debugging) - I have been using Wright's scripts (mostly the FormMail one) for years and had no idea they weren't secure. I just assumed that since you could limit the referring page addresses to your own domain that no one but me could use the script or my mailserver to send emails.

    I'll see what I can come up with using the NMS FormMail and hopefully cludge through removing the extraneous text in order to send the shortest possible email.

    (BTW if anyone else wants to tell me what chunks of the nms formMail code to remove in order to minimize email length, please do so!)

    Thanks again!

      Update: ignore what I said, I misread the post. No more posting before morning coffee for me :)

      What you need to do is look at lines 424 onwards in FormMail.pl and change the text it prints.

      gav^

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://138266]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-09-21 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls