in reply to Second hack at Secure Mailer

Well, the good news is that you use The bad news is that you don't use it.

You shouldn't scrub the query string directly; let deal with that. In fact, your initial tr/// of the query string completely breaks most requests. Moreover, if you were to add needed characters like [%&?] to your regex, it still would be unsafe, because of the unescaping performed by Now, onto the following line:

$temp =~ s/\.+\///g;

Remember what you've been told regarding code checks for specific hacks. It's never something you should do, and that is what you are doing here. Consider how this expression would perform if given "..\..\" instead of "../../" on an NT platform- you can't possibly check for all the sploits, so don't even try. It would only serve to make your code more complex, buggy, and insecure. Now, moving on to this comment:

#you may now use the CGI methods.
You can always use the methods. is quite secure, and neeedn't launder any raw request data before it gets to see it. Launder the data that you get back from

Also, as a matter of style, you should consider using's functions like print $query->header for some of your code. There's really no need to type alot that stuff out.

               s aamecha.s a..a\u$&owag.print