From c7c8f38eac434f290e3d0f660088f5bfaf892232 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 21 Feb 2018 17:06:35 +0800 Subject: [PATCH] Use proper encoding for email fixtures. --- .gitattributes | 7 +- spec/fixtures/emails/encoded_display_name.eml | 22 +-- spec/fixtures/emails/forwarded_email_3.eml | 36 ++--- spec/fixtures/emails/inline_image.eml | 152 +++++++++--------- .../emails/reply_with_8bit_encoding.eml | 24 +-- 5 files changed, 122 insertions(+), 119 deletions(-) diff --git a/.gitattributes b/.gitattributes index ae7015b472a..546b134a0ce 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,14 @@ # Set default behaviour, in case users don't have core.autocrlf set. * text=auto -# Explicitly declare text files we want to always be normalized and converted +# Treat email fixtures as binary files so CRLF are not converted to LF. +*.eml binary + +# Explicitly declare text files we want to always be normalized and converted # to native line endings on checkout. *.yml text -# Custom for Visual Studio, very unlikely, but lets keep it +# Custom for Visual Studio, very unlikely, but lets keep it *.cs diff=csharp *.sln merge=union *.csproj merge=union diff --git a/spec/fixtures/emails/encoded_display_name.eml b/spec/fixtures/emails/encoded_display_name.eml index 1b5d6bb3a10..132e4404011 100644 --- a/spec/fixtures/emails/encoded_display_name.eml +++ b/spec/fixtures/emails/encoded_display_name.eml @@ -1,11 +1,11 @@ -Return-Path: -From: =?UTF-8?B?0KHQu9GD0YfQsNC50L3QsNGP?= =?UTF-8?B?INCY0LzRjw==?= -To: meat@bar.com -Subject: I need help -Date: Fri, 15 Jan 2016 00:12:43 +0100 -Message-ID: <29@foo.bar.mail> -Mime-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: quoted-printable - -Будьте здоровы! +Return-Path: +From: =?UTF-8?B?0KHQu9GD0YfQsNC50L3QsNGP?= =?UTF-8?B?INCY0LzRjw==?= +To: meat@bar.com +Subject: I need help +Date: Fri, 15 Jan 2016 00:12:43 +0100 +Message-ID: <29@foo.bar.mail> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +Будьте здоровы! diff --git a/spec/fixtures/emails/forwarded_email_3.eml b/spec/fixtures/emails/forwarded_email_3.eml index 1f37822b0a7..549dd44a68b 100644 --- a/spec/fixtures/emails/forwarded_email_3.eml +++ b/spec/fixtures/emails/forwarded_email_3.eml @@ -1,18 +1,18 @@ -Message-ID: <60@foo.bar.mail> -From: Ba Bar -To: Team -Date: Mon, 9 Dec 2016 13:37:42 +0100 -Subject: Fwd: Ça Discourse ? - -@team, can you have a look at this email below? - -Objet: Ça Discourse ? -Date: 2017-01-04 11:27 -De: Un Français -À: ba@bar.com - -Bonjour, - -Ça Discourse bien aujourd'hui ? - -Bises +Message-ID: <60@foo.bar.mail> +From: Ba Bar +To: Team +Date: Mon, 9 Dec 2016 13:37:42 +0100 +Subject: Fwd: Ça Discourse ? + +@team, can you have a look at this email below? + +Objet: Ça Discourse ? +Date: 2017-01-04 11:27 +De: Un Français +À: ba@bar.com + +Bonjour, + +Ça Discourse bien aujourd'hui ? + +Bises diff --git a/spec/fixtures/emails/inline_image.eml b/spec/fixtures/emails/inline_image.eml index af3283702a9..b169f8167a0 100644 --- a/spec/fixtures/emails/inline_image.eml +++ b/spec/fixtures/emails/inline_image.eml @@ -1,76 +1,76 @@ -Return-Path: -From: Foo Bar -To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com -Date: Fri, 15 Jan 2016 00:12:43 +0100 -Message-ID: <28@foo.bar.mail> -Mime-Version: 1.0 -Content-Type: multipart/related; boundary=001a114b2eccff183a052998ec68 - ---001a114b2eccff183a052998ec68 -Content-Type: multipart/alternative; boundary=001a114b2eccff1836052998ec67 - ---001a114b2eccff1836052998ec67 -Content-Type: text/plain; charset=UTF-8 - -Before - -[image: 内嵌图片 1] - -After - ---001a114b2eccff1836052998ec67 -Content-Type: text/html; charset=UTF-8 - -
Before

内嵌图片 1

After -
- ---001a114b2eccff1836052998ec67-- ---001a114b2eccff183a052998ec68 -Content-Type: image/png; name="logo.png" -Content-Disposition: inline; filename="logo.png" -Content-Transfer-Encoding: base64 -Content-ID: -X-Attachment-Id: ii_1525434659ddb4cb - -iVBORw0KGgoAAAANSUhEUgAAAPQAAABCCAMAAABXYgukAAABhlBMVEUAAAAjHyAjHyAjHyAjHyAj -HyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAAqVAAru/lGyTxXCL/+a5UHiHZGyTq -NyPtRCM7HyHwWCLrPCOEHSL95Z31g0W1HCMgs1wAqnghKC0Aq5YJirsAqm6oHCMPb5QArccUXnsS -Z4hAvWj80ouP1oXoKyR4HSL0eTz4q2j+76XsQCOf24vpLyNsHiJgHiEYTGHyZiucHSPzcDTf76IL -ga7qMyMwuGIArdEaQ1T7yIJwzHn2l1f6vnovHyDuTCPNHCQfMTr3oV/wVCL5tHEHk8gArKDnJyTv -UCIAruUWVW4ArLMQrlYNeKEEnNVQwm0cOkcAq4KA0X/mHyQAqVoArKkAq4wCpeIArdvnIyT1jU4A -qmQUXV3v9KikRSHP6pwwIyBHHiHKUSLxaDTtSCMCpLpgx3PaHyTtSSy/5Zetw3b83JSVSiT0i1eg -MSI+qVa2JCMrbVbiX0Ygs2YArL2LkGApkWQLf2kSZmpFMZD0AAAAEHRSTlMAEFCAv8+vQCBw72CP -358w5xEcGAAABxJJREFUeF7lmuW/uzoMh1eKrUApbMfd9efu7u5u193d739+gbHQBtg49x3b99U5 -H7asD0mTNNAoE9GobohUukmtxqDLbhoCi5nOICNruigWc+0BRXY80UN8ELEtQ/QWo4OGTFzRX4Y/ -UMy+ISqpOUi7mYmK4oPDLKpLJ4PBzMVOZAwEdVNgje6dmZ+fX5vZ+1mhrwcwto+stTKNnRgdxH3t -q0B7r6W4d/fEirivHR24HE48Ja47yO+NX22nujlxuDU/ialrXq9NmWUmQd7TIQZNTX9zBCczGYCy -mjVrmoxyIgnrDvLJS5d3jUSa3XXr/fbU+Ayipvi2mTUMbmAeT5AvJcCgy3P3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68-- +Return-Path: +From: Foo Bar +To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com +Date: Fri, 15 Jan 2016 00:12:43 +0100 +Message-ID: <28@foo.bar.mail> +Mime-Version: 1.0 +Content-Type: multipart/related; boundary=001a114b2eccff183a052998ec68 + +--001a114b2eccff183a052998ec68 +Content-Type: multipart/alternative; boundary=001a114b2eccff1836052998ec67 + +--001a114b2eccff1836052998ec67 +Content-Type: text/plain; charset=UTF-8 + +Before + +[image: 内嵌图片 1] + +After + +--001a114b2eccff1836052998ec67 +Content-Type: text/html; charset=UTF-8 + +
Before

内嵌图片 1

After +
+ +--001a114b2eccff1836052998ec67-- +--001a114b2eccff183a052998ec68 +Content-Type: image/png; name="logo.png" +Content-Disposition: inline; filename="logo.png" +Content-Transfer-Encoding: base64 +Content-ID: +X-Attachment-Id: ii_1525434659ddb4cb + +iVBORw0KGgoAAAANSUhEUgAAAPQAAABCCAMAAABXYgukAAABhlBMVEUAAAAjHyAjHyAjHyAjHyAj +HyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAjHyAAqVAAru/lGyTxXCL/+a5UHiHZGyTq +NyPtRCM7HyHwWCLrPCOEHSL95Z31g0W1HCMgs1wAqnghKC0Aq5YJirsAqm6oHCMPb5QArccUXnsS +Z4hAvWj80ouP1oXoKyR4HSL0eTz4q2j+76XsQCOf24vpLyNsHiJgHiEYTGHyZiucHSPzcDTf76IL +ga7qMyMwuGIArdEaQ1T7yIJwzHn2l1f6vnovHyDuTCPNHCQfMTr3oV/wVCL5tHEHk8gArKDnJyTv +UCIAruUWVW4ArLMQrlYNeKEEnNVQwm0cOkcAq4KA0X/mHyQAqVoArKkAq4wCpeIArdvnIyT1jU4A +qmQUXV3v9KikRSHP6pwwIyBHHiHKUSLxaDTtSCMCpLpgx3PaHyTtSSy/5Zetw3b83JSVSiT0i1eg +MSI+qVa2JCMrbVbiX0Ygs2YArL2LkGApkWQLf2kSZmpFMZD0AAAAEHRSTlMAE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rbEq8+ubhu403r4JMq69j5PD2 +deTDokRGMTOeTObHw8RUrti43uNBJ4aGW4r7AV/Ho0gM/XtE/MfinY37t1fWtx6H4cbr5cVIz+/8 ++S6M9XYTxxmGhlkzDGpkEQfYPI7qp9X9DuMJF56JY3t6Ism+ZaLpNjYsPNfP1+nJv/7+59+t891T +4/X1t6GsJ5tLaN9I8q1Yvvo/eBl/EK7kL9mNIpFO+9hHZR+y8W+KXjq2vtIBf3J681luXFlfYc6h +eOV7GJkb/5d5+KCbjaGDZlZjiKChwA8RNEx1hwcanvIPGbThAPKQQBvQuQ4FtKeb8GrOQOg/pxLS +uIDrr6oAAAAASUVORK5CYII= +--001a114b2eccff183a052998ec68-- diff --git a/spec/fixtures/emails/reply_with_8bit_encoding.eml b/spec/fixtures/emails/reply_with_8bit_encoding.eml index ed99f6752a8..2d025dd929b 100644 --- a/spec/fixtures/emails/reply_with_8bit_encoding.eml +++ b/spec/fixtures/emails/reply_with_8bit_encoding.eml @@ -1,12 +1,12 @@ -Return-Path: -From: Foo Bar -To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com -Date: Fri, 15 Jan 2016 00:12:43 +0100 -Message-ID: <43@foo.bar.mail> -MIME-Version: 1.0 -Content-Type: text/plain; charset=iso-8859-1 -Content-Disposition: inline -Content-Transfer-Encoding: 8bit - -hab vergessen kritische zeichen einzufügen: -äöüÄÖÜß +Return-Path: +From: Foo Bar +To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com +Date: Fri, 15 Jan 2016 00:12:43 +0100 +Message-ID: <43@foo.bar.mail> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + +hab vergessen kritische zeichen einzufügen: +äöüÄÖÜß