paperless
paperless copied to clipboard
Consumer rejects emails with Re: or Fwd: in subject
I'm importing documents from an email inbox. However, email subjects containing "Fwd:" or "Re:" are considered unsafe and the email is not processed further.
The code for checking the subject is here: https://github.com/the-paperless-project/paperless/blob/2cd077d12d1f3046a02b9ed96f3acb4ac30e25cd/src/documents/mail.py#L108
The subject line is matched against SAFE_REGEX: https://github.com/the-paperless-project/paperless/blob/1c956652f360e58409c8fca148b7662585dd1087/src/documents/models.py#L160
If there are no objections I'm going to draft a PR to make unsafe subjects safe and then continue with the import. A similar suggestion has been made in: https://github.com/the-paperless-project/paperless/issues/506
This might be problematic if you are spamed for any reason. I would advise against it. Why don't you change the subject before sending it?
Sounds good to me. I don't see how colons or other punctuation make emails more unsafe than not having them in there.
Also, isn't the whole point of the PAPERLESS_EMAIL_SECRET
to filter out emails that are not intended for paperless? The subject line shouldn't really matter as long as the secret is contained in the email I would think.
# Any email sent to the target account that does not contain this text will be
# ignored.
PAPERLESS_EMAIL_SECRET=""
What might work as well: have some logic to disregard the safe email subject when the email secret is set to a non-empty string.
I agree that the spam issue is already solved by PAPERLESS_EMAIL_SECRET
.
First, I would strip a set of common subject prefixes like "Fwd:" and then remove all non-safe characters from the subject.
I would highly appreciate this! Would also second that the current situation is by no means a spam protection or similar
Same, I'm trying to get emails from my scanner to go in but their subject is Transfer file from "Epson Connect Scan to Cloud"
It'd also be neat if it could not care and just take an entire email account, I setup a whole new email address for this purpose that all documents go to. If I cannot get this to work, I'll probably use OfflineIMAP to sync in all emails into the consume directory.