Commit Graph

41 Commits

Author SHA1 Message Date
572ffd5acf Handle ignored emails explicitly using exceptions.
Support the flag on IgnoreEmail model to control deleting the email if
ignored.
2022-09-06 19:40:35 +01:00
23c3b72a43 Refactor object_from_message to make it more testable and fix some bugs.
Extract the from email using the email library instead of pre-decoding
which exposes the comma separator causing the email address to be
extracted incorrectly if the real name contains a comma.
Raise an exception when a message to be ignored is detected to process
ignored messages explicitly.
2022-09-04 22:01:32 +01:00
46f8e9d21f Clear error
Use.objects.get causes undefined variable when using get_user_model
2022-07-25 03:52:58 +02:00
1468982043 Remove unused variables, extract correct index 2022-07-25 03:50:49 +02:00
57cd2f1471 Remove annoation for py3.8 2022-07-25 03:47:57 +02:00
8d63d65a7d Removed encoding to 'utf-8', breaks tests.
This needs to be looked into further.
2022-07-25 02:41:40 +02:00
4e2b7deefb Reduces complexity of object_from_message
Helper functions created to help break up the flow
2022-07-25 02:22:32 +02:00
a5e74d6449 Extract getting ticket_id from subject to helper function 2022-07-25 01:56:13 +02:00
283f052c0e Annotate function signature 2022-07-25 01:47:00 +02:00
80f4152301 Simplify return statement
Rename `ticket` to `ticket_id` for clarity
2022-07-25 01:43:43 +02:00
0b1de1eead Removed unused import
Result of previous code removal
2022-07-25 01:23:12 +02:00
fe28c2f540 Merge branch 'unstable' of git@github.com:martin-marty/django-helpdesk.git into 1039-complexity-reduction 2022-07-25 01:22:11 +02:00
1ac78955c0 Removed notifications_to_be_sent list
The whole loop appeared to be doing nothing other than appending email
addresses to a list, which was never used.
2022-07-25 01:22:05 +02:00
0f0b0a5995 Remove left over 'cc' code 2022-07-22 16:27:38 +02:00
25542f929e Initial isort configuration
Will fail build if imports are not sorted correctly
2022-07-22 03:26:41 +02:00
aa876f8016 pycodestyle formatting 2022-07-12 12:34:19 +02:00
358080926c Added Django 4 support. 2022-03-16 22:29:09 -04:00
6a0b367171 fix: strip extraneous whitespace characters that are returned in the Message-ID and In-Reply-To fields from some email providers 2021-09-23 10:07:12 -03:00
3285d5e1a8 feat(emails): Do not auto-reply on auto-replies and add auto-reply header for auto-replies and fix headers propagation for our email messages 2021-04-20 12:44:27 +02:00
2b4c82fd1b fix(email): Add ability to attach full first email text to avoid losing forwards, and to save .eml files for any incoming mesages, plus fix tests and some minor bugs 2021-04-19 21:15:24 +02:00
012ba4f42d Update email.py
Correct a typo so that imap code calls starttls() correctly.
2021-03-26 03:48:10 -04:00
9f99eb5ee6 fix: prepend file attachments with 'part-%i_' to prevent name collisions when an email has attachments with the same filename 2021-03-08 13:57:07 -04:00
959fc0f9ba Merge pull request #911 from koriaf/dev-configurable-file-log
ifix(email): Create the log file only if required
2020-12-04 11:08:43 -05:00
baa763c784 Add support for standard STARTTLS on port 143 (RFC 2595).
Signed-off-by: Evili del Rio <evili.del.rio@gmail.com>
2020-12-04 11:49:20 +01:00
d2a7bad576 ifix(email): Create the log file only if required
+ update some translations
+ update some tests to correctly mock unlink as well
+ fix flake8 errors and sort the imports in email module
+ update some log messages to pass base message + parameters instead of rendered string (works better with Sentry)
2020-11-25 10:31:40 +01:00
bbe
da5028d51a Redirect e-mail for a merged ticket to the ticket it has been merged to 2020-10-30 19:59:16 +01:00
eca0f16806 bug fix data may be referenced when not set 2020-10-14 16:58:37 -06:00
2f788f2597 Merge 0.2.22 bugfix release updates, update copyright year in license, specify python 3.6 or above in setup 2020-07-30 04:46:15 -04:00
1643a45457 fix<process_email>: free the log file handler after it's not used anymore 2020-02-12 20:53:00 +01:00
9963a3fe5d Fix utf decoding bug in email parsing code
For some reason mozilla thunderbird sometimes marks email parts as 8bit
even though they are utf-8. I guess the best way to work around this is
to add a try-catch block because this really cannot be predicted.
2020-01-23 16:00:01 +01:00
66ab507c15 Snyc with master to get patches for ru templates and custom User models 2019-08-05 19:40:38 -04:00
71d4662c7b Fix #732 encoding of 8bit utf emails 2019-03-26 14:50:45 +01:00
6886a7920e Specify encoding of html email bodies explicitly 2019-03-26 13:59:01 +01:00
2c3ce8903f Decode quoted-printable html bodies when getting email
Fixes #719
2019-03-06 14:21:30 +01:00
344dd75a1c Address multipart mime ending up in description, for #700 2019-02-16 02:18:07 -05:00
43ed3ac773 PEP-8 fixes for mail threading merge 2018-12-28 11:32:49 -05:00
5f0d22a692 Merge brunotikami/master for user and email threading, for #385 and #375 2018-12-28 10:53:28 -05:00
696d10db12 Remove old python2/six code 2018-12-28 03:13:52 -05:00
e66c42890c Don't crash when mail body is empty 2018-12-19 17:30:21 +01:00
6c37d73d4e DRY out email sending code and normalize behavior
This refactor removes duplicated logic for deciding whom the messages get sent to.
It also normalizes behavior ensuring that all CCed addresses are sent to in all cases that CCed individuals should be notified.
2018-11-01 14:56:17 +01:00
9a45d28c95 More refactors of get_email.py 2018-10-31 16:30:19 +01:00