Getting formmail to work

skiptrace

New member
Joined
Aug 24, 2004
Messages
1
Location
Santa Clara, CA
Hi everyone,

I have what is probably a simple, easy question. I'm trying to get a formmail script to work (for a tryout signup form, just a couple fields) and although I can do other things coding-wise, I have never tackled Perl Scripts or forms. Can somebody guide me in the right direction? The file is Formmail from www.scriptarchive.com. My questions start below:

-- It instructs me to copy the file into the cgi-bin, which I did. Then I open it in EDIT mode.

--So in the script file, it instructs me to define the $mailprog definition to my sendmail folder, and then gives an example as [$mailprog = '/usr/lib/sendmail -i -t';]; brackets are my own addition. Now, I assume since there's no # before the beginning that this actually sets a mail file location? But where do I find this information out? And can I set this to another email service, not the one associated (Sqirrelmail or Yahoo or something)?

--The next line talks about referrers and then shows [@referers = ('xs-gaming.com','209.123.181.73');]. I changed this from the default in the file already, although I'm not sure this is the right location? But I assume. Heh. *AHEM*

--So anyways, the next line says [@recipients = &fill_recipients(@referers);]. I assume this means [[email protected]]? It tells me in the readme file attached that this VERY, VERY important. But then it tells me to leave it alone unless I get an error code, then calls it an array? Then says anybody can use this script unless I specify domains/sub.domains/exact addresses? My god.

I suspect I'm making a mountain out of a molehill. Any help or a slap in the face would be appreciated. Well, scratch the latter.

Thanks!
 
# in front of a line mean they are comments and do not affect the configuration. So yes, since there is no # it is does take affect.

--So in the script file, it instructs me to define the $mailprog definition to my sendmail folder, and then gives an example as [$mailprog = '/usr/lib/sendmail -i -t';]; brackets are my own addition. Now, I assume since there's no # before the beginning that this actually sets a mail file location? But where do I find this information out? And can I set this to another email service, not the one associated (Sqirrelmail or Yahoo or something)?

No. Exim is the email system DA uses. So set the variable to "/usr/sbin/exim" (no quotes ;) )

--The next line talks about referrers and then shows [@referers = ('xs-gaming.com','209.123.181.73');]. I changed this from the default in the file already, although I'm not sure this is the right location? But I assume. Heh. *AHEM*

Yes it is VERY Important. If you don't set this, as the comments say. ANYONE on ANY server can use your server and this script to send their mail which is very bad indeed.
So you will want to set it to the domain you will be using and your server ip address to keep this from happening.

--So anyways, the next line says [@recipients = &fill_recipients(@referers);]. I assume this means [[email protected]]? It tells me in the readme file attached that this VERY, VERY important. But then it tells me to leave it alone unless I get an error code, then calls it an array? Then says anybody can use this script unless I specify domains/sub.domains/exact addresses? My god.

Read the documentation it says ;) A quick overview though. But basically you make @recipients all the email addresses that this script can send mail to. This is to protect against spamming.
 
The version of FormMail.pl on Matt's script site is still hackable, and if you use it you'll eventually be very sorry.

I strongly suggest the one we keep available

here.

However the instructions are different; be sure to read the readme files included.

And I'll disagree with jmstacey about having to change the "sendmail" line to exim; you shouldn't; exim handles that for you transparently.

Jeff
 
Back
Top