in reply to Re: CGI Contact Form / Mailer
in thread CGI Contact Form / Mailer
The rest is and should be all configured via internal .conf files, further minimizing any outside tampering with the script. Additional security measure could be to taint check the rest of 'information' fields that are being sent along with the email.my $mf = $cgi->param('_mf_'); $mf =~ s/\.\/\\//g; # remove . \ / chars $mf ||= "default";
You are right on the other items though, and I admit script needs alittle rework around potential security holes.# smtp server SMTP_HOST=mail.yourhost SMTP_PORT=110 SMTP_TIMEOUT=60 # name form imputs which are lists (comma separated) # FORM_INPUT_LISTS= # recipient email RECIPIENT=myemail@myhost.com # sender field required REQUIRE_SENDER=no # sender field (from html form) SENDER_FIELD=EMAIL # subject (could contain html::template variables!) SUBJECT=Contact From <TMPL_VAR NAME>, <TMPL_VAR COMPANY> # mail template (to the recipient) MAIL_TMPL=mail #------------- CONFIRM ------------ # sender template (optional) # mail to be sent to the sender CONFIRM_MAIL_TMPL=mail_confirm # subject of the confirmation email CONFIRM_SUBJECT=Thank you for your interest in ... # CONFIRM_REPLYTO=mycontact@myhost.com #------------- OK ----------------- # redirect when mail was sent ok # REDIRECT_OK=/thankyou.shtml # template to use on successful send # (overrides redirect_ok) # # TMPL_OK=<template path> #------------- FAIL --------------- # redirect when couldn't send mail and other non system errors # # REDIRECT_FAIL=<url path> # template to use on failure # (overrides redirect_fail) # TMPL_FAIL=fail #----------- USER ERROR ----------- # template for usage error page # TMPL_USER_ERROR=user_error # redirect url on user (usage) error # (user_error_tmpl will be ignored) # # REDIRECT_USER_ERROR=<url path>
Robert Wilensky, University of California
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CGI Contact Form / Mailer
by merlyn (Sage) on Feb 14, 2006 at 13:38 UTC |