30 Commits

Author SHA1 Message Date
Jonas Winkler
2e04ba1c04 code style fixes 2020-11-12 21:09:45 +01:00
syntonym
5c1edf78ce Catches OSError on IMAP connection error
When something goes wrong with the imaplib.IMAP4_SSL connection (like the host is
temporarely down or the DNS does not resolve) it generates an OSError which is currently
not catched and handled. Now OSErrors are translated to MailFetcherErrors which get
logged and the IMAP connection is retried in the next IMAP check.

Fixes #474
2019-01-14 19:08:59 +01:00
Erik Arvstedt
0559204be4 fixup: require usage of PAPERLESS_EMAIL_SECRET 2018-05-21 12:11:56 +02:00
Erik Arvstedt
3e8038577d fixup: break up complex if condition 2018-05-21 00:44:58 +02:00
Erik Arvstedt
7357471b9e Consumer loop: make sleep duration dynamic
Make the sleep duration dynamic to account for the time spent in
loop_step.
This improves responsiveness when repeatedly consuming newly
arriving docs.

Use float epoch seconds (time.time()) as the time type for
MailFetcher.last_checked to allow for natural time arithmetic.
2018-05-11 14:14:50 +02:00
Erik Arvstedt
ea287e0db2 Fix list out of bounds error in mail message parsing
Check list length before accessing the first two elements of
'dispositions'.
The list may have only a single element ('inline') or may be empty in
mailformed emails.
2018-05-11 14:04:36 +02:00
Erik Arvstedt
4babfa1a5b Set default empty PAPERLESS_EMAIL_SECRET
Previously, if the user didn't set PAPERLESS_EMAIL_SECRET, Paperless
failed with an error in check_body() because self.SECRET was None.
2018-05-11 14:04:31 +02:00
Erik Arvstedt
aa2fc84d7f Mail fetching: Only catch internal errors
Previously, all errors raised during mail fetching were silently caught
and printed without backtrace.

To increase robustness and ease debugging, we now fail with a backtrace
on unexpected errors.
2018-05-11 14:01:09 +02:00
Daniel Quinn
f778d3a6e3 Remove last remnants of PAPERLESS_SHARED_SECRET 2018-03-18 14:08:41 +00:00
Daniel Quinn
96a94c4ee9 Remove superfluous import 2018-03-18 14:08:29 +00:00
Ovv
d1a57b5d68 Configuration cli argument for document_consumer 2018-03-03 18:43:20 +00:00
Daniel Quinn
b30629dd60 Remove debugging info 2017-06-19 09:22:26 +01:00
Daniel Quinn
f66d7e1c2d Drop SHARED_SECRET in favour of EMAIL_SECRET
Originally we used SHARED secret both for email and for the API.  That
was a bad idea, and now that we're only using this value for one case,
I've renamed it to reflect its actual use.
2017-06-18 22:08:42 +01:00
David Martin
c647daace2 Connect to configured inbox instead of hardcoded one.
Now the retrieving of emails from the inbox set in the config file works
as expected.
2017-05-21 08:34:49 +10:00
Daniel Quinn
8e58406881 pep8 corrections 2016-10-26 09:32:59 +00:00
Florian Harr
93d75fc6a2 line length 2016-04-14 13:00:00 -04:00
Florian Harr
f1427a9245 catch inline attachments 2016-04-13 00:00:01 -04:00
Daniel Quinn
b92e007e15 Removed log components and introduced signals for tags & correspondents 2016-03-28 11:11:15 +01:00
Daniel Quinn
070463b85a s/Sender/Correspondent & reworked the (im|ex)porter 2016-03-03 20:52:42 +00:00
Daniel Quinn
26c3781350 #44: Harmonise environment variables with constant names 2016-03-01 22:37:42 +00:00
Daniel Quinn
d686aba9ae Reset the group id for every pull 2016-02-28 00:40:08 +00:00
Daniel Quinn
2fe9b0cbc1 New logging appears to work 2016-02-27 20:18:50 +00:00
Daniel Quinn
7843ea5037 Added and implemented a rudimentary logger 2016-02-14 16:09:52 +00:00
Daniel Quinn
6b0a537bff Added support for a shared secret in email 2016-02-14 03:01:24 +00:00
Daniel Quinn
3b5d4cdd39 Added some error handling 2016-02-14 01:32:25 +00:00
Daniel Quinn
840472071c Added the required verbosity reference 2016-02-12 08:27:28 +00:00
Daniel Quinn
7aadab23cc Added the Renderable mixin because DRY 2016-02-11 22:05:38 +00:00
Daniel Quinn
39134b517e Cleaned up file_name() 2016-02-10 23:53:48 +00:00
Daniel Quinn
0eaed36420 The 'API' is written but untested 2016-02-08 23:46:16 +00:00
Daniel Quinn
48761911b3 Image imports and consumption by mail work 2016-02-06 17:05:36 +00:00