Gossamer Forum
Home : General : Perl Programming :

Wwwboard pass to Formmail

Quote Reply
Wwwboard pass to Formmail
I have 4 people that need to be notified by email when ever there is a post to our wwwboard forum. Ideally, the entire post would be passed on to these people. I was thinking Formmail would be good for this but I would need one post to trigger both cgi scripts and I'm not educated enough to do that. Maybe the information can go from one script to the other.

It doesn't have to be particularly fast or fancy, just reliable. If necessary the people can go look at the post but I would prefer all of the information to be sent.

I understand html pretty well but I'm new to perl cgi scripts so please treat me like the dummy I am.

Thanks for anything you can do to help.

Tom
Quote Reply
Re: [Vwman] Wwwboard pass to Formmail In reply to
Hi Tom,

Here's one tip for you: wwwboard and formail are both very well know for being highly insecure, and very poor code. They are old, and weren't good even when they were new, and they're no longer maintained (nor does their author care).

You really should remove them both from your server immediatly as you're running a risk of being hacked by having those on there.

--mark
Quote Reply
Re: [Mark Badolato] Wwwboard pass to Formmail In reply to
I appreciate the thought but those are the best I can do for now due to limitations by the web hosting company.

At least they are in a hard to get to area.

Tom
Quote Reply
Re: [Vwman] Wwwboard pass to Formmail In reply to
Mark is right - spammers have programs that troll the net looking for these two programs (amongst others).

However, if you really need it to work try this:
Code:
1. Add this at the top under #define variables
---------------------------------------------------------------

$mailprog="/usr/sbin/sendmail";



2. Add this at the very bottom of the file *after* the last
closing bracket "}" and pull in the variables you want to print
in your message.
---------------------------------------------------------------

sub send_email {

open (MAIL, "|$mailprog -oi -t") or die;
print MAIL "To:yourname\@yourdomain.com\n";
print MAIL "From:yourname\@yourdomain.com\n";
print MAIL "Subject: New Message Post\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n";
print MAIL "Content-Transfer-Encoding: 7bit\n";

print MAIL qq|

PUT THE FIELDS YOU WANT HERE FROM "SUB NEWFILE"

Date: $date
Subject: $subject


|;
close MAIL;

}



3. Add this to the bottom *before* the last bracket "}" of this
sub: sub new_file
---------------------------------------------------------------

&send_email;

I haven't tested it with wwwboard so you may have to play around with it to make it work properly.

Good Luck!

Ps: This assumes you can use sendmail. Also don't forget to change the username & password in the wwwadmin script from the default. You'd be surprised how many people don't do this. See the wwwadmin readme file for details.
Quote Reply
Re: [Watts] Wwwboard pass to Formmail In reply to
You definitely have me headed in the direction I want to go. Thank you much!

I've got to make some formatting changes and get some data into the message that is sent but it now seems like this will be workable.

One problem though is that one isp passes the message while another blocks it and sends a message saying it contains a virus.

[Outlook 'Blank Folding' Vulnerability] was found in file: [No attachment]

Any idea how to stop that from happening?

Also, wwwboard is in a directory protected by htaccess which seems to be pretty good. That should help keep out the spammers won't it?

Thanks again,

Tom
Quote Reply
Re: [Mark Badolato] Wwwboard pass to Formmail In reply to
I heard a lot about security bugs and poor security of WWWboard, but nobody ever listed a couple of those?

Can you please me direct as what could be the security bugs or holes in using wwwboard.pl?

Thanks.
Quote Reply
Re: [samsara] Wwwboard pass to Formmail In reply to
http://www.google.com/...e=utf-8&oe=utf-8

You'll find quite a few web pages where security bugs have been listed.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Vwman] Wwwboard pass to Formmail In reply to
Have a look at NMS

http://nms-cgi.sourceforge.net
Nora @
www.baytides.ca
Quote Reply
Re: [samsara] Wwwboard pass to Formmail In reply to
Go to google and search. also have a look at insecure.org (Bugtraq)
Quote Reply
Re: [Watts] Wwwboard pass to Formmail In reply to
When I use the method you suggest I can't use \n to start a new line.

If I leave out the lines:

print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n";
print MAIL "Content-Transfer-Encoding: 7bit\n";



then I CAN use \n to start a new line but things like <b>bold</> to make text bold doesn't work. How can I leave those lines in and still be able to start a new line?

Tom
Quote Reply
Re: [Vwman] Wwwboard pass to Formmail In reply to
Use <P> (paragraph tag) or <BR> (line break) to start a new line... those three lines you mentioned allow you to use HTML markup in the body of the email. Or you could leave them out all together and have a text only email.
Quote Reply
Re: [Watts] Wwwboard pass to Formmail In reply to
I hadn't thought of that. I thought i needed a \n.

The next item is, I can't seem to get the syntax right for using more than one email address in the To: field. I'm probably missing a delimiter or tick of some kind.

Thanks. You've been a tremendous help!

Tom
Quote Reply
Re: [Vwman] Wwwboard pass to Formmail In reply to
You could always add the second one as a CC: address. Copy the the "To" line and change To: to CC:. I've had luck using a comma to separate the addresses also.

Print MAIL "To: name\@yourdomain.com, another\@mydomain.com\n";