-
Notifications
You must be signed in to change notification settings - Fork 211
Force quopri to use CRLF for soft line breaks #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mhahnenberg
wants to merge
1
commit into
mailgun:master
Choose a base branch
from
nylas:fix-long-quoted-printable-crlf
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -631,7 +631,9 @@ def _encode_charset(preferred_charset, text): | |
| def _encode_transfer_encoding(encoding, body): | ||
| if six.PY3: | ||
| if encoding == 'quoted-printable': | ||
| body = b''.join([b'\r\n', body]) | ||
| body = quopri.encodestring(body, quotetabs=False) | ||
| body = body[2:] | ||
| return body.decode('utf-8') | ||
|
|
||
| if encoding == 'base64': | ||
|
|
@@ -647,7 +649,9 @@ def _encode_transfer_encoding(encoding, body): | |
| return body | ||
|
|
||
| if encoding == 'quoted-printable': | ||
| return quopri.encodestring(body, quotetabs=False) | ||
| body = '\r\n{}'.format(body) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here |
||
| result = quopri.encodestring(body, quotetabs=False) | ||
| return result[2:] | ||
| elif encoding == 'base64': | ||
| return _email.encode_base64(body) | ||
| else: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| MIME-Version: 1.0 | ||
| Received: by 10.68.60.193 with HTTP; Thu, 29 Dec 2011 02:06:53 -0800 (PST) | ||
| X-Originating-IP: [95.37.185.143] | ||
| Date: Thu, 29 Dec 2011 14:06:53 +0400 | ||
| Delivered-To: bob@marley.com | ||
| Message-ID: <CAEAsyCbSF1Bk7CBuu6zp3Qs8=j2iUkNi3dPkGe6z40q4dmaogQ@mail.gmail.com> | ||
| Subject: Testing message parsing | ||
| From: Bob Marley <bob@marley.com> | ||
| To: hello@there.com | ||
| Content-Type: text/plain; charset=ascii | ||
|
|
||
| Lorem ipsum dolor sit amet, nec reque propriae et, vix labitur dignissim ad. Sit in lobortis comprehensam, posse omittam atomorum et eos. Saperet oporteat molestiae pro eu, mel at scripta dolores vivendum, at nam eros ornatus. An est putant lobortis repudiandae. Quaeque persequeris neglegentur in nam, semper albucius consectetuer at duo. Qui populo nominavi te, vis et decore invenire ullamcorper, ea pri assum evertitur. Eam dicant hendrerit no, eos an sint sapientem, ei nam saperet complectitur mediocritatem. Ad saepe blandit iracundia mel, per cu veri interpretaris conclusionemque. In pri quaeque imperdiet repudiandae, falli decore minimum mei ut. Natum vidisse ei sit, ut malorum denique usu. Quo ex explicari conceptam temporibus. Ut mei graeci persecuti interpretaris, perfecto repudiandae mei ex. Mea ex splendide reprimique. No ridens verear commune nec. Laudem conclusionemque te sea, congue scriptorem et his. Tollit persius vix eu. Exerci efficiendi ea mei, id mei reque phaedrum disputando, recteque qualisque at vix. Vix noluisse dissentias at. Nec sanctus facilis at, et quo blandit pertinacia maiestatis, eum an erroribus reprimique scribentur. Cu sed graeco maluisset assueverit, omnesque vulputate vix id. Cu quod timeam reprehendunt vim, te esse placerat vim. Duo in mazim quaerendum dissentiet. Qui ea tempor impetus adipisci, vix eu eripuit saperet detracto, idque aeterno ne vim. Vim ne modo option pertinacia, graecis voluptua an vim. At consul scripta oblique cum, eu iriure fastidii erroribus quo. Eu gloriatur incorrupte definitiones mel. Oblique voluptatum ad sed, ea nostro abhorreant signiferumque nam, mediocrem posidonium vix eu. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather make it as simple as
body = b'\r\n' + body