View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05079 | Bug reports | Survey participants (Tokens) | public | 2011-04-04 09:42 | 2011-04-11 11:34 |
Reporter | peterhol | Assigned To | |||
Priority | normal | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.91RC5 | ||||
Fixed in Version | 1.91RC6 | ||||
Summary | 05079: Bounce emails aren't registered/error messages | ||||
Description | Bounce emails aren't registered. Sometimes when I "process bounce emails" I receive error messages (IMAP header errors, mostly referring to tokens.php I think... but am not totally sure – as they generally only appear once... after that it only says "0 messages scanned, none marked as bounces by the system"... even though I can see in the email account used for bounce emails that there are many bounces – unread emails – if that makes any difference... | ||||
Steps To Reproduce |
| ||||
Additional Information | I'm not a big bug reporter, and don't know if the information I've supplied is sufficient... but I'll be happy to provide additional information/testing – contact me on peter@holme.se. | ||||
Tags | No tags attached. | ||||
Attached Files | patch.txt (936 bytes)
Index: tokens.php =================================================================== --- tokens.php (revision 9877) +++ tokens.php (working copy) @@ -304,6 +304,9 @@ $datelcu = strtotime($lasthinfo->date); $datelastbounce= $datelcu; $lastbounce = $thissurvey['bouncetime']; + $earliestinfo=imap_headerinfo($mbox,1); + $earliestdate=strtotime($earliestinfo->date); + if($lastbounce<$earliestdate) $lastbounce=$earliestdate; while($datelcu > $lastbounce) { $header = explode("\r\n", imap_body($mbox,$count,FT_PEEK)); // Don't put read @@ -334,8 +337,8 @@ $datelc=$lasthinfo->date; $datelcu = strtotime($datelc); $checktotal++; - imap_close($mbox); } + imap_close($mbox); $entertimestamp = "update ".db_table_name("surveys")." set bouncetime='$datelastbounce' where sid='$surveyid'"; $executetimestamp = $connect->Execute($entertimestamp); if($bouncetotal>0) | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 9877 | ||||
I will donate to the project if issue is resolved | Yes | ||||
Browser | chrome/safari/firefox on a mac | ||||
Database type & version | mysql 5.0.91, 145 | ||||
Server OS (if known) | linux | ||||
Webserver software & version (if known) | Apache/2.2.17 | ||||
PHP Version | 5.2.16 | ||||
Here are the errors I talked about from error.log... these are given sometimes even when I use POP... [04-Apr-2011 02:12:08] PHP Warning: imap_body(): 41 is not a valid imap resource in /home/xyz/public_html_lime/admin/tokens.php on line 309 |
|
hmm... I messed around a bit with said lines in tokens.php, and changed the occurances of |
|
btw.. for testing purposes, I also changed line 306 from |
|
ok.. another way to get the tokens marked as bounced, was to move line 337 down two lines.. so it is outside the loop.. then all the messages are checked ( i think) – and I only get this error message: Warning: imap_headerinfo() [function.imap-headerinfo]: Bad message number in /home/xyz/public_html_lime/admin/tokens.php on line 333 |
|
Hey peterhol, Thanks for bringing it to our notice. The warning messages have been suppressed, and now should not show up. Your last workaround is correct , I mean bringing the imap_close two lines below so that it is out of the while loop and hence not closing the connection before checking all the mails correctly is correct and hence have been changed and committed. Thanks |
|
goody ;) but i still get this other error message the first time I check for bounces: Warning: imap_headerinfo() [function.imap-headerinfo]: Bad message number in /home/dinamome/public_html_lime/admin/tokens.php on line 333 I've checked it and it appears when $lastbounce is set to a time older than the oldest mail in INBOX! (I assume the first time it is run, $lastbounce = 0;. So... I tried setting $lastbounce (in line 306) to the following timestamps, and got the following results: |
|
basically … I think the loop runs one time too many when $lastbounce is less than the earliest timestamp in INBOX... possibly... |
|
OK I think I got it :) I added these lines after line 306:
and no more error message :) |
|
patch added :) The only thing is that I don't think this takes into account what happens if INBOX is empty... |
|
Hey Peterhol, Again thanks for reporting this. The actual problem is not the time variable, but the fact that the count variable will go zero if there are no messages in the inbox then throws the bad variable error, which now has been handled and committed. Please have a look and let me know Thanks |
|
it works :) |
|
Resolved and committed. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2011-04-04 09:42 | peterhol | New Issue | |
2011-04-04 11:06 | c_schmitz | Assigned To | => user7171 |
2011-04-04 11:06 | c_schmitz | Status | new => assigned |
2011-04-04 12:50 | peterhol | Note Added: 14648 | |
2011-04-04 14:00 | peterhol | Note Added: 14653 | |
2011-04-04 14:02 | peterhol | Note Added: 14654 | |
2011-04-04 14:11 | peterhol | Note Edited: 14653 | |
2011-04-04 14:31 | peterhol | Note Added: 14655 | |
2011-04-04 14:46 |
|
Note Added: 14656 | |
2011-04-04 14:47 |
|
Status | assigned => feedback |
2011-04-04 16:11 | peterhol | Note Added: 14657 | |
2011-04-04 16:11 | peterhol | Status | feedback => assigned |
2011-04-04 16:19 | peterhol | Note Added: 14658 | |
2011-04-04 16:37 | peterhol | Note Added: 14659 | |
2011-04-04 16:42 | peterhol | File Added: patch.txt | |
2011-04-04 16:42 | peterhol | Note Added: 14660 | |
2011-04-04 16:44 | peterhol | Note Edited: 14660 | |
2011-04-04 17:37 |
|
Note Added: 14661 | |
2011-04-04 17:37 |
|
Status | assigned => feedback |
2011-04-04 17:49 | peterhol | Note Added: 14662 | |
2011-04-04 17:49 | peterhol | Status | feedback => assigned |
2011-04-04 17:52 |
|
Note Added: 14663 | |
2011-04-04 17:52 |
|
Status | assigned => resolved |
2011-04-04 17:52 |
|
Resolution | open => fixed |
2011-04-11 11:34 | c_schmitz | Fixed in Version | => 1.91RC6 |
2011-04-11 11:34 | c_schmitz | Status | resolved => closed |
2016-12-08 10:39 | c_schmitz | Category | Tokens => Survey participants (Tokens) |