If I retrieve the mail manually, mailhandler works....cron is running successfully, but it isn't triggering mailhandler to go get the mail. What can be done?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mailhandler_cron_fix.patch | 1.69 KB | neochief |
If I retrieve the mail manually, mailhandler works....cron is running successfully, but it isn't triggering mailhandler to go get the mail. What can be done?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mailhandler_cron_fix.patch | 1.69 KB | neochief |
Comments
Comment #1
geodaniel commentedIt sounds like there might be a module running in cron before mailhandler, which either takes up more time than it should or drops out once it's done. What other modules do you have running on cron?
Comment #2
neochief commentedCron doesn't works, because mailhandlers opens imap session two times. Here's a fix.
Comment #3
BetaTheta commentedI tried using that patch, it didn't seem to help.
Comment #4
BetaTheta commentedCorrection, it seems mailhandler works when I run cron manually, but not when it runs automatically. When I look at the logs, it seems the manually runs are done by me while the automatic ones are done by anonymous. Could this be the issue?
Comment #5
pacome commentedI also have this problem : when I test the connection with the mailbox, and if i retrieve manualy the mails, it works perfectly (for both POP and IMAP).
But when i run a cron (both automaticaly or manualy) I get this for POP :
And this for IMAP :
And not a single mail is retrieved...
Any idea ?
mailhandler 6x-1.x-dev
-P-
Comment #6
pacome commentedComment #7
pacome commentedBump !
Does anyone could give a hand on that problem ?
I can connect to the mail box
I can retrieve mails manualy
but Cron doesn't do the job...
Logs says :
one time per cron :
Could not fetch structure for message number 11and two times per cron :
imap_close(): 74 is not a valid imap resource in /home/.../sites/all/modules/mailhandler/mailhandler.retrieve.inc on line 684.I spent hours on different try out with no success... and I still have no idea what goes wrong..
I would really appreciate any advice.
Comment #8
neochief commenteddid you tried my patch?
Comment #9
pacome commentedYep ! It works !
I first tried to patch mailhandler.module file, and had no results
I realised the file to patch was mailhandler.retrieve.inc... Ooops !
Thanks !!
Sorry for not looking more carefully ;)
-P-
Comment #10
neochief commentedso, setting issue to RTBC
Comment #11
Ian Ward commentedMarked http://drupal.org/node/595314 as duplicate. I applied a patch very similar to #2 by @neochief. The difference being to only proceed if there are actually new messages. I believe the problem like neochief states, and more specifically, there are problems w/ certains stacks (php/os's) when one imap session is opened before a previous is closed. Now, session is opened, closed, then opened again. This is not most efficient and may refactor later. I've commited this, and can be further tested on the 6.1 dev branch. I'll leave open until more positive feedback.
Comment #12
jgraham commentedI can confirm that on 6.x-1.8, I was experiencing the bug as described here.
Upgrading to 6.x-1.x-dev (Dec 5th) solved the problem.
Thanks all!
edit: Since the ticket title does not describe exactly what I was experiencing, but other comments detailed the same issue, I wanted to clarify that I was receiving the following error during cron, but manual execution worked fine:
Comment #13
Ian Ward commented@jgraham I am glad it is working for you now. Could you let me know what operating system and php version you are using? Thanks
Comment #14
jgraham commented@Ian Ward: Fedora 10, PHP 5.2.9
Comment #15
jgraham commentedJust wanted to add that if two cron instances run at the same time this issue may show up again.
I don't think anything can be done by mailhandler about that scenario though.
Comment #16
jlv commentedWe had a very similar problem. We ran through supercron and confirmed mailhandler was the issue. Upgrading to 6.x-1.x-dev (Dec 5th) solved the problem for us too.
Comment #17
Ian Ward commentedThis has been fixed
Comment #19
sgtsaughter commentedAnyone know how to apply this patch with git? I am getting a fatal: unrecognized input when I run git apply --index mailhandler_cron_fix.patch
EDIT: I am getting a HUNK FAILED error when trying to apply this patch. Is there a way I can get this patch for the 6x 1.11 branch?