mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 12:05:58 +03:00
[GH-ISSUE #339] IMAP import from gmail isn't working #268
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#268
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DrVanSteiner on GitHub (Mar 8, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/339
Originally assigned to: @ciur on GitHub.
Description
IMAP import from gmail isn't working in Docker environment running version 2.0.0rc45 and before.
Expected
Attachements of Emails get imported
Actual
Papermerge can connect the IMAP Server and reports the count of UNSEEN messages but afterwards nothing happens not even an error. (Even with logging enabled as described here: https://github.com/ciur/papermerge/issues/118#issuecomment-693249651) i see only the following in the logfile:
MAP Import: UNSEEN messages 1 count
IMAP Import: UNSEEN messages 1 count
IMAP Import: UNSEEN messages 2 count
IMAP Import: UNSEEN messages 1 count
IMAP Import: UNSEEN messages 1 count
IMAP Import: UNSEEN messages 2 count
IMAP Import: UNSEEN messages 2 count
Configuration of IMAP:
IMPORT_MAIL_HOST = "imap.gmail.com"
IMPORT_MAIL_USER = "blabla"
IMPORT_MAIL_PASS = "blabla"
IMPORT_MAIL_BY_USER = False
IMPORT_MAIL_BY_SECRET = False
IMPORT_MAIL_DELETE = False
(Importing from local folder is working...)
Info:
@DrVanSteiner commented on GitHub (Mar 9, 2021):
What i see so far is that contains_attachments always returns false.
@ciur commented on GitHub (Mar 12, 2021):
@DrVanSteiner, can you please check if release 2.0.0rc48 fixes this issue ?
@DrVanSteiner commented on GitHub (Mar 15, 2021):
No it's not fixed with that version. The worker still only reports the number of unseen messages and nothing happens.
@l4rm4nd commented on GitHub (Mar 15, 2021):
Can confirm the issue.
Mails are correctly identified, but not imported. Should be a bug in
import_attachment()of papermerge-core's imap.py.Did some basic testing.
@ciur: So this seems to be a bug in your validation
contains_attachments(). The mails are removed from themessagesobject and therefore not processed - although having an attachement!Note: The IMAPClient library provides a special gmail search function. Maybe we can utilize this instead of
contains_attachments()for gmail specifically to fix the issue? Haven't had a look at yourcontains_attachments()implementation yet.@ciur commented on GitHub (Mar 16, 2021):
@l4rm4nd, thanks for investigation; I will have a look as well.
@ciur commented on GitHub (Mar 20, 2021):
No. By adding gmail, gmx... etc specific code is simple no go. Doing so, long term will lead to very brittle code base.
I think the problem is in contains_attachments method - it just looks wrong and difficult to understand how it does what it is supposed to do.
I will refactor
contains_attachmentsfunction which hopefully will fix this issue.@ciur commented on GitHub (Apr 6, 2021):
Fix is now part of version 2.0
@guim31 commented on GitHub (Apr 24, 2021):
I post here because i configured my papermerge.conf like this :
IMPORT_MAIL_HOST ="imap.gmail.com"
IMPORT_MAIL_USER ="gu@gmail.com"
IMPORT_MAIL_PASS ="xxxx"
IMPORT_MAIL_BY_USER = "FromBrotherDevice@brother.com"
The thing is : ALL my mails with attachments are imported by papermerge... Not only the ones coming from FromBrotherDevice@brother.com
Is there any way to fix this ?
@citizen-17 commented on GitHub (Oct 23, 2021):
You have to set IMPORT_MAIL_BY_USER = "FromBrotherDevice@brother.com" to True, IMPORT_MAIL_BY_USER = True and then configure the rest in the papermerge webui