Commit graph

177 commits

Author SHA1 Message Date
barredterra
a28c5cd724 refactor: receive email 2024-04-05 17:43:16 +02:00
Akhil Narang
19fcaff098
fix: miscellaneous cleanup
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-26 18:40:43 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
dedadbb0d9 perf: optional faster perm check for files 2024-01-31 10:49:18 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
barredterra
1dca311856 feat: set sender_name_field in reference doc 2023-12-01 19:48:47 +01:00
barredterra
1d2e2da374 refactor: email _create_reference_document
- Return only docname instead of entire doc
- Remove unused property is_first
- Fix fallback on duplicate entry error
2023-12-01 19:48:20 +01:00
barredterra
9a1429d9c2 refactor: typo in variable name 2023-12-01 18:41:10 +01:00
Maharshi Patel
c2309969d5
fix: typo in strip folder name quotes (#23368)
fixed incorrect negative index.
2023-11-23 06:16:54 +00:00
Suraj Shetty
250dbf6a1c fix(email): Allow users to pull all (read & unread) emails during initial sync 2023-11-22 13:09:34 +05:30
Maharshi Patel
0b4f06c325
fix: remove quotes from IMAP Folder Name (#23242)
Quotes were added around folder name as spaces would cause issue with IMAP.

This extra quotes are also passed to query which sets the
uidnext and uidvalidity. where condition is never met

This values are used on subsequent pulls and without this values,
it is considered first pull and all UNSEEN mails are synced.

So even If user selected All in sync option it will always work as UNSEEN
option.

When UNSEEN is used it will mark all emails as seen on IMAP server when pulled.
2023-11-16 17:36:39 +05:30
Ankush Menat
a930872fd6
fix: pass default SSL context for imap/poplib (#22873) 2023-10-23 16:51:15 +05:30
Ankush Menat
135fb6a486 chore: remove py2 compatibilty code 2023-10-21 13:40:04 +05:30
Ankush Menat
f974fcabac fix: ignore poorly encoded email parts 2023-09-23 11:53:05 +05:30
mergify[bot]
69b0fcf06e
Merge pull request #22316 from cogk/fix-email-subject-decode
fix: Fix email subject decoding
2023-09-20 09:41:59 +00:00
David Arnold
734fb891c2
chore: monkey patching {imap,pop}lib is no more necessary since 4 years
see: 13a7ee8d62
2023-09-07 01:12:55 +02:00
Corentin Forler
a4a3af5859 refactor(email): Ensure that subject is a string 2023-09-05 14:10:06 +02:00
Corentin Forler
e5dd924cbe fix(email): Add missing byte-decoding in set_subject 2023-09-05 14:10:06 +02:00
Raffael Meyer
6ea739e4cf
refactor(File): explicitly import utils (#22143) 2023-08-23 11:08:22 +05:30
Ankush Menat
347902ba96 ci: bump flake8 2023-07-14 14:26:20 +05:30
Doridel Cahanap Mendez
4b2730642d refactor: attach txt file in received emails
(cherry picked from commit a36d6a9df02e9a86e3701fcc6861c9c64bd40c66)
2023-05-26 11:45:03 +00:00
Ankush Menat
715dc569e9
fix: reload communication before re-save (#20914) 2023-05-06 15:51:07 +05:30
phot0n
97b2adfaf2 chore: rename message_meta -> uid 2023-04-18 19:36:12 +05:30
phot0n
2a5ed28777 fix: make_error_msg for imap 2023-04-18 19:12:54 +05:30
phot0n
f6606781fb chore: take out email_list to function scope 2023-04-18 14:33:05 +05:30
Ritwik Puri
6ae91fb3b6
Merge branch 'develop' into email-retrieve-cleanup 2023-04-18 14:23:21 +05:30
phot0n
b483deac3d refactor(minor): email retreiveing 2023-04-18 14:01:11 +05:30
Ankush Menat
a2f40290d8
fix: bump poplib limit (#20739)
* fix: bump poplib limit

* Update receive.py

[skip ci]
2023-04-17 16:52:41 +05:30
phot0n
c7632d0e51 fix: use frappe.log_error in EmailServer exception handling 2023-04-12 13:20:32 +05:30
Ankush Menat
fdcdb61a2d
fix: email linking and message_id indexing (#20356)
* fix: find communication regardless of system reply

* perf: convert and index message_id
2023-03-16 14:01:25 +05:30
barredterra
3694e654a1 refactor: rename convert_utc_to_user_timezone to convert_utc_to_system_timezone 2023-03-04 19:02:25 +01:00
Ritwik Puri
92ca30074b
fix: dont get message attribute in error string in has_login_limit_exceeded 2023-03-02 15:59:34 +05:30
phot0n
f0a17d7adb fix: make connected app work with email account
* removed (now) unnecessary things from oauth class
* simplified get_active_token in connected_app
* removed gmail banner from email account docs
2022-12-28 14:58:19 +05:30
Ankush Menat
bbcc365a24
fix: use monotonic clock for timing code (#19138)
* fix: use monotonic time for timing code

`time.time()` depends on system clock which can drift away and get corrected
over time. If you're unlucky it will get corrected in your timing code
and give absurd results.

* test: dont check for status

can refresh and give wrong output

[skip ci]
2022-12-06 15:42:37 +05:30
Andrew McLeod
01fe2da368
fix(email): generate random filename when attachment filenames are same upon inbound email (#18483)
Fix issue when an email has multiple inline images with the same filename. Currently the cid_map is overwritten; instead, attach the files with different names. Emails where every inline image has the filename 'image.png', only one of the images ends up correctly linked.
2022-10-24 00:37:49 +05:30
HENRY Florian
11a17d3867
feat: STARTTLS authentication for IMAP (#17683)
Co-authored-by: phot0n <ritwikpuri5678@gmail.com>
2022-08-19 13:40:06 +05:30
phot0n
064ffef8b9 minor: throw exception if refresh_token is not present 2022-07-13 12:05:46 +05:30
phot0n
06c5a7226d chore: fix linter 2022-07-13 12:05:46 +05:30
phot0n
ebc5861210 feat: generic OAuth for email 2022-07-13 12:05:46 +05:30
phot0n
07a577af86 feat: google oauth for google emails
* used unique constraint on email_id in Email Account Doctype
2022-07-13 12:05:46 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
Gavin D'souza
5ec2690160 Merge branch 'develop' into refactor-file 2022-06-01 15:47:55 +05:30
Shariq Ansari
8f245be460
fix: Strip all spacing characters from Message-ID & In-Reply-To (#16999) 2022-05-27 21:06:07 +05:30
Gavin D'souza
1d84483289 Merge branch 'develop' of github.com:frappe/frappe into refactor-file 2022-04-21 11:45:50 +05:30
Rushabh Mehta
57a55e4225 feat(minor): Add document reference to Error Log and doc.log_error 2022-04-18 17:29:03 +05:30
Gavin D'souza
97e911e069 Merge branch 'develop' of github.com:frappe/frappe into refactor-file 2022-04-13 10:49:26 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30