Antispam caught its first piece of spam on my site today. I also have the module "spam" installed, which has previously caught quite a few. Here's the problem: The order in which modules seem to be activated is this: First spam, then the various notification modules such as comment_notify, then finally antispam. This means that spam caught by antispam still passes through the notification modules and readers get emails telling them of the wonderful new comment on the site - but of course it isn't there, because antispam has correctly unpublished it - but readers still get pestered. Since stopping these spurious email was my main reason for installing antispam modules, that isn't very helpful (it is no great problem to delete spam manually, but stopping pestering of readers is critical, because if they get too many, they will stop following the website).

Is it possible to figure out why module spam can get to the spam before the notification modules, but antispam can not?

Comments

tobias’s picture

Hi rth - have you solved this issue by now? I am now experimenting with antispam and am hoping not to have this behavior.

-T

rhouse’s picture

Hi Tobias - no, I haven't a clue how to fix it, and the maintainers don't seem to care.

pixture’s picture

If it's a matter of the order of the module execution, you can change the weight of the AntiSpam module using Utility module.

http://drupal.org/project/utility

AntiSpam uses hook_comment_submit() and hook_node_submit() function to intercept the comment and node submission. If Spam module and other module uses the same hook functions, then the weight of the module determines which module's hook function to be called first. Thus, you can make AntiSpam act before other modules with the same feature. I hope this will handle your issue.

hingo’s picture

You wanted to link to
http://drupal.org/project/util

Thanks for the tip, will try it out.

hingo’s picture

I can set the weight, but I still seem to get comment notifications for new comments that are classed as spam.

Setting the weight shouldn't be necessary anyway, since Comment_notify has a weight of 10, so it should be processed last already. (Antispam has weight 0.) Also Comment_notify does check that the comment is published, ie it does not just blindly send email on every $op == 'insert'.

So what else could be wrong?

daveeddydotcom’s picture

Has anyone found a solution to this yet? I have installed util and changed the weight of anti-spam to 0 and comment-notify to 20 and it still alerts my via comment notify that i have a new comment, even though it has been marked as spam.

MrGeek’s picture

Same problem here.

daveeddydotcom’s picture

i still haven't found a solution for this... anybody?

augiem’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta2

This node comment #3 seems to have somewhat useful info on this problem.
The problem for me was in the notification module (in my case Comment Notify), not the AntiSpam module.

I took his patch and slightly modified it to work with 6.x-1.4 version of Comment Notify. It doesn't send the email notifications until hook_exit(), and before it sends an email, it checks the comment in the database to make sure its's published.

[edit: Reference should have been comment #3, not #4]

kmonty’s picture

Same problem, sub

The link in #9 isn't useful. Maybe it was the wrong issue linked to by accident?

kmonty’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
augiem’s picture

@ #10:
Issue was not linked by accident, but I did reference the wrong comment. Should be #3, not #4.
The concept was to patch Comment Notify to not send emails until hook_exit(). AntiSpam will have already run and flagged spam emails, then on _exit() you check if the comment is published/unpublished before sending a notification.

I made a patch for Comment Notify, but this probably isn't the proper place to post it. Plus the maintainer of Comment Notify doesn't want to use the hook_exit() method, but it worked for me and I have no more spam notifications at all.

greggles’s picture

Title: Antispam "gets" the spam too late » Give Antispam a lower weight in the system table (for better integration with other modules)
Version: 6.x-1.0-beta2 » 6.x-1.x-dev

I think it would be a good idea to set Antispam to a weight of -1 if possible.
Docs on how at: http://drupal.org/node/110238

apaderno’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes