diff --git a/enzevalos_iphone.xcodeproj/project.pbxproj b/enzevalos_iphone.xcodeproj/project.pbxproj index e6905e90923eec20143baf91e040ce12ec76ab3f..a84709db4ecd99096269465d65b2e7a95459221a 100644 --- a/enzevalos_iphone.xcodeproj/project.pbxproj +++ b/enzevalos_iphone.xcodeproj/project.pbxproj @@ -125,6 +125,7 @@ 47F867E22052B48E00AA832F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47F867E12052B48E00AA832F /* libz.tbd */; }; 47F867E42052B49800AA832F /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47F867E32052B49800AA832F /* libbz2.tbd */; }; 50F2E7D66366C779705987A7 /* Pods_enzevalos_iphoneUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF67EF30BB065CC9C0D17940 /* Pods_enzevalos_iphoneUITests.framework */; }; + 71DFE5BA240679E80042019C /* HeaderExtractionValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71DFE5B9240679E80042019C /* HeaderExtractionValues.swift */; }; 7500EE9D4F3130671F5C1AE2 /* Pods_enzevalos_iphoneTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7977EA7012D8E98D186D5C60 /* Pods_enzevalos_iphoneTests.framework */; }; 8428A8531F4369C0007649A5 /* Gamification.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8428A8521F4369C0007649A5 /* Gamification.storyboard */; }; 8428A8551F4369CF007649A5 /* GamificationElements.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8428A8541F4369CF007649A5 /* GamificationElements.xcassets */; }; @@ -385,6 +386,7 @@ 48C250BB32BF11B683003BA1 /* Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphone-enzevalos_iphoneUITests/Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig"; sourceTree = "<group>"; }; 66E758F271CD65AB3E5FE7A7 /* Pods-enzevalos_iphoneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneUITests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneUITests/Pods-enzevalos_iphoneUITests.debug.xcconfig"; sourceTree = "<group>"; }; 6EBCCD02AD3B95D8317810E2 /* Pods-enzevalos_iphoneTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneTests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneTests/Pods-enzevalos_iphoneTests.debug.xcconfig"; sourceTree = "<group>"; }; + 71DFE5B9240679E80042019C /* HeaderExtractionValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderExtractionValues.swift; sourceTree = "<group>"; }; 796D16D79BED5D60B580E602 /* Pods-enzevalos_iphoneUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneUITests.release.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneUITests/Pods-enzevalos_iphoneUITests.release.xcconfig"; sourceTree = "<group>"; }; 7977EA7012D8E98D186D5C60 /* Pods_enzevalos_iphoneTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_enzevalos_iphoneTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8428A8521F4369C0007649A5 /* Gamification.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Gamification.storyboard; sourceTree = "<group>"; }; @@ -683,6 +685,7 @@ 477548DD21F5DABE000B22A8 /* MailServerConnectionError.swift */, 47CEAC97222541B40075B7DC /* MailSession.swift */, 478AF714222FD5C600AEF69E /* IncomingMail.swift */, + 71DFE5B9240679E80042019C /* HeaderExtractionValues.swift */, ); name = mail; sourceTree = "<group>"; @@ -1621,6 +1624,7 @@ F12060821DA552FC00F6EF37 /* MailHandlerDelegator.swift in Sources */, 474994022261E4E6000F8DA5 /* SimpleSendIcon.swift in Sources */, A12F91D821F3A99800AB0589 /* NSLayoutConstraintExtension.swift in Sources */, + 71DFE5BA240679E80042019C /* HeaderExtractionValues.swift in Sources */, A18E7D771FBDE5D9002F7CC9 /* LoggingEventType.swift in Sources */, F1984D741E1E92B300804E1E /* LabelStyleKit.swift in Sources */, A1FA44A721E10E1400DB02AC /* TravelHandler.swift in Sources */, diff --git a/enzevalos_iphone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/enzevalos_iphone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/enzevalos_iphone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/enzevalos_iphone/HeaderExtractionValues.swift b/enzevalos_iphone/HeaderExtractionValues.swift new file mode 100644 index 0000000000000000000000000000000000000000..224f4be5b3cf1a3ee9c2af20c113b5a04d61bf3f --- /dev/null +++ b/enzevalos_iphone/HeaderExtractionValues.swift @@ -0,0 +1,19 @@ +// +// HeaderExtractionValues.swift +// enzevalos_iphone +// +// Created by Katharina Müller on 26.02.20. +// Copyright © 2020 fu-berlin. All rights reserved. +// + +import Foundation +enum HeaderExtractionValues: String { + case MIMEVersion = "MIME-Version" + case Received = "Received" + case ContentType = "Content-Type" + case ContentTransferEncoding = "Content-Transfer-Encoding" + case ContentDisposition = "Content-Disposition" //i.e. used by smime + case DKIMSignature = "DKIM-Siagnature"//DomainKeys for e-mail authentication + case InReplyTo = "In-Reply-To" + case XMailer = "X-Mailer" //Information about the mail server +} diff --git a/enzevalos_iphone/OutgoingMail.swift b/enzevalos_iphone/OutgoingMail.swift index 723ecc5854ce920dfe8d8aee17b844e1697462f6..797b0405079748539729f290c501a50d441b889f 100644 --- a/enzevalos_iphone/OutgoingMail.swift +++ b/enzevalos_iphone/OutgoingMail.swift @@ -329,6 +329,7 @@ class OutgoingMail { builder.header.bcc = bccEntrys builder.header.from = sender builder.header.subject = subject + // builder.header.setExtraHeaderValue("1.0", forName: "MIME-Version") builder.header.setExtraHeaderValue("letterbox", forName: "X-Mailer") if autocrypt { Autocrypt.addAutocryptHeader(builder) diff --git a/enzevalos_iphone/mail/IncomingMail.swift b/enzevalos_iphone/mail/IncomingMail.swift index 0ebfafeb90b48fe7b56809ca0a65ed1c87aeb188..937a6b2c5d149766bf0a33d93f5a9875dae8a2ba 100644 --- a/enzevalos_iphone/mail/IncomingMail.swift +++ b/enzevalos_iphone/mail/IncomingMail.swift @@ -162,6 +162,15 @@ class IncomingMail { private var boundary: String? private var msgID: String = "" private var userAgent: String = "" + private var mimeVersion: String = "" + private var received: String = "" + private var contentType: String = "" + private var contentTransferEncoding: String = "" + private var contentDisposition: String = "" + private var dkimSignature: String = "" + private var inReplyTo: String = "" + private var xMailer: String = "" + // Body info private var secretKey: String? = nil @@ -660,6 +669,38 @@ class IncomingMail { if let agent = header.userAgent { userAgent = agent } + if let mime = header.extraHeaderValue(forName: HeaderExtractionValues.MIMEVersion.rawValue) { + mimeVersion = mime + //print("MIME-Version: ", mimeVersion) + } + if let received_h = header.extraHeaderValue(forName: HeaderExtractionValues.Received.rawValue) { + received = received_h + //print("Received: ", received) + } + if let content = header.extraHeaderValue(forName: HeaderExtractionValues.ContentType.rawValue){ + contentType = content + //print("ContentType: ", contentType) + } + if let contentTransEncode = header.extraHeaderValue(forName: HeaderExtractionValues.ContentTransferEncoding.rawValue){ + contentTransferEncoding = contentTransEncode + //print("ContentTransEnc: ", contentTransferEncoding) + } + if let contentDispos = header.extraHeaderValue(forName: HeaderExtractionValues.ContentDisposition.rawValue) { + contentDisposition = contentDispos + //print("ContentDisposition: " , contentDisposition) + } + if let dkimSig = header.extraHeaderValue(forName: HeaderExtractionValues.DKIMSignature.rawValue){ + dkimSignature = dkimSig + //print("DKIMSignature: ", dkimSignature) + } + if let inReplyToo = header.extraHeaderValue(forName: HeaderExtractionValues.InReplyTo.rawValue){ + inReplyTo = inReplyToo + //print("In-Reply-To: ", inReplyTo) + } + if let xMail = header.extraHeaderValue(forName: HeaderExtractionValues.XMailer.rawValue){ + xMailer = xMail + //print("X-Mailer: ", xMailer) + } boundary = findBoundary() } }