Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Sendmail problem with Perl/CGI 'Link Tracker' script?
Old 12-16-2005, 07:30 AM Sendmail problem with Perl/CGI 'Link Tracker' script?
Novice Talker

Posts: 5
Trades: 0
Hi

Basically this purchased (no support from seller) script adds to a log every time a external web link is clicked from within my site and it is meant to send an email to the owner of that web link.
The logging part works ok, but I cannot get it to send out the email.
There is an admin page where the links and their corresponding email addresses are entered.
There are a number of files that make up the script and there live in a folder called tracker within the cgi-bin.
I've checked with my remote web hosting company and they tell me my sendmail address has to be linked to one of my email accounts for security, so I end up with this as some of the lines in the config.pl file -
Code:
$mailprog = qq|/usr/sbin/sendmail -fwebmaster@mydomainname.com|;
$myemail = qq|webmaster\@mydomainname.com|;
The code below is the last bit of code in the tracker.cgi file and I think it refers to the sendmail of the clicked links part?

Code:
my @pre = map { [$_, split /\|/ ] } @users2;
my @post = sort custom @pre;
@users2 = map { $_->[0] } @post;
@users2=reverse(@users2);
sub custom {
$a->[3] <=> $b->[3];
}
}
sub emailsite
{
$checkemail=$_[0];
$checkemail=~s!^www\.!!i;
open (FILE2,"<email_list") || print "cannot open file";
flock(FILE2, 2) ;
@emails = <FILE2>;
flock(FILE2, 8) ;
close (FILE2);
foreach $emails(@emails)
{
chomp $emails;
($site,$siteemail)=split(/\|/,$emails);
if ($refurl ne "no referrer information")
{$theref = "The link was clicked from: $refurl";}
if ($site eq $checkemail)
        {
        open (MAIL,"|$mailprog -t") || print "";
        print MAIL "To: $siteemail\n";
        print MAIL "From: $myemail\n";
        print MAIL "Subject: $subject\n\n";
        print MAIL "$body\n\n";
        print MAIL "Link clicked: http://$checkemail\n";
        print MAIL $theref;
        print MAIL "\n\n";
        close (MAIL);
        }
}
}
If anyone could shine any light to what could be the problem, it would be very much appreciated, as I've been trying to get this to work for a couple of weeks now and it's driving me crazy!

Many thanks, Happy100.
happy100 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-20-2005, 09:43 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Has it worked in the past?
Has sendmail been updated recently?
Has sendmail now started using sasl for security? I.E do you need to log into your mail system to send aswell as receive emails?

The code looks fine I can only think its a sendmail issue.

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 12-21-2005, 12:19 PM
Novice Talker

Posts: 5
Trades: 0
Hi ibbo

I assume the script has worked in the past, as I paid for the script, but I have never used the emailing bit until now.
I'm not aware that my remote web hosting company (RWHC) has updated their sendmail.
I have been told my my RWHC in the last couple of days, that I do need to have -
/usr/sbin/sendmail -fwebmaster\@mydomainname.com as the sendmail address, ie. linked to one of my email accounts.
But still no joy!

Seems a strange one?

Cheers, Happy100.
happy100 is offline
Reply With Quote
View Public Profile
 
Old 12-30-2005, 01:54 PM
Giselle's Avatar
"Happy Trails"

Posts: 9,989
Name: Giselle
Location: Washington State
Trades: 0
Happy100 did you ever straighten out the sendmail issue?

A few years back I had some problems myself with implementing a perl script, my hosting company helped me out as to how to set it up. Plus they sent through email specific instructions which I had saved, basically any perl script I want to implement would be setup the same way. I would suggest going back to the hoster company and ask for help.

Happy New Year,
Giselle
Giselle is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sendmail problem with Perl/CGI 'Link Tracker' script?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.67717 seconds with 12 queries