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

Re: perl script update

by Don Coyote (Monk)
on Apr 16, 2013 at 06:44 UTC ( #1028820=note: print w/ replies, xml ) Need Help??


in reply to perl script update

Hello woody2010 and welcome to the monastery.

A quick sanity check on a ten year old script is your best starting point, you will have a better understanding of perl now, and will more easily be able to spot errors preventing successful transmission.

$mo = "$mo <option value=\"$name_email{$key}\"> $key < +/option> \n"; # my $mo ?

Will have flagged straight away with the use warnings & use strict pragmas.

open(MAIL, "|usr/bin/sendmail") ||&staus('update status message');

Does not exit gracefully on failure. What the code appears to do is update the status message to 'could not send' and then continue to attempt to send the message, returning a succesfully sent headed page to the user with a message declaring the message 'could not send'.

A further and probably the most important sanity check would be to run the script in Taint mode.

#!usr/bin/perl -T

The pipe open on 'user submitted'(?) email addresses, re where does $mo originate from? Is a priority concern.

Taint mode will hold the fort for you, while you convert this into a fork(exec sendmail) routine.

Form action should generally be post rather than get, $mo again.

It would not be inconceivable that a savvy hacker could supply their own list for $cgi->param('t'), resulting in spam reports on emails from your domain, leading to your domain being blocked.

So a number of things to look at really, try those. When the script is operating properly, you may better be able to identify the cause of the problem.


Comment on Re: perl script update
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2014-07-28 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (189 votes), past polls