Commit graph

115 commits

Author SHA1 Message Date
David Arnold
cf8a603dac
build(deps): update premailer 3.8.0 -> 3.10.0 (#21783) 2023-07-24 16:26:27 +05:30
phot0n
b930cb923b fix: set X-Original-From header before replacing sender email/name
This will help in knowing the original email id and sender of email
and also bring consistency.
2022-07-13 12:05:46 +05:30
Ritwik Puri
b115aef414
fix: sanitize all line boundaries for email headers (#17408)
* test: add test case for subject with LF, CR and line separator
2022-07-07 10:43:00 +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
Gavin D'souza
07d7b34fd9 refactor: get_unsubscribe_message
* Add fallback label "Unsubscribe" instead of printing None in the email
* Add typing hints, f-stringify & make code DRY-er for better readability
2022-06-28 12:08: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
Rushabh Mehta
d3ca83c4d8 fix(minor): fix email error logging and strip Guest 2022-04-28 14:55:39 +05:30
Rushabh Mehta
6d266b19af fix(minor): fix email error logging and strip Guest 2022-04-28 14:42:17 +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
Gavin D'souza
0ef99c3886 fix: Add signature to Communication.content if not already added
This fix adds a signature forcibly if found under the sender's
User.email_signature or default outgoing email account's signature
field.

The previous method of adding a comment into the Email didn't work since
Quill would discard comments before setting them. Adding signatures in
get_formatted_html didn't seem apt since it's used in QueueBuilder to
re-construct the Email before processing the Email Queue. This meant
that the email content that was added in the Communication record would
not be final. Now, we treat the signature as part of the Communication
content.
2022-03-02 19:41:51 +05:30
Ankush Menat
af4ce8156d
fix: remove mutable defaults (#14597)
* fix: mutable defaults

* fix: missing defaults
2021-10-28 09:36:31 +00:00
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
8558116c70 Merge branch 'develop' of github.com:frappe/frappe into drop-py2-code 2021-05-31 18:28:28 +05:30
Leela vadlamudi
5b3acf7fe8
Merge pull request #13307 from leela/incoming-mail-refactoring
refactor: Incoming mail refactoring
2021-05-31 10:16:58 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
leela
5b96b79ed4 refactor: incoming mails 2021-05-21 18:57:18 +05:30
Faris Ansari
add84065ad Merge remote-tracking branch 'upstream/develop' into esbuild 2021-05-07 12:55:04 +05:30
leela
a8f74d9471 refactor: Move finding email accounts code to EmailAccount doctype 2021-05-03 06:22:35 +05:30
Faris Ansari
9a00ce43ea fix: Support bundled asset for email css 2021-04-29 14:40:15 +05:30
Faris Ansari
3c824bb92f refactor: Use hooks to load email css files
Previously email.css files were explicitly picked from hardcoded path
like public/css/email.css for all apps
2021-04-22 07:01:36 +05:30
pateljannat
43c3f76ff6 fix: added backend signature again 2021-03-19 10:57:43 +05:30
pateljannat
0861b40f3c fix: double signature in emails 2021-03-03 16:18:49 +05:30
Suraj Shetty
bdcb769c18 fix: Check if css file exists 2021-02-02 18:17:02 +05:30
prssanna
2118bd1cc8 style: fix formatting 2021-01-29 18:02:04 +05:30
Suraj Shetty
d8ad9b558f refactor: Move default email.css to the root css folder 2021-01-24 11:05:40 +05:30
Suraj Shetty
927b62f39e fix: Email body spacing issue 2021-01-21 15:33:12 +05:30
Suraj Shetty
65a82bef1a fix: Show brand logo if header is set 2021-01-21 12:15:18 +05:30
Suraj Shetty
6e7fbe157c fix: Show brand logo only if header or with_container is set 2021-01-21 12:13:52 +05:30
Suraj Shetty
5045cdf092 fix: Get brand logo from email account 2021-01-21 11:31:13 +05:30
Suraj Shetty
e6f551d610 feat: Add with_container argument and update email style 2021-01-21 11:17:08 +05:30
Suraj Shetty
d2b5bd7af7 refactor: Fix address naming 2021-01-21 10:13:19 +05:30
Suraj Shetty
03abe4abeb fix: Get brand logo from app 2021-01-13 14:03:54 +05:30
prssanna
8c11878400 fix(Email): use set_header to set Message-Id in header 2020-10-26 13:10:31 +05:30
prssanna
be36c532b7 fix: replace cr and lf characters with empty string in case of exception
(cherry picked from commit 6310494aa9afb67058b5d0b8d0f4cc8e382357e2)
2020-09-11 09:38:24 +00:00
prssanna
baa9afc945 fix(Email): replace newline characters in In-Reply-To in email header
(cherry picked from commit 3f2827bf03ecf57c20e9583bd40c43faccde16b8)
2020-09-07 11:10:31 +00:00
prssanna
d94a1313f0 fix: catch exception while setting In-Reply-To in email header 2020-09-05 14:15:02 +05:30
prssanna
a4239c4f1f fix: don't set header if empty 2020-07-18 19:40:10 +05:30
Chinmay D. Pai
c45864eac0
fix: specify SMTPUTF8 policy everywhere
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-18 18:27:44 +05:30
prssanna
cac8a8c4a0 fix: set policy to SMTPUTF8 2020-07-18 14:16:16 +05:30
Chinmay D. Pai
39ec64f1e3
fix: add default email policy to mail body
the default policy encodes special characters correctly, and is not set
by _default_ unless python3.8 is used. so we'll explicitly define the
policy to be used for the email body

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-07-17 18:36:53 +05:30
Mangesh-Khairnar
d47ef3a17a refactor: change validate_email_add to validate_email_address 2019-03-07 19:06:27 +05:30
Frappe Bot
bfc25ad1e5 Merge branch 'master' into develop 2019-02-15 10:21:47 +00:00
Zlash65
9d61601829 feat: replace sender name by email account name 2019-02-12 17:37:45 +05:30
Sagar Vora
ef82f39f99 Merge branch 'staging' into develop 2019-01-29 18:24:11 +05:30
Aditya Hase
6b72faf44f style: Linting fixes (#6809)
* style: Remove unused imports

* style: Remove unused local variables
2019-01-23 16:39:55 +05:30
Ameya Shenoy
b9ad9f8fb1
Merge branch 'staging' into develop 2018-11-05 11:43:46 +00:00
Ranjith Kurungadam
a34eab2140 Add Bcc in Notification (#6392)
* Notification - add Bcc

* remove Bcc from email header

* feat: Bcc in Notification
2018-11-05 12:27:21 +05:30
Chinmay Pai
8943f6cfd5
file-api: migration improvements and fixes
* migrate more functions to file class
* add get_content(), returns file content from file_name
* move get_file_path() to get_full_path() to decrease naming ambiguity

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-06 17:30:33 +05:30
Chinmay Pai
22ba310aaf
[2/3] file-api: code migration
migrate api from file_manager.py to file.py

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
2018-09-03 18:04:45 +05:30
Saurabh
33644ebfb2 [fix] merge conflicts 2017-10-27 16:05:45 +05:30