Email notifications has wrong history id's (at the end)

benoit's Avatar

benoit

19 Aug, 2018 03:14 AM

Hello I noticed something when I tried using the IMAP incoming email to be able to respond to comments on issues. I know you are using a preg_match to extract id, issue_id and user_id from the email and then check against the history table for that data.

Then only problem is if someone enters a comment other than me, I get an email and at the end of the email, its the correct user id, correct issue id, but the ID is wrong.

Here is an example to better explain myself :

I am user id 1, and issue id 250.
I have another user user id 6

User ID 6 enters a comment, I get an email notification.
In that email I get the current data : [868:250:1]
The problem is that 868 id in history table refers to user id 6.

So then the fetching of mail comments simply do not work.

Thanks

  1. 1 Posted by benoit on 19 Aug, 2018 03:20 AM

    benoit's Avatar

    Basically by commenting out line 56 of the fetch-mail.php in the cli folder, it enters the comment by mail correctly simply since the DB call returns zero data, so the script will never go further than line 56

  2. 2 Posted by richr on 22 Aug, 2018 12:53 PM

    richr's Avatar

    Nice find .. and fix (though i dont use email fetching)
    You mean you comment out this line:
        if (is_array($result) && count($result) > 0) {

    My version 1.9.1, shows this as line 56.

  3. 3 Posted by benoit on 22 Aug, 2018 01:59 PM

    benoit's Avatar

    Yes exactly, because the $result is always 0, the email comment is never entered in the DB.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac