Hi,
In version 6.x-2.4 messages are not deleted when importing from a POP3 mailbox.
I have turned on "Delete messages after they are processed".
When I try to import mails, the import progress bar stays on the screen for quite some time (screenshot 1) and after a while it throws an error message (screenshot 2). The messages are imported into Drupal. However the messages are not deleted, so next time I run the importer, they are imported again.
It looks like there is a link to issue #1368580: Messages always deleted with POP3. In my opinion it's not deleting messages anymore since this commit. I didn't have problems with the deletion of messages in one of the previous versions (before 6.x-2.3).
If you need some info or when you want me to test something, please let me know!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | screenshot1.png | 2.55 KB | pvanerk |
| #1 | screenshot2.png | 9.22 KB | pvanerk |
Comments
Comment #1
pvanerk commentedNow with screenshots
Comment #2
danepowell commentedPlease apply the attached patch, then try importing again, and let me know what messages show up in your dblog (watchdog) related to the import. Also please let me know if there are any errors in your PHP logs.
Also, it would help if you can confirm that the import DOES work with an IMAP mailbox, or with the local test mailbox (available in the Mailhandler quick-start module).
Comment #3
pvanerk commentedHi Dane,
Thanks for your quick reply. I appreciate it a lot!
First of all, everything works fine when I use a IMAP mailbox (google accounts). The POP3 server is a Microsoft Exchange Server a client of us is using.
I applied your patch, however no error messages showed up in the dblog. This is the output:
I couldn't find any error messages in the php log also.
I also tried some older versions of the Mailhandler.
Version 6.x-2.2 is working as expected (mails are imported and then deleted on the POP3 server).
Version 6.x-2.3 is not working (same issue as 6.x-2.4)
Thanks for your help!
Comment #4
danepowell commentedHmm... as near as I can tell, the only change between 2.2 and 2.3 that would affect this is that the message gets deleted in a separate connection. So I'm guessing that imap_delete() is getting called but with an invalid UID or something...
Can you apply the patch and test again and let me know what the dblog says?
Sorry this has caused so much trouble for you... POP is not the most common connection type these days.
Comment #5
pvanerk commentedHi Dane,
I know what trouble POP can be :-)
I have applied your patch and this is what the syslog is telling me:
The nginx log:
Still not a lot of info. Please let me know when I can do anything else for you!
Comment #6
danepowell commentedOkay, that confirms my suspicion- it seems that the UID being used is invalid. I'll have to investigate- it might take some time, sorry. As a workaround, you can use the attached patch. It's hackish and may have some unintended side-effects (it will delete all messages immediately after they are retrieved), but I think it should at least make the module usable for you.
Comment #7
pvanerk commentedThanks for your help!
Comment #8
danepowell commentedMarked #1441174: POP3 emails are not deleted as dupe. This is also any issue in the 7.x branch.
Comment #9
danepowell commentedMarked #1611530: E-Mails don't get deleted and reimport every time as dupe.
Comment #10
pvanerk commentedHi Dane,
Did you fix this in version 6.x-2.5?
I didn't see the code from the patch reflected in the 6.x-2.5 version, but maybe I missed it.
Thanks,
Paul
Comment #11
danepowell commentedNo, the 'active' status on this issue indicates that it has not been committed, nor has a proper patch been generated. As I mentioned in #6, the patch I posted was tailored to you and not a good general-purpose solution.
Comment #12
sblommers commentedWorkaround for this for version 2.5
Comment #13
sblommers commentedAnd now with corrected paths for the patch
Comment #14
er.yashvyas commentedHey
I have been using the same module you just need to check the checkbox given in the mailbox page
Delete messages after they are processed?
and in Protocol: select POP3 with port number 110
Also this error is reported if you have not enabled php_imap extension in apache.
Comment #14.0
er.yashvyas commentedFixed typo
Comment #15
danepowell commentedFor any newcomers to this thread, note that none of the patches here are intended for general use- they are only workarounds and will have side effects.