POP3 Fetching: Bug?

Forum dedicated to Mods for HESK created by Mike Koch

Moderator: mkoch227

Post Reply
FormidableMulk
Posts: 13
Joined: Thu Oct 08, 2015 3:12 pm

POP3 Fetching: Bug?

Post by FormidableMulk »

I've got POP3 fetching configured and enabled. When I execute hesk_pop3.php, the script connects, logs in, gets the mailbox's proper message count, then times out during parsing.

The MySQL ticket insertion is where things are falling apart. MySQL returns the following error:

Code: Select all

Error Code: 1265. Data truncated for column 'html' at row 1
The following PHP notices are raised:

Code: Select all

Notice: Undefined index: latitude in inc\posting_functions.inc.php on line 145
Notice: Undefined index: longitude in inc\posting_functions.inc.php on line 146
Notice: Undefined index: html in inc\posting_functions.inc.php on line 147
Based on the table structure, it looks like MySQL is expecting a zero or a one -- posting_functions.inc.php was passing a blank string, so the record insertion was failing. I changed line 147 from '".hesk_dbEscape($ticket['html'])."' to 1, re-ran hesk_pop3.php, and then received a flood of notifications from the test e-mails (that had previously been scraped).

I'm not sure what the html column's purpose is or I'd attempt to troubleshoot this further. (I'm assuming it's supposed to indicate whether the ticket's message is HTML, but I'd rather not sink any more work into anything until I know for sure.)

Running HESK v2.6.5 & Mods for HESK v2.42...
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: POP3 Fetching: Bug?

Post by mkoch227 »

Yes, there is an issue with pipe_functions.inc.php. I fixed it in the upcoming 2.5.0; however the fix can be applied manually at https://github.com/mkoch227/Mods-for-HE ... 6228b01fae. Only add lines 342, 343, and 344.

The html column is used to indicate whether or not the ticket/reply was created when "rich text for tickets" was enabled. This way, if you have rich text tickets enabled at one point, and then later disable it, tickets will be marked as containing html markup and will be rendered, while others will be rendered as plain text (otherwise HTML messages will have a bunch of markup displayed)
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
FormidableMulk
Posts: 13
Joined: Thu Oct 08, 2015 3:12 pm

Re: POP3 Fetching: Bug?

Post by FormidableMulk »

With those changes, mail is POPped out of the mailbox, but no tickets ever come through.

I changed $html['html'] = 0; to $tmpvar['html'] = 0; to get it up and running again. I'm satisfied with this until v2.5 drops; please don't feel obligated to troubleshoot this any further.

Thanks!


BTW:
The HTML column is a great idea -- I probably would have made the mistake of making that global initially! -- since rich formatting could be toggled off and on at any time. This isn't actually implemented in v2.42 though, right? (We're setting the HTML index to zero; I haven't seen anything in 2.4 that conditionally changes that value to 1.) You're just building towards future support?
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: POP3 Fetching: Bug?

Post by mkoch227 »

Ooh good catch on the $ticket vs $tmpvar. I'll need to fix that before 2.5 goes live :D

The html columns are being used in 2.4.2; however the value will always be 0 for piping right now (I don't believe there's a simple way to detect HTML vs plain text with the current implementation). There are four places the html flag is set for ticket submission and replies (master currently contains 2.4.2):

https://github.com/mkoch227/Mods-for-HE ... t.php#L453
https://github.com/mkoch227/Mods-for-HE ... t.php#L282
https://github.com/mkoch227/Mods-for-HE ... #L214-L222
https://github.com/mkoch227/Mods-for-HE ... #L208-L209
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Post Reply