Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to treat email attachments as separate items #2063

Closed
programmerq opened this issue May 3, 2023 · 6 comments · Fixed by #2475
Closed

Add ability to treat email attachments as separate items #2063

programmerq opened this issue May 3, 2023 · 6 comments · Fixed by #2475
Labels
joex affects the joex component restserver Affects the rest server. webui WebUI issues

Comments

@programmerq
Copy link
Contributor

I was hoping to import documents that I receive via email. Sometimes multiple documents can come in the same email message, but they are separate documents.

One use case example is scraping the USPS informed delivery email messages I receive. They attach images of the mail that I will get for a given day.

This feels similar to #1459 where this sort of thing was made possible for zip files.

@eikek
Copy link
Owner

eikek commented May 3, 2023

Hi @programmerq the same thing is possible for zip and eml files. But I think not from the "scan mailbox" task - do you mean this? If you upload an eml file with the option from #1459 you should get different items for mailbody and attachments.

@programmerq
Copy link
Contributor Author

Ah yes, I should have specified that I was referring to the "scan mailbox" feature, but I have also seen this same behavior with the other methods for importing emails:

  • dsc watch --attachments-only --flatten-archives ... didn't split them out. Same for dsc upload.
  • I also used the/app/upload page, and checked the "Extract zip file contents into separate items, in contrast to a single document with multiple attachments." box. That also didn't split the attachments out.

The upload page does say "Choose document files (pdf, docx, txt, html, …). Archives (zip and eml) are extracted." in the user interface.

@eikek
Copy link
Owner

eikek commented May 4, 2023

Ah, thanks for the feedback! Yes, then this doesn't work as I thought. I can't remember why it is not implemented for E-Mails, it should I'd think.

@eikek eikek added joex affects the joex component restserver Affects the rest server. webui WebUI issues labels May 4, 2023
@eikek eikek added this to the Docspell 0.41.0 milestone May 4, 2023
@madduck
Copy link
Contributor

madduck commented Sep 8, 2023

It's possible to add new files (attachments) to documents, maybe it would be helpful to also allow existing files to be promoted to their own documents?

@eikek
Copy link
Owner

eikek commented Sep 8, 2023

It's possible to add new files (attachments) to documents, maybe it would be helpful to also allow existing files to be promoted to their own documents?

Yes, that makes sense. I thought there is already an issue, but couldn't find one. I created #2261 now.

@eikek eikek changed the title Add ability to treat attachments as separate items Add ability to treat email attachments as separate items Jan 29, 2024
@eikek
Copy link
Owner

eikek commented Jan 29, 2024

Just for context, I misunderstood the intention when originally reading this issue. Currently this is only possible for zip files, if the flattenArchives option is set to true. It works by extracting the zip and submitting jobs for each entry. This could be extended to work for eml files, but as it is now, the overall eml file would be removed. I think this is ok, since the body + attachments are stored as single files, but you wouldn't be able to retrieve the original file. That is why I didn't implemenet it for eml files back then.

eikek added a commit that referenced this issue Jan 29, 2024
eikek added a commit that referenced this issue Jan 29, 2024
@mergify mergify bot closed this as completed in #2475 Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
joex affects the joex component restserver Affects the rest server. webui WebUI issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants