Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Links don't send email problem - please help

Quote Reply
Links don't send email problem - please help
I have been using Links v2.0 (using templates) for a while and yesterday I just uploaded a new design. Everything works fine except that it doesn't send any notifications email to me or to new link submitters. I didn't make any change with the links.cfg file so all the sendmail settings were set properly:
$db_mail_path = '/var/qmail/bin/qmail-inject';
$db_smtp_server = '';
$db_email_add = 1;
$db_email_modify = 0;

If I used the Email Newsletter feature from the admin interface, it worked fine. It just does't send the new link, added link or deleted link notification emails anymore.

Could you please give me any direction of where to look for to fix it?

Many thanks in advance,

Edy Budiman

Quote Reply
Re: Links don't send email problem - please help In reply to
Did you edit the add.cgi script?

Do you still have a sub send_email routine in the add.cgi script? This subroutine is used to send email to the administrator when a link is submitted.

Regards,

Eliot Lee
Quote Reply
Re: Links don't send email problem - please help In reply to
Hi Eliot,

Thanks for the reply.
No, I didn't edit the add.cgi file and it still has the send_mail function inside as I paste it below.
The problem not only Links doesn't send me any notification email about newly submitted links but it also doesn't send emails to the link submitters when their links are approved/rejected.

If you need to take a look at the scripts directly, please give me your email address and I'll send you all the links.cfg and perl/cgi files.

Thanks again,
Edy Budiman

sub send_email {
# --------------------------------------------------------
# Sends an email to the admin, letting him know that there is
# a new link waiting to be validated. No error checking as we don't
# want users to see the informative &cgierr output.

# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");

my $to = $db_admin_email;
my $from = $in{$db_cols[$db_contact_email]};
my $subject = "Addition to Free Wallpapers Listing: $in{'Title'}\n";
my $msg = qq|
The following link is awaiting validation:

Title: $in{'Title'}
URL: $in{'URL'}
Category: $in{'Category'}
Alt Categories: $in{'AltCategories'}
Description: $in{'Description'}
Contact Name: $in{'Contact Name'}
Contact Email: $in{'Contact Email'}

Remote Host: $ENV{'REMOTE_HOST'}
Referer: $ENV{'HTTP_REFERER'}

To validate, please go to:
$db_script_url

Sincerely,

Links Manager.
|;

# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;
}

Quote Reply
Re: Links don't send email problem - please help In reply to
Have you changed the NAME of the Contact Email field? Have you edited links.def at all?

Regards,

Eliot Lee
Quote Reply
Re: Links don't send email problem - please help In reply to
Hi again Eliot,

No, I didn't change the links.def file at all during the last update. I only updated the html templates and I made sure that all the 'Contact Email' fields were remain intact.

Here's the links.def file...

# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
AltCategories => [5, 'alpha', 0, 500, 0, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [7, 'alpha', 40, 75, 0, '', ''],
'Contact Email' => [8, 'alpha', 40, 75, 0, '', '.+@.+\..+'],
Hits => [9, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [10, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [11, 'alpha', 0, 5, 0, 'No', ''],
Rating => [12, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [13, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [14, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],

Priority => [15, 'alpha', 0, 5, 1, 'No', 'No|Yes'],
Graphic => [16, 'alpha', 40, 75, 0, '', ''],
Gwidth => [17, 'alpha', 5, 5, 0, '', ''],
Gheight => [18, 'alpha', 5, 5, 0, '', '']
);


Quote Reply
Re: Links don't send email problem - please help In reply to
Check the add.html file. Make sure that you have process_form for the SUBMIT button.

EXAMPLE:

Code:

<input type="submit" name="process_form" value="Add Record">


Regards,

Eliot Lee
Quote Reply
Re: Links don't send email problem - please help In reply to
I applied the duplicate check mode on the add.html file:
<input type="SUBMIT" name="add_record" value="Submit Site">

Strangely, the problem has been fixed now although I didn't do anything yet. I got all the notification emails today and when I tested it again, the email sending worked fine. Very strange indeed but I'm glad it's been fixed. Do you have any good explanation about it?

Thanks again for your time and patiences.

Edy Budiman

Quote Reply
Re: Links don't send email problem - please help In reply to
Code:

<input type="SUBMIT" name="add_record" value="Submit Site">


This is USED in DBMAN NOT Links 2.0! Don't confuse applications! Wink

Regards,

Eliot Lee
Quote Reply
Re: Links don't send email problem - please help In reply to
No, I didn't.
I applied the Mod: Automatic Duplicate URL Check - Version 1.02 by Gerrit Jahn and the instruction told me to change that input tag.