Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: perl script update

by Don Coyote (Pilgrim)
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028820]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2018-04-26 08:27 GMT
Find Nodes?
    Voting Booth?