[Bug] E-mail Notifications Not Sending

Started by Yonkey, February 24, 2006, 10:10:00 AM

Previous topic - Next topic

Yonkey

I've noticed this bug for a while, but couldn't figure out what was causing it.  Some of my e-mail notifications would send, some would send for a while, but then stop, and others were perfectly fine.

I checked the database, and it turns out there are a lot of topics that have the "sent" column in the log_notify table as 1 and will not change back to 0.  I tried visiting the topic and going to its last page, manually going to  index.php?topic=<topicID>.new;topicseen#new and even marking all topics as read, but still the "sent" value remains at 1.

Shouldn't this value get set back to 0 when you visit that topic, or at least when you click Mark as Read?

Oh, I forgot to mention I'm using SMF 1.1 RC2. :P

Sting

keeping with the mail bug I get this when I try to send an email, but as far as I know noone else does... I mean I received and pm then tried to send a reply and it game me this:

mail() has been disabled for security reasons
File: /home/stingah/public_html/xfactor/Sources/Subs-Post.php
Line: 377


SMF 1.0.6.

Thnx in advance for the help.

Yonkey

That sounds more like your host has disabled php's mail function and wants you to use SMTP instead.  You could try contacting your host and ask them to enable it.

Getting back to the thing I said in the first post, I may have found the bug:

In Sources/Display.php there is the following code:


// Check for notifications on this topic OR board.
$request = db_query("
SELECT sent, ID_TOPIC
FROM
{$db_prefix}log_notify
WHERE (ID_TOPIC =
$topic OR ID_BOARD = $board)
AND ID_MEMBER =
$ID_MEMBER
LIMIT 2"
, __FILE__, __LINE__);
$do_once = true;
while ($row = mysql_fetch_assoc($request))
{
// Find if this topic is marked for notification...
if (!empty($row['ID_TOPIC']))
$context['is_marked_notify'] = true;

// Only do this once, but mark the notifications as "not sent yet" for next time.
if (!empty($row['sent']) && $do_once)
{
db_query("
UPDATE
{$db_prefix}log_notify
SET sent = 0
WHERE (ID_TOPIC =
$topic OR ID_BOARD = $board)
AND ID_MEMBER =
$ID_MEMBER
LIMIT 1"
, __FILE__, __LINE__);
$do_once = false;
}
}


Basically, it checks to see if someone requested notification on a board, or notification on that topic.  But what happens if they requested notification on both the board and that topic?  The UPDATE query only affects one row due to the LIMIT 1, rather than 2.

Can an SMF developer please verify that this is causing the notification problem?

Thanks!

friesengeist

Quote from: Yonkey on February 25, 2006, 03:40:36 PM
Basically, it checks to see if someone requested notification on a board, or notification on that topic.  But what happens if they requested notification on both the board and that topic?  The UPDATE query only affects one row due to the LIMIT 1, rather than 2.

Can an SMF developer please verify that this is causing the notification problem?

I'm not a SMF developer, but still I can verify that this is causing the notification problem and that your patch fixes this bug. Actually, I just spend hours to work it out, and after finding it I did a search here on the forum, just to find out that Yonkey already found it ;)

I hope this will be fixed in RC3 :)

Just as a cross reference: http://www.simplemachines.org/community/index.php?topic=77081.new#new
We may not be able to control the wind, but we can always adjust our sails.

ThomasJ

Reported to the dev team, and should make it into RC3. From what i can tell it does indeed solve the problem.
Whoops! Did i break that?

friesengeist

We may not be able to control the wind, but we can always adjust our sails.

Rupert Hawkes

Hi Dev team, did this make it into rc3, seems not :-(

Advertisement: