Subject: SMTP ve sendmail sorunlari...
From: Ertugrul Komut (linux@gul.net.tr)
Date: Fri 17 Sep 1999 - 15:48:47 EET DST
merhaba.
Bir ornek cgi uzerinde calisiyorum...
sistemde slakware 4.0 kurulu
sabit IP li .
CGI bir postcard.. kart gondermesi icin SMTP server ve send mail
ozellikleri gerekiyor...
sendmaili hic kullanmadim nasil oluyor bi;lmiyorum.. CGI da SMTP server
kismina ne yazacagimi bile bilmiyorum :((
asagida cgi i ekte gonderiyorum. uzerinde anladigim kadariyla
degisiklikleri yaptim... CGI a gore SMTP ve send mail ayarlarini nasil
yapacagimi yazarsaniz sevinirim
simdiden tesekkurler..
su an cgi calistirildiginda su hatayi veriyor..
Method Not Allowed
The requested method POST is not allowed for the URL /cards/card.cgi.
Apache/1.3.6 Server at penguen.gul.net.tr Port 80
cevabi ertugrul@gul.net.tr adresine gonderebilirseniz daha iyi olur..
iyi calismalar...
Ertugrul Komut
!/usr/bin/perl
#set the line above this to your perl path. Usually fine as is
# or /usr/local/bin/perl /sbin/perl
# make certain that the first line stays the first line!
##################################################################
# (C)1998-9 Bignosebird.com cardcgi v2.0
# This software is FREEWARE! Do with it as you wish. It is yours
# to share and enjoy. Modify it, improve it, and have fun with it!
# It is distributed strictly as a learning aid and bignosebird.com
# disclaims all warranties- including but not limited to:
# fitness for a particular purpose, merchantability, loss of
# business, harm to your system, etc... ALWAYS BACK UP YOUR
# SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY
# SOURCE!
use Socket;
$|=1;
#### PROGRAM CONFIGURATION SECTION ############################
#
# Modify each item below to meet your needs.
#
# DAYS: number of days to keep cards before purging
# SMTP_SERVER: the name of the system acting as your sendmail gateway
# localhost should work on most systems.
# IF NOT- SET THE SEND_MAIL VARIABLE!
# BASEDIR is the unix directory that your greeting cards will
# be stored in.
# BASEURL is the URL (http address) of the directory your cards
# will be stored in.
# SITEURL is the home page URL for your site.
# SITENAME is the Name of your site, ie Title
# EXT is the ending name for your card files. NEVER, EVER USE shtml!!
# PROGNAME is the URL of THIS script.
# MAILLOG is a file name that you can capture e-mail addresses in
# FOR SECURITY REASONS: RENAME THIS FILE!!!!!!!!
# okaydomains are (if specified, the ONLY domains that the script
# can be run from. If left empty, anyone could run your script,
# but they wouldn't see any graphics!!! If your site answers to
# both www.domain.com and domain.com, then use both!
#
@okaydomains=("http://gul.net.tr", "http://www.gul.net.tr");
$DAYS=11;
# USE EITHER SMTP OR SEND_MAIL DEPENDING ON YOUR SYSTEM-
# BUT NOT BOTH!
$SMTP_SERVER="195.175.68.8";
#$SEND_MAIL="/usr/lib/sendmail -t";
$BASEDIR="/var/lib/apache/htdocs/cards";
$BASEURL="http://195.175.68.8/cards";
$SITEURL="http://195.175.68.8/";
$SITENAME="PostCard";
$EXT=".html";
$PROGNAME="card.cgi";
$MAILLOG="postcardlog";
$SUBJECT ="Size bir Kart var...";
###############################################################
&main_driver;
###############################################################
#
# Now go thru the program looking for the string "BNB SAYS!"
# to locate other changes you should make, such as wording of
# the notification e-mail and "plug" for the site.
#
# to keep things simple, the field names are hard coded in.
# you can of course modify what you wish.
###############################################################
sub thank_you
{
if ($MAILLOG ne "")
{
open (ML,">>$BASEDIR/$MAILLOG");
print ML "$fields{'recip_email'}\n";
print ML "$fields{'sender_email'}\n";
close(ML);
}
print "Content-type: text/html\n\n";
print <<__STOP_OF_THANKS__;
<CENTER>
<H1><B>THANKS!</B></H1>
Your card notification has been sent to $fields{'recip_name'}<BR>
The URL of this card is<P>
<A HREF="$URL_NAME">$URL_NAME</A>
<P>
<B><A HREF=$fields{'parent'}>RETURN TO CARD CREATOR</A></B>
<P>
__STOP_OF_THANKS__
}
# BNB SAYS!
# THIS IS WHERE YOU CAN CUSTOMIZE YOUR NOTIFICATION LETTER
# DO NOT TOUCH THE TWO LINES WITH __STOP_OF_MESSAGE__ ON
# THEM!!!!
sub setup_letter
{
$msgtext =<<__STOP_OF_MESSAGE__;
Hi,
$fields{'sender_name'} stopped by my site, $SITENAME
and created a Virtual Card just for you! To pick up your
card, simply point your browser at the page listed below.
$URL_NAME
The card will remain on the server for about one week, so
please print it out or save it as soon as you can.
__STOP_OF_MESSAGE__
}
# BNB SAYS!
# This is what makes up the body of your card. DO NOT REMOVE OR
# MODIFY THE LINES ABOVE THE WORD $param or the $param line
# itself. Doing so will cause the script to fail.
sub make_body
{
$cardbody =<<__END_OF_CARD_BODY__;
<SCRIPT LANGUAGE="JavaScript">
<!--
if(navigator.userAgent.indexOf("MSIE") != -1)
document.writeln ('');
else
document.writeln ('<EMBED SRC="$BASEURL/$fields{'midifile'}" AUTOSTART="true" HIDDEN="true" VOLUME="80%">');
//-->
</SCRIPT>
<BGSOUND SRC="$BASEURL/$fields{'midifile'}">
$BODYTAG
$params
<CENTER>
<P>
<TABLE WIDTH=580 BGCOLOR=$fields{'back_color'} BORDER=5>
<TR>
<TD>
<TABLE WIDTH=580 BGCOLOR=$fields{'back_color'}>
<TR>
<TD>
<TABLE WIDTH=200 BORDER=4>
<TR>
<TD ALIGN=CENTER VALIGN=CENTER>
<IMG SRC=$BASEURL/$fields{'pic_select'} HEIGHT=250 WIDTH=175 BORDER=0><P>
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH=380 VALIGN=TOP >
<CENTER>
<FONT SIZE=+2 COLOR=$fields{'text_color'}
FACE=ARIAL><B>$fields{'the_title'}</B></FONT>
<HR WIDTH=200>
<TABLE WIDTH=355>
<TR>
<TD><FONT FACE=ARIAL COLOR=$fields{'text_color'}>
$fields{'the_message'}
<P ALIGN=CENTER>
<I>$fields{'sig_line'}
</I>
</P>
</FONT>
</TD>
</TR>
</TABLE>
</CENTER>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<P>
<TABLE WIDTH=500>
<TR>
<TD>
<FONT FACE="ARIAL">
This card was created by
$fields{'sender_name'}
(<I><A HREF=mailto:$fields{'sender_email'}>
$fields{'sender_email'}</A></I>)
expressly for $fields{'recip_name'}. If you would like to
send a card to a person you really care for, just go to
<A HREF=$SITEURL>$SITEURL</A>
and create your own free virtual cards.
</FONT>
<P>
</FONT>
<BLOCKQUOTE>
<I>
<A HREF=$SITEURL>$SITENAME</A>
BNB SAYS! DESCRIBE YOUR SITE HERE!
<I>
</BLOCKQUOTE>
<PRE>
</PRE>
<CENTER>
<FONT FACE="ARIAL" SIZE="-1"><B>
Card Creator Script by<A HREF="http://bignosebird.com"/>BigNoseBird.com</A>
</B><BR>
<I>Everything for the webmaster, for free!
</CENTER>
</TD>
</TR>
</TABLE>
</CENTER>
</BODY>