#!/usr/bin/perl -w $| = 1; # mail to tkowale@ (2006) # blad w 107 ???? 30.12.03 # VER 10.05.2002 # ---------------------------------------------------- # Author: Robert Trzaskowski / e-mail: kenzo_@gmx.de # Mobile: +48 609 487 674 / Date: 16 August 2001 # ---------------------------------------------------- if (1 == 1) { $skrypt = "http://fluid.ippt.gov.pl/ictam04/cgibin/mailer.cgi"; } else { $skrypt = "http://localhost/~ictam04/cgi-bin/mailer.cgi"; } $ENV{PATH} = ""; $from = ""; $subject = ""; $msg = ""; $fromcolor = ""; $subjectcolor = ""; $msgcolor = ""; unless ($ENV{'CONTENT_LENGTH'}) { &strona(); } else { &program(); } exit; sub strona { print ("Content-Type: text/html\n\n"); print ("ICTAM 2004 database mailer...\n"); print ("\n"); print ("

Mail ICTAM 2004

\n"); print ("

Please give e-mail address, subject and content of your message.

"); print ("\n"); print ("\n"); print ("\n"); print ("\n"); print ("\n"); print ("\n"); print ("\n"); print ("
From:
To:ictam04\@ippt.gov.pl
Subject:
Your message: 
   


\n"); exit; } sub program { read(STDIN, $wejscie, $ENV{'CONTENT_LENGTH'}); @pola = split(/&/, $wejscie); foreach $pole (@pola) { ($nazwa, $wartosc) = split(/=/, $pole); $nazwa =~ tr/+/ /; $nazwa =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $wartosc =~ tr/+/ /; $wartosc =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$nazwa} = $wartosc; } $msg = $FORM{'msg'}; $subject = $FORM{'subject'}; $from = $FORM{'from'}; # $to = "ictam04\@ippt.gov.pl"; $to = "tkowale\@ippt.gov.pl"; $fields_ok = 0; if ($from eq "" || $from !~ /^[\w\-\.]{1,}\@([\da-zA-Z\-]{1,}\.){1,}[\da-zA-Z\-]{2,3}$/) { $fromcolor = "err"; $fields_ok++; } if ($subject eq "") { $subjectcolor = "err"; $fields_ok++; } if ($msg eq "") { $msgcolor = "err"; $fields_ok++; } &strona() unless ($fields_ok == 0); &wyslij(); exit; } sub wyslij { print ("Content-Type: text/html\n\n"); print ("ICTAM 2004 mailer...\n"); print ("\n"); print ("

ICTAM 2004 mailer...

\n"); print ("

System will send your email message to $to..."); open(SENDMAIL, "| /usr/sbin/sendmail -oi -oem -f\"$from\" -t") || die ("Otwieram /usr/sbin/sendmail: $!"); print SENDMAIL ("To: $to\n"); print SENDMAIL ("Subject: $subject\n"); print SENDMAIL ("$msg\n"); close(SENDMAIL) || die ("Zamykam /usr/sbin/sendmail: $!"); print (" sent by $from\.
Warning! "); print ("If your email addrress $from is wrong this email will be rejected!!! \n

Come back to our homepage"); }