Browse Source

MIME-19 adds test reproducing the issue

master
Andreas Buff 2 weeks ago
parent
commit
fc5efea412
2 changed files with 10 additions and 5 deletions
  1. +0
    -2
      pEpMimeObjCAdapter.xcodeproj/project.pbxproj
  2. +10
    -3
      pEpMimeObjCAdapterTests_macOS/Interface/PEPMessage+PEPMessage_MIMETest.m

+ 0
- 2
pEpMimeObjCAdapter.xcodeproj/project.pbxproj View File

@ -22,7 +22,6 @@
1585EA0D2696F69200B822E1 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 1585EA0C2696F69200B822E1 /* libc++.tbd */; };
1585EA722698329700B822E1 /* problemMail.eml in Resources */ = {isa = PBXBuildFile; fileRef = 1585EA712698329700B822E1 /* problemMail.eml */; };
1585ED3D269C663E00B822E1 /* libPEPObjCTypeUtils_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1585ED3C269C663E00B822E1 /* libPEPObjCTypeUtils_macOS.a */; };
4E0CFAD126E8C786001C7685 /* libPEPObjCTypes_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E51C25726CE7760007A2164 /* libPEPObjCTypes_macOS.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -175,7 +174,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4E0CFAD126E8C786001C7685 /* libPEPObjCTypes_macOS.a in Frameworks */,
1585EA0D2696F69200B822E1 /* libc++.tbd in Frameworks */,
1585E9EA2695BDEC00B822E1 /* libpEpMimeObjCAdapter_macOS.a in Frameworks */,
);


+ 10
- 3
pEpMimeObjCAdapterTests_macOS/Interface/PEPMessage+PEPMessage_MIMETest.m View File

@ -139,10 +139,17 @@
}
}
- (void)testBugParsing {
// MIME-19
- (void)testBugParsingLineFeed_MIME19 {
NSString *mimeString = @"Return-Path: <peptest@peptest.ch>\nX-Original-To: iostest020@peptest.ch\nDelivered-To: iostest020@peptest.ch\nReceived: by peptest.ch (Postfix, from userid 10000)\n\tid B0B37101996; Wed, 28 Jul 2021 14:57:16 +0200 (CEST)\nReceived: from Davids-New-MacBook-Pro.local (unknown [185.219.139.95])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby peptest.ch (Postfix) with ESMTPSA id 3E9331010E2;\n\tWed, 28 Jul 2021 14:57:16 +0200 (CEST)\nAuthentication-Results: plesk.peptest.ch;\n spf=pass (sender IP is 185.219.139.95) smtp.mailfrom=iostest020@peptest.ch smtp.helo=Davids-New-MacBook-Pro.local\nReceived-SPF: pass (plesk.peptest.ch: connection is authenticated)\nFrom: David Alarcon <iostest020@peptest.ch>\nSubject: =?UTF-8?B?cOKJoXA=?=\nTo: IOS Test 020 <iostest020@peptest.ch>,\n \"davidtest001@sq.pep.security\" <davidtest001@sq.pep.security>\nX-Pep-Version: 2.1\nMessage-ID: <0cf94c42-4393-0a5f-ac48-06080d725f70@peptest.ch>\nDate: Wed, 28 Jul 2021 14:57:15 +0200\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)\n Gecko/20100101 Thunderbird/78.12.0\nMIME-Version: 1.0\nContent-Type: multipart/encrypted; boundary=\"5b25ace2175dfcf04f97e3e453b0a9e\";\n protocol=\"application/pgp-encrypted\"\n\n\n--5b25ace2175dfcf04f97e3e453b0a9e\nX-Apple-Content-Length: 10\nContent-Type: application/pgp-encrypted\nContent-Transfer-Encoding: 7bit\n\n\n--5b25ace2175dfcf04f97e3e453b0a9e\nContent-Transfer-Encoding: 7bit\nContent-Disposition: inline;\n\tfilename=msg.asc\nContent-Type: application/octet-stream;\n\tname=msg.asc\nX-Apple-Content-Length: 7634\n\n\n--5b25ace2175dfcf04f97e3e453b0a9e--\n";
[self assertMimeString2PEPMessage:mimeString];
NSError *error = nil;
PEPMessage *testee = [PEPMessage pEpMessageWithMimeString:mimeString error:&error];
XCTAssertNotNil(testee.from);
XCTAssertNotNil(testee.to);
XCTAssertNotNil(testee.shortMessage);
XCTAssertNotNil(testee.optionalFields);
XCTAssertGreaterThanOrEqual(testee.optionalFields.count, 1);
}
// MARK: - HELPER


Loading…
Cancel
Save