Any chance something could be added to comment_notify to see if the comment is unpublished by the Akismet spam module? Right now, I have anonymous users capable of commenting without moderation. Akismet catches 99% of the spam but when a spammer posts the comment, comment_notify is emailing me that there is a new comment and then Akismet unpublishes the comment. Thus, when one follows the link in the email, it isn't there. Ideally, if comment_notify can somehow wait until after Akismet approves or unpublishes the comment and then sends the notification if it passes the spam test - all would be wonderful. Thanks.
Comment | File | Size | Author |
---|---|---|---|
#18 | comment_notify-use_hook_exit-209641-18.patch | 2.28 KB | Mojah |
#15 | comment_notify_atexit_2.patch | 1.34 KB | detly |
#3 | comment_notify_atexit.patch | 1.4 KB | Leonth |
Comments
Comment #1
gregglesSeems reasonably. I personally won't work on it but I guess it could help.
Comment #2
Leonth CreditAttribution: Leonth commentedTheoretically, this should be doable by adding something like this to function _comment_notify_mailalert:
I am trying this in a live website to see what happens.
Also, fixing this issue will also fix #229843: Getting emails about spam comments.
Comment #3
Leonth CreditAttribution: Leonth commentedNope, that one won't do. I recalled the method used for pingback.module and trackback.module. It turns out that you need to postpone the sending of emails to hook_exit(), because then every module work, including spam, akismet etc. would have been finished. I now use this patch, but I don't really know about the reliability.
Comment #4
Leonth CreditAttribution: Leonth commentedI tested this on http://leon.info.tm and it works wonders. Spams do not trigger notifications when this patch is applied. See if somebody else can confirm this.
Comment #5
dennys CreditAttribution: dennys commentedI upgrade comment_notify to 1.6, it still works. Do you consider to merge this patch into core?
Comment #6
gregglesThe patch has a ton of debugging code left in it which should be cleaned up prior to it being committed.
Also, I believe that this module already uses the unofficial "publish" hook from a modified core to make sure it is not sending out "spam" messages. Can someone explain why this use of globals (which is not great, IMO, though often necessary) will fix that in a way that the current functioning can't?
Comment #7
Leonth CreditAttribution: Leonth commentedYep, this is the confusing part of the module. Actually I don't really understand why this module needs the "publish" hook, because trackback, pingback, spam modules etc. can work around the limitation using the above method.
I also don't understand why the publish hook doesn't work. My theory is that the akismet hooks get executed *after* the publish hook, so the notifications are sent *before* it is flagged as spam (and unpublished).
Comment #8
gregglesWell, #229843: Getting emails about spam comments is now marked as closed because Spam module has changed to better support things like this.
Given that it's been many weeks without an update to the code, and that there are alternatives (spam module, captcha, mollom) which work reasonably well, and that I don't like this solution much I'm marking this won't fix.
Comment #9
gregglesUm, I meant that #265205: Spam ruining comment notify is now marked as closed because...
Comment #10
kmontyConsidering that the AntiSpam module is growing in usage and is the best way to integrate Akismet into Drupal, I would like to propose reopening this issue (or potentially discuss how to fix the issue with AntiSpam).
A user suggested some success using the hook_exit approach mentioned in #3, but I know you didn't like that solution 2 years ago.
I'd be willing to work on this issue, but I don't want to invest any time unless the maintainer is willing.
related issue: #598772: Give Antispam a lower weight in the system table (for better integration with other modules)
Comment #11
gregglesAs far as I know, the Spam and Mollom modules prevent spam going out via comment notify. Couldn't the AntiSpam module do something similar?
Comment #12
gregglesTo be more clear, I would be willing to change Comment Notify to make it easier to integrate the AntiSpam module as long as the changes are not drastic and are not specific to AntiSpam module.
i.e. if we need to provide more hooks in comment_notify that's fine by me.
Comment #13
MrGeek CreditAttribution: MrGeek commentedi 2nd (or 3rd or 4th?) getting this fixed/resolved - having the same issue with using Comment Notify and the AntiSpam module..
Comment #14
gregglesMarking postponed until someone has a clear plan for how to fix this.
The answer may be in the AntiSpam module.
Comment #15
detly CreditAttribution: detly commentedRe #4 (Leonth's patch). Tried it on 6.x-1.5. I had to manually patch things, and I've attached my alterations. But it didn't seem to work — my test anonymous subscriber still got an email notification of my test spam (despite it being marked as such).
Comment #16
detly CreditAttribution: detly commentedI switched to Mollom, which works at least as well as AntiSpam, and doesn't have this problem (even if spam gets through).
Comment #17
gregglesI appreciate the effort here, but 3 years after the issue started we don't have a working patch and there are other solutions.
I believe comment_notify now has more support for comments being unpublished and then published which should make it possible for antispam to be effective with zero changes to comment_notify, so I'm marking this won't fix.
Comment #18
Mojah CreditAttribution: Mojah commentedI'm testing the attached patch on a live site and so far everything appears to be working fine. There are no notifications being sent for spam/unpublished comments.
The issue could be related to this: http://drupal.org/node/1388082 as comment_notify uses the the comment hook. The patch uses hook_exit, similar to #15. With this patch, comment_notify works with the antispam module.
Comment #19
gregglesOK, on further review this seems like it makes sense for perceived performance and for the potential for better integration with other modules.
I would like this to be done in 7.x-1.x first and then backported, so marking needs work and assigning to that branch for now.
Comment #20
HongPong CreditAttribution: HongPong commentedon the Mollom side of this issue I am putting a few notes on a bug thread together here: #1708536: Control over mollom notify triggering upon Mollom comment approval