...
 
Commits (24)
......@@ -27,6 +27,7 @@
470709302189E1C100DF71A3 /* enc+signedThunderbird.eml in Resources */ = {isa = PBXBuildFile; fileRef = 4707092F2189E1C000DF71A3 /* enc+signedThunderbird.eml */; };
4707096D1F8F9F4900657F41 /* ExportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4707096C1F8F9F4900657F41 /* ExportViewController.swift */; };
4715F637202A0248001BFFD0 /* CoreDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4715F636202A0248001BFFD0 /* CoreDataTests.swift */; };
47184C3922F0D8F200712A7A /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47184C3822F0D8F200712A7A /* CFNetwork.framework */; };
471876F7223FACA900912135 /* BobPWTEST1234.asc in Resources */ = {isa = PBXBuildFile; fileRef = 471876F5223FACA900912135 /* BobPWTEST1234.asc */; };
471876F8223FACA900912135 /* BobWithoutPW.asc in Resources */ = {isa = PBXBuildFile; fileRef = 471876F6223FACA900912135 /* BobWithoutPW.asc */; };
472F396E1E14F384009260FB /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 472F396D1E14F384009260FB /* CoreData.framework */; };
......@@ -191,7 +192,7 @@
A1F992391DA7DD2E0073BF1B /* InboxTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A1F9923B1DA7DD2E0073BF1B /* InboxTableViewCell.xib */; };
A1FA44A721E10E1400DB02AC /* TravelHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1FA44A621E10E1400DB02AC /* TravelHandler.swift */; };
AC4001CA169DC07A7A1E3AD3 /* Pods_enzevalos_iphone.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94EE54279AB591E0CAB8EFD8 /* Pods_enzevalos_iphone.framework */; };
D76938018EDE28949DF8DF0A /* Pods_enzevalos_iphoneUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF232CF5EE5EE7B9838EBDF4 /* Pods_enzevalos_iphoneUITests.framework */; };
D76938018EDE28949DF8DF0A /* Pods_enzevalos_iphoneUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF232CF5EE5EE7B9838EBDF4 /* Pods_enzevalos_iphoneUITests.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
F113C3851F30D06800E7F1D6 /* QRScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F113C3841F30D06800E7F1D6 /* QRScannerView.swift */; };
F113C38B1F3344C200E7F1D6 /* ViewControllerPannable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F113C38A1F3344C200E7F1D6 /* ViewControllerPannable.swift */; };
F119D2901E364B59001D732A /* AnimatedSendIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F119D28F1E364B59001D732A /* AnimatedSendIcon.swift */; };
......@@ -199,7 +200,6 @@
F12041FD1DA409A5002E4940 /* ListViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F12041FC1DA409A5002E4940 /* ListViewCell.swift */; };
F12060801DA540FE00F6EF37 /* RefreshControlExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F120607F1DA540FE00F6EF37 /* RefreshControlExtension.swift */; };
F12060821DA552FC00F6EF37 /* MailHandlerDelegator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F12060811DA552FC00F6EF37 /* MailHandlerDelegator.swift */; };
F120A7D31F7937BB006D5BF1 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
F12D8DBB2069422A0068788E /* About.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F12D8DBD2069422A0068788E /* About.storyboard */; };
F14239C11F30A99C00998A83 /* QRCodeGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F14239C01F30A99C00998A83 /* QRCodeGenerator.swift */; };
F1737ACB2031D7D70000312B /* StudySettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = A17FDFF2202C685800F7BA89 /* StudySettings.swift */; };
......@@ -271,6 +271,7 @@
4707092F2189E1C000DF71A3 /* enc+signedThunderbird.eml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "enc+signedThunderbird.eml"; sourceTree = "<group>"; };
4707096C1F8F9F4900657F41 /* ExportViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExportViewController.swift; sourceTree = "<group>"; };
4715F636202A0248001BFFD0 /* CoreDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataTests.swift; sourceTree = "<group>"; };
47184C3822F0D8F200712A7A /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
471876F5223FACA900912135 /* BobPWTEST1234.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BobPWTEST1234.asc; sourceTree = "<group>"; };
471876F6223FACA900912135 /* BobWithoutPW.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BobWithoutPW.asc; sourceTree = "<group>"; };
472F396D1E14F384009260FB /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
......@@ -504,11 +505,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
47184C3922F0D8F200712A7A /* CFNetwork.framework in Frameworks */,
47CEF4ED2052C3E700887CDB /* ObjectivePGP.framework in Frameworks */,
47F867E42052B49800AA832F /* libbz2.tbd in Frameworks */,
47F867E22052B48E00AA832F /* libz.tbd in Frameworks */,
47F867E02052B47C00AA832F /* Security.framework in Frameworks */,
F120A7D31F7937BB006D5BF1 /* BuildFile in Frameworks */,
472F396E1E14F384009260FB /* CoreData.framework in Frameworks */,
AC4001CA169DC07A7A1E3AD3 /* Pods_enzevalos_iphone.framework in Frameworks */,
);
......@@ -736,6 +737,7 @@
78280F99990BFF65543B7F0B /* Frameworks */ = {
isa = PBXGroup;
children = (
47184C3822F0D8F200712A7A /* CFNetwork.framework */,
47A5D6DD2294B5480084F81D /* AppAuth.framework */,
47A5D6DB2294B5220084F81D /* libz.1.1.3.tbd */,
47A5D6D52294B4830084F81D /* GTMAppAuth.framework */,
......
......@@ -103,46 +103,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}
}
return false
}
func googleLogin(vc: UIViewController) {
// Logger.log(onboardingState: .GoogleLogIn)
Logger.log(onboardingState: .GoogleLogIn, duration: 0)
if self.currentReachabilityStatus == .notReachable {
if showAlertNoConnection {
let alert = UIAlertController(title: NSLocalizedString("Error.noInternet.Title", comment: ""), message: NSLocalizedString("Error.noInternet.Message", comment: ""), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "On", style: .default, handler: { [weak self] _ in
let contr = (Onboarding.onboarding() as! OnboardingViewController)
self?.window?.rootViewController = contr
contr.gotoLastPage()
}))
self.window?.rootViewController?.present(alert, animated: true)
}
} else {
EmailHelper.singleton().doEmailLoginIfRequired(onVC: vc, completionBlock: {
guard let userEmail = EmailHelper.singleton().authorization?.userEmail, EmailHelper.singleton().authorization?.canAuthorize() ?? false else {
print("Google authetication failed")
// TODO: self.credentialsFailed(error: MailServerConnectionError.AuthenticationError)
return
}
UserManager.storeUserValue(userEmail.lowercased() as AnyObject, attribute: Attribute.accountname)
UserManager.storeUserValue(userEmail.lowercased() as AnyObject, attribute: Attribute.userAddr)
UserManager.storeUserValue("imap.gmail.com" as AnyObject, attribute: Attribute.imapHostname)
UserManager.storeUserValue(993 as AnyObject, attribute: Attribute.imapPort)
UserManager.storeUserValue(MCOConnectionType.TLS.rawValue as AnyObject, attribute: Attribute.imapConnectionType)
UserManager.storeUserValue(MCOAuthType.xoAuth2.rawValue as AnyObject, attribute: Attribute.imapAuthType)
UserManager.storeUserValue("smtp.gmail.com" as AnyObject, attribute: Attribute.smtpHostname)
UserManager.storeUserValue(587 as AnyObject, attribute: Attribute.smtpPort)
UserManager.storeUserValue(MCOConnectionType.startTLS.rawValue as AnyObject, attribute: Attribute.smtpConnectionType)
UserManager.storeUserValue(MCOAuthType.xoAuth2.rawValue as AnyObject, attribute: Attribute.smtpAuthType)
Onboarding.checkIMAPConfigUI()
})
}
}
func credentialsWork() {
self.window?.rootViewController = Onboarding.contactView(self.requestForAccess)
......@@ -231,6 +193,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
if let vc = self.window?.rootViewController {
if let inboxController = vc as? InboxViewController {
inboxController.loadData()
}
else {
for x in vc.children {
if let inboxController = x as? InboxViewController {
inboxController.loadData()
}
}
}
}
}
......
......@@ -227,7 +227,7 @@ class DataHandler {
try managedObjectContext.save()
} catch {
print("Error during saving while: \(during)")
NSLog("Error during saving while %s", during)
NSLog("Error during saving while %@", during)
}
}
......
......@@ -25,6 +25,7 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
let dateFormatter = DateFormatter()
let searchController = UISearchController(searchResultsController: nil)
var filteredRecords = [KeyRecord]()
var counterRefreshs = 0
let folder = DataHandler.handler.findFolder(with: UserManager.backendInboxFolderPath)
var loading = false {
didSet {
......@@ -85,7 +86,7 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
do{
try AppDelegate.getAppDelegate().mailHandler.startIMAPIdleIfSupported()
} catch {
print("ERROR: Coould not establish connection to server!")
print("ERROR: Could not establish connection to server!")
}
NotificationCenter.default.addObserver(forName: Notification.Name.NSManagedObjectContextDidSave, object: nil, queue: nil, using: {
[weak self] _ in
......@@ -107,8 +108,14 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
if let rc = self.refreshControl {
if error == nil {
lastUpdate = Date()
counterRefreshs = 0
} else {
lastUpdateText = NSLocalizedString("NeverUpdated", comment: "Error while loading mailscomment")
if AppDelegate.getAppDelegate().currentReachabilityStatus != .notReachable && counterRefreshs < 100{
print("REFRESH AGAIN!")
counterRefreshs += 1
refresh(nil)
}
}
rc.endRefreshing()
lastUpdateText = lastUpdate != nil ? "\(NSLocalizedString("LastUpdate", comment: "When the last update occured")): \(dateFormatter.string(from: lastUpdate!))" : NSLocalizedString("NeverUpdated", comment: "No internet connection since last launch")
......@@ -117,13 +124,15 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
override func viewWillAppear(_ animated: Bool) {
tableView.reloadData()
if lastUpdate == nil || Date().timeIntervalSince(lastUpdate!) > 50 {
// self.refreshControl?.beginRefreshingManually()
counterRefreshs = 0
refresh(nil)
}
}
func loadData() {
refresh(nil)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
......
......@@ -18,14 +18,17 @@ class ItunesKeyHandling {
// Import only keys with our mail addr.
sks = sks.filter{
if let useradr = UserManager.loadUserValue(Attribute.userAddr) as? String {
return !$0.mailAddresses.contains(useradr)
return $0.mailAddresses.contains(useradr)
}
return false
}
// No alert
/*
if let sk = sks.first {
let alert = MinimalImportUI(secretKey: sk, controller: con)
alert.importSecretKeyDialog(first: true)
}
*/
}
static let iTunesKeyHandler = ItunesKeyHandling()
......@@ -101,12 +104,16 @@ class MinimalImportUI {
var secretKeyPasswordField: UITextField? = nil
func importSecretKeyDialog(first: Bool) {
var message = String(format: NSLocalizedString("Read.Import.Secret.Body.Plain", comment: "NewSecretKeyMessage"), secretKey.keyID ?? "")
guard let keyID = secretKey.keyID else {
return
}
let format = NSLocalizedString("Read.Import.Secret.Body.Plain", comment: "NewSecretKeyMessage")
var message = String.localizedStringWithFormat(format, keyID)
if secretKey.hasPassword {
message = String(format: NSLocalizedString("Read.Import.Secret.Body.PW", comment: "NewSecretKeyMessage"), secretKey.keyID ?? "")
message = String(format: NSLocalizedString("Read.Import.Secret.Body.PW", comment: "NewSecretKeyMessage"), keyID)
}
if !first {
message = String(format: NSLocalizedString("Read.Import.Secret.Body.Wrong", comment: "NewSecretKeyMessage"), secretKey.keyID ?? "")
message = String(format: NSLocalizedString("Read.Import.Secret.Body.Wrong", comment: "NewSecretKeyMessage"), keyID)
}
let alert = UIAlertController(title: NSLocalizedString("Read.Import.Secret.Title", comment: "NewSecretKeyTitle"), message: message, preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("Read.Import.Secret.No", comment: "NoSecretKeyImport"), style: UIAlertAction.Style.destructive, handler: { (_: UIAlertAction) -> Void in
......
This diff is collapsed.
This diff is collapsed.
......@@ -271,15 +271,13 @@ class Onboarding: NSObject {
nextState = .BriefInput
}
self.changeState(newState: nextState)
//Logger.log(onboardingPageTransition: oldPage, to: newPage, onboardingSection: "intro")
}
//Logger.log(onboardingState: "intro")
return vc!
}
@objc static func oauth() {
googleAuth = true
doWhenDone()
Onboarding.googleLogin()
}
@objc static func dismissKeyboard() {
......@@ -301,7 +299,6 @@ class Onboarding: NSObject {
vc.pageControl = UIPageControl.init()
vc.view.backgroundColor = defaultColor
self.changeState(newState: .UseraddressDetail)
//Logger.log(onboardingState: "checkServerConfig")
return vc
}
......@@ -574,10 +571,7 @@ class Onboarding: NSObject {
nextState = IntroState.Failed
}
changeState(newState: nextState)
//Logger.log(onboardingPageTransition: oldPage, to: newPage, onboardingSection: "detail")
}
//Logger.log(onboardingState: "detail")
return vc!
}
......@@ -694,6 +688,30 @@ class Onboarding: NSObject {
checkIMAPConfigUI()
}
static func googleLogin() {
guard let vc = AppDelegate.getAppDelegate().window?.rootViewController else {
print("No view controller!")
return
}
// TODO guard: Internet connection?
Logger.log(onboardingState: .GoogleLogIn, duration: 0)
EmailHelper.singleton().doEmailLoginIfRequired(onVC: vc, completionBlock: {
guard let userEmail = EmailHelper.singleton().authorization?.userEmail, EmailHelper.singleton().authorization?.canAuthorize() ?? false else {
print("Google authetication failed")
// TODO: self.credentialsFailed(error: MailServerConnectionError.AuthenticationError)
return
}
currentIMAP = MailSession.init(configSession: .IMAP, mailAddress: userEmail.lowercased(), password: "", username: userEmail.lowercased())
currentIMAP?.addListener(listener: listenerIMAP)
currentIMAP?.setServer(hostname: "imap.gmail.com", port: 993, connType: MCOConnectionType.TLS.rawValue, authType: MCOAuthType.xoAuth2.rawValue)
currentSMTP = MailSession.init(configSession: .SMTP, mailAddress: userEmail.lowercased(), password: "", username: userEmail.lowercased())
currentSMTP?.setServer(hostname: "smtp.gmail.com", port: 587, connType: MCOConnectionType.startTLS.rawValue, authType: MCOAuthType.xoAuth2.rawValue)
currentSMTP?.addListener(listener: listenerSMTP)
Onboarding.checkIMAPConfig()
})
}
static private func setIMAPSession() -> MailSession {
var name = mailaddress.text
if let n = username.text {
......@@ -708,27 +726,35 @@ class Onboarding: NSObject {
guard testConfig == false else {
return
}
var mailSession: MailSession
let isDetailedOnboarding = Onboarding.credentialFails >= 3
let mailSession = setIMAPSession()
if let imap = previousIMAP, MailServerConnectionError.wrongServerConfig(errors: imap.errors) && Onboarding.credentialFails == 2 && !mailSession.hasJsonFile && mailSession.startLongSearchOfServerConfig(hostFromAdr: true) {
if googleAuth, let session = currentIMAP, session.startTestingServerConfig() {
mailSession = session
testConfig = true
startTimeIMAPCheck = Date()
}
else if isDetailedOnboarding{
checkDetailConfig(imap: true)
return
}
else {
if mailSession.startTestingServerConfigFromList() {
mailSession = setIMAPSession()
if let imap = previousIMAP, MailServerConnectionError.wrongServerConfig(errors: imap.errors) && Onboarding.credentialFails == 2 && !mailSession.hasJsonFile && mailSession.startLongSearchOfServerConfig(hostFromAdr: true) {
testConfig = true
startTimeIMAPCheck = Date()
}
else if mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding){
testConfig = true
startTimeIMAPCheck = Date()
else if isDetailedOnboarding{
checkDetailConfig(imap: true)
return
}
else {
Onboarding.credentialFails = 3
if mailSession.startTestingServerConfigFromList() {
testConfig = true
startTimeIMAPCheck = Date()
}
else if mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding){
testConfig = true
startTimeIMAPCheck = Date()
}
else {
Onboarding.credentialFails = 3
}
}
}
currentIMAP = mailSession
......@@ -749,25 +775,32 @@ class Onboarding: NSObject {
guard testConfig == false else {
return
}
startTimeIMAPCheck = nil
let mailSession = setSMTPSession()
let isDetailedOnboarding = Onboarding.credentialFails >= 3
if let smtp = previousSMTP, MailServerConnectionError.wrongServerConfig(errors: smtp.errors) && Onboarding.credentialFails == 2 && !mailSession.hasJsonFile && mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding) {
var mailSession: MailSession
if googleAuth, let session = currentSMTP, session.startTestingServerConfig() {
mailSession = session
testConfig = true
}
else if isDetailedOnboarding{
checkDetailConfig(imap: false)
return
}
else {
if mailSession.startTestingServerConfigFromList() {
startTimeIMAPCheck = nil
mailSession = setSMTPSession()
let isDetailedOnboarding = Onboarding.credentialFails >= 3
if let smtp = previousSMTP, MailServerConnectionError.wrongServerConfig(errors: smtp.errors) && Onboarding.credentialFails == 2 && !mailSession.hasJsonFile && mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding) {
testConfig = true
}
else if mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding) {
testConfig = true
else if isDetailedOnboarding{
checkDetailConfig(imap: false)
return
}
else {
Onboarding.credentialFails = 3
if mailSession.startTestingServerConfigFromList() {
testConfig = true
}
else if mailSession.startLongSearchOfServerConfig(hostFromAdr: !isDetailedOnboarding) {
testConfig = true
}
else {
Onboarding.credentialFails = 3
}
}
}
currentSMTP = mailSession
......
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.24</string>
<string>0.8.27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
......@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>0.8.24</string>
<string>0.8.27</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
......@@ -140,7 +140,10 @@ extension PersistentMail {
self.willAccessValue(forKey: "uid")
let text = (self.primitiveValue(forKey: "uid") as? NSDecimalNumber)?.uint64Value
self.didAccessValue(forKey: "uid")
return text!
if let res = text {
return res
}
return 0
}
}
public var uidvalidity: UInt32? {
......
......@@ -845,7 +845,8 @@ class SendViewController: UIViewController {
let inviteMail = invite || mailSecurityState == .extendedPostcard(.censored) || mailSecurityState == .extendedPostcard(.partiallyEncrypted)
let travelHandler = TravelHandler.instance()
mailHandler.send(toEntrys as NSArray as! [String], ccEntrys: ccEntrys as NSArray as! [String], bccEntrys: [], subject: subject, message: message, sendEncryptedIfPossible: !enforcePostcard && travelHandler.mode != .borderCrossing, callback: nil, htmlContent: hmtlmessage, inviteMail: inviteMail, textparts: counterTextparts, uiState: .letter)
mailHandler.send(toEntrys as NSArray as! [String], ccEntrys: ccEntrys as NSArray as! [String], bccEntrys: [], subject: subject, message: message, sendEncryptedIfPossible: !enforcePostcard && travelHandler.mode != .borderCrossing, callback: nil, htmlContent: hmtlmessage, inviteMail: inviteMail, textparts: counterTextparts, uiState: mailSecurityState)
self.mailSend(nil)
}
}
......
......@@ -213,7 +213,7 @@ class SwiftPGP: Encryption {
do {
try keychain.remove(key.keyID.longIdentifier)
} catch {
NSLog("Error while removing key from keychain. KeyID: %s, isSecretKey: %s ", key.keyID, key.isSecret)
NSLog("Error while removing key from keychain. KeyID: %@, isSecretKey: %@ ", key.keyID, key.isSecret)
}
}
......@@ -429,7 +429,7 @@ class SwiftPGP: Encryption {
return CryptoObject(chiphertext: armorChipherData, plaintext: plainString, decryptedData: plaindata, sigState: SignatureState.NoSignature, encState: EncryptionState.ValidedEncryptedWithCurrentKey, signKey: nil, encType: CryptoScheme.PGP, signedAdrs: [])
} catch {
NSLog("Encryption error. Ids: %s, myID: %s, encryptedForMyID: %s", ids, myId, encryptForMyID)
NSLog("Encryption error. Ids: %@, myID: %@, encryptedForMyID: %@", ids, myId, encryptForMyID)
}
return CryptoObject(chiphertext: nil, plaintext: nil,decryptedData: nil, sigState: SignatureState.InvalidSignature, encState: EncryptionState.UnableToDecrypt, signKey: nil, encType: cryptoScheme, signedAdrs: signedAdr)
......@@ -598,6 +598,7 @@ class SwiftPGP: Encryption {
}
} catch {
let nsError = error as NSError
print(nsError)
switch nsError.localizedDescription {
case "Invalid header":
return (nil, EncryptionState.NoEncryption)
......@@ -636,6 +637,7 @@ class SwiftPGP: Encryption {
sigState = SignatureState.ValidSignature
} catch {
let nsError = error as NSError
print(nsError)
switch nsError.code {
case 7: // no public key
sigState = SignatureState.NoPublicKey
......
......@@ -20,7 +20,7 @@
"Cc" = "Kopie";
"Checkmarks" = "Du hast Nachrichten von den Adressen mit Haken bekommen";
"Close" = "Schließen";
"codeExplanation" = "Um dein Geheimnis auf einem anderen Gerät benutzen zu können, benötigst du den folgenden Code. Dieser wird in dieser Ansicht wieder zu finden sein, damit du ihn leicht abtippen kannst.";
"codeExplanation" = "Um deinen geheimen Schlüssel auf einem anderen Gerät benutzen zu können, benötigst du den folgenden Code. Dieser wird in dieser Ansicht wieder zu finden sein, damit du ihn leicht abtippen kannst.";
"codeExplanationTravel" = "Um dein Geheimnis auf dem anderen Gerät benutzen zu können, benötigst du den folgenden Code. Notiere ihn dir jetzt und lasse die Notiz zuhause, damit deine Geheimnisse während der Reise geschützt sind.";
"CouldNotConnect" = "Die Verbindung zum Server konnte nicht hergestellt werden. Bitte überprüfe die folgenden Angaben und passe sie an.";
"ConnectingToMailServer" = "Verbinde zum Mailserver";
......@@ -37,10 +37,10 @@
"Emailaddress" = "Mailadresse";
"EncryptionType" = "Verschlüsselungsart";
"EverythingCorrect" = "Alles richtig?";
"ExportInfoViewText" = "Du kannst vertrauliche Mails auf einem Gerät nur lesen, wenn das Gerät das Geheimnis kennt. Das Geheimnis befindet sich auf deinem iPhone. Das Geheimnis kann einfach und sicher übertragen werden. Wenn du das tun möchtest, öffne auf einem anderen Gerät die";
"ExportKeyMailWasSentTopLabel" = "Dein Geheimnis wurde in einer Mail an die Adresse";
"ExportInfoViewText" = "Du kannst vertrauliche Mails auf einem Gerät nur lesen, wenn das Gerät kennt den geheimen Schlüssel. Der geheime Schlüssel befindet nur sich auf deinem iPhone. Er kann einfach und sicher übertragen werden. Wenn du das tun möchtest, öffne auf einem anderen Gerät die";
"ExportKeyMailWasSentTopLabel" = "Dein geheimer Schlüssel wurde in einer Mail an die Adresse";
"ExportKeyMailWasSentBottomLabel" = "geschickt.";
"ExportKeyMailWillBeSentTopLabel" = "Dein Geheimnis wird in einer Mail an die Adresse";
"ExportKeyMailWillBeSentTopLabel" = "Dein geheimer Schlüssel wird in einer Mail an die Adresse";
"ExportKeyMailWillBeSentBottomLabel" = "geschickt werden.";
"Fingerprint" = "Fingerabdruck";
"Folders" = "Ordner";
......@@ -51,7 +51,7 @@
"Hello" = "Hallo";
"INBOX" = "INBOX";
"Inbox" = "Postfach";//Briefkasten?
"Insecure" = "Unvertraulich";
"Insecure" = "Unsicher";
"InsertMailAddress" = "Bitte gib deine Mailadresse ein";
"InsertMailAddressAndPassword" = "Bitte gib deine Mailadresse und dein Passwort ein";
"InsertPassword" = "Bitte gib dein Passwort ein";
......@@ -64,7 +64,7 @@
"KeyIsRevoked" = "Der Schlüssel wurde zurückgezogen. Zurückgezogen wurde er am ";
"KeyIsVerified" = "Der Schlüssel ist verifiziert. Verifiziert wurde es am ";
"KeyNotFound" = "Der Schlüssel konnte nicht gefunden werden. Dies ist ein Fehler, bitte wende dich an die Entwickler!";
"Letter" = "Vertrauliche Mail";
"Letter" = "Vertraulich und Nachweisbar";
"LetterDamaged" = "Manipulierte Mail";
"LetterDescription" = "Nur du und die sendende Person kennen den Inhalt der Mail. \nDu weißt welche Mails die Person vorher versendet hat.";
"mail from" = "Nachricht von";
......@@ -79,7 +79,7 @@
"original message" = "originale Nachricht";
"Password" = "Passwort";
"Plaintext" = "Klartext";
"Postcard" = "Unvertrauliche Mail";
"Postcard" = "Unsichere Mail";
"PostcardDescription" = "Du, die sendende Person und beide Mail-Provider kennen den Inhalt der Mail, aber wer hat sie versendet?\nAbsenderadressen können frei gewählt werden. Ein Betrüger kann eine bekannte Mailadresse angeben und sich so als eine andere Person ausgeben.";
"Re" = "Re";
"ReadFollowingPages" = "Wir machen vertrauliche Mail-Kommunikation einfach nutzbar.\Bitte lies dir dafür die nächsten drei Seiten durch.";
......@@ -153,7 +153,7 @@
"Body" = "Nachricht";
"and" = "und";
"more" = "weitere";
"encryptedBeforeHeadline" = "Keine vertrauliche Mail";
"encryptedBeforeHeadline" = "Unsichere Mail";
"encryptedBeforeText" = "Du hast bereits vertrauliche Mails von dieser Mailadresse erhalten. Die Absenderadresse und der Inhalt könnten aber manipuliert sein. Du solltest misstrauisch sein. Für deine eigene Sicherheit solltest du nicht auf Links klicken.\n";
"corruptedText" = "Diese Mail wurde verändert! Bitte sei misstrauisch, falls du trotzdem die Mail liest.\n";
"corruptedHeadline" = "Achtung!";
......@@ -200,7 +200,7 @@
"travelFollowUpReminderText" = "Hi,\n\nich würde dir gerne einen Brief schreiben! Wenn du die Grenzkontrollen passiert hast, gib das bitte schnell in der Letterbox App an. Dann kann ich dir den Brief senden.\n\nSchöne Grüße!";
"travelFollowUpReminderSubject" = "Grenzkontrollen passiert?";
"newKeyHeadline" = "Keine Ähnlichkeit zu vorherigen Mails!";
"newKeyText" = "Das ist eine vertrauliche Mail, aber sie kann nicht mit vorherigen vertraulichen Mails von dieser Person zu geordnet werden. Wir können nicht entscheiden, ob ein Betrüger sich als die Person ausgibt oder die Person ein neues Gerät hat. Du solltest misstrauisch sein. Für deine eigene Sicherheit solltest du nicht auf Links klicken. Falls die Mail merkwürdig ist, solltest du die Person darauf ansprechen.";
"newKeyText" = "Die Mail kann nicht mit vorherigen vertraulichen Mails von dieser Person zu geordnet werden. Wir können nicht entscheiden, ob ein Betrüger sich als die Person ausgibt oder die Person ein neues Gerät hat. Du solltest misstrauisch sein. Für deine eigene Sicherheit solltest du nicht auf Links klicken. Falls die Mail merkwürdig ist, solltest du die Person darauf ansprechen. Aber nur du und die absendene Person kann den Inhalt lesen.";
"inviteContacts" = "Bitte um vertrauliche Kommunikation";
"inviteContacts.Censor" = "Erklärungsdialog anzeigen";
"inviteSubject" = "Lass uns vertrauliche Mails ausprobieren!";
......@@ -208,7 +208,7 @@
"noName" = "OHNE NAME";
"you" = "Deine Ablage";
"thisIsYou" = "Hier werden E-Mails, die du dir selber schickst, gesammelt";
"didYouSendThis" = "Hallo, haben Sie mir diese E-Mail geschickt?\nIch frage nur, weil die Mail nicht vertraulich ist und wir vorher bereits vertraulich kommuniziert haben.\n\n";
"didYouSendThis" = "Hallo, haben Sie mir diese E-Mail geschickt?\nIch frage nur, weil die Mail Ihnen nicht eindeutig zugeordnet werden kann und Ihre vorherige Mails eindeutig Ihnen zu ordnenbar waren. Für Erfahrende: Die Mail hat keine digitale Signatur.\n\n";
"reactButton" = "Um Bestätigung bitten";
"sendSecureIfPossible" = "Wenn möglich vertraulich senden";
"sendInsecure" = "Nicht vertrauchlich machen";
......@@ -223,8 +223,8 @@
"fingerprintMissmatchShort" = "Fingerabdruck stimmt nicht!";
"fingerprintMissmatchText" = "Stelle sicher, dass du den QR-Code zur Verifikation von der richtigen Person gescannt hast. Falls es der richtige war, könntest du Opfer eines Mittelsmann-Angriffs sein.";
"scanDifferentCode" = "Anderen QR Code scannen";
"secureContacts" = "Vertrauliche Kontakte";
"secureCommunication" = "Vertrauliche Kommunikation";
"secureContacts" = "Nachweisbare Kontakte";
"secureCommunication" = "Vertrauliche und nachweisbare Kommunikation";
"ErrorText" = "Ein Fehler ist aufgetreten. Besteht eine Verbindung zum Internet?";
"about" = "Über uns";
"YourBadges" = "Deine Abzeichen";
......@@ -265,13 +265,13 @@
"MailServerError.Crypto.Body" = "Es konnte keine Verbindung zum Server hergestellt werden.\n Die Konfiguration der Transportverschlüsselung ist falsch. Bitte überprüfe diese, sowie den Port der Serverkonfiguration. Mehr Informationen finden sich dazu auch auf der Webseite des Providers.";
"MailServerError.OAUTH.Body" = "Es konnte keine Verbindung zum Server hergestellt werden.\n Google stellt einen sicheren Zugang zu deinem Postfach bereit. Bitte nutze dazu den spezifischen Login für Google.";
"MailServerError.Default.Body" = "Es konnte keine Verbindung zum Server hergestellt werden.\n Bitte überprüfe das Password, den Accountname und die Serverkonfiguration (IMAP/SMTP). Die Serverkonfiguration kann mit der Serverkonfiguration auf der Provider-Webseite verglichen werden. In manchen Fällen muss der Zugriff mittels IMAP/SMTP in den Accounteinstellungen erst freigeschaltet werden.";
"Read.Import.Secret.Title" = "Neues Geheimnis";
"Read.Import.Secret.Body.PW" = "Bitte gib das Passwort um das neue Geheimnis mit der ID: %s zu importieren ein.";
"Read.Import.Secret.Body.Plain" = "Importiere das neue Geheimnis mit der ID: %s.";
"Read.Import.Secret.Title" = "Neuer geheimer Schlüssel";
"Read.Import.Secret.Body.PW" = "Bitte gib zum Import das Passwort für den geheimen Schlüssel mit der ID %@ ein.";
"Read.Import.Secret.Body.Plain" = "Importiere den neuen geheimen Schlüssel mit der ID: %@.";
"Read.Import.Secret.No" = "Kein Import";
"Read.Import.Secret.Ok" = "Ok";
"Read.Import.Secret.Body.Wrong" = "Falsches Passwort! Bitte gib das Passwort um das neue Geheimnis zu importieren erneut ein.";
"Read.Import.Secret.Body.Wrong" = "Falsches Passwort! Bitte gib das Passwort um den neuen geheimen Schlüssel zu importieren erneut ein.";
"SecretKeyTable.title" = "Deine geheimen Schlüssel";
"SecretKeyCell.date" = "Bekannt seit ";
"SecretKeyCell.origin" = "Impotiert aus ";
"SecretKeyCell.origin" = "Importiert aus ";
"SecretKeyCell.generated" = "Auf diesem Gerät erzeugt.";
......@@ -38,9 +38,9 @@
"EncryptionType" = "Encryption Type";
"EverythingCorrect" = "Everything correct?";
"ExportInfoViewText" = "You can only read your confidential mails on a device if the device knows the secret. This secret is located on your iPhone. \nThis secret can be transferred easily and securely. If you want to do that, open on the other device the";
"ExportKeyMailWasSentTopLabel" = "Your secret was sent in a mail to the address";
"ExportKeyMailWasSentTopLabel" = "Your secret key was sent in a mail to the address";
"ExportKeyMailWasSentBottomLabel" = "";
"ExportKeyMailWillBeSentTopLabel" = "Your secret will be sent in a mail to the address";
"ExportKeyMailWillBeSentTopLabel" = "Your secret key will be sent in a mail to the address";
"ExportKeyMailWillBeSentBottomLabel" = "";
"Fingerprint" = "Fingerprint"; //????
"Folders" = "Folders";
......@@ -51,7 +51,7 @@
"Hello" = "Hello";
"INBOX" = "INBOX";
"Inbox" = "Inbox";
"Insecure" = "Not confidential";
"Insecure" = "Insecure";
"InsertMailAddress" = "Please enter your mail address";
"InsertMailAddressAndPassword" = "Please enter your mail address and password";
"InsertPassword" = "Please enter your password";
......@@ -64,7 +64,7 @@
"KeyIsRevoked" = "The Key was revoked. It was revoked on ";
"KeyIsVerified" = "The Key is verified. It was verified on ";
"KeyNotFound" = "No Key Found. This is an error, contact the developers!";
"Letter" = "Confidential mail";
"Letter" = "Confidential and genuine mail";
"LetterDamaged" = "Manipulated mail";
"LetterDescription" = "Only you and the sender know the content of the mail. \nYou know which mails the sender sent before."; // Association with. You know which mails the sender sent before.
"mail from" = "mail from";
......@@ -78,14 +78,14 @@
"OneMinuteAgo" = "1 min ago";
"Password" = "Password";
"Plaintext" = "Plain text";
"Postcard" = "Not confidential";
"Postcard" = "Insecure";
"PostcardDescription" = "You, the sender and both mail providers know the content of the mail but who sent the mail?\nSender addresses can be freely chosen. A fraud can impersonate a person when using a known mail address as sender address.";
"Re" = "Re";
"ReadFollowingPages" = "We make confidential mail communication easy to use.\nPlease read the next three pages to learn how.";
"ReadMailOnOtherDevice" = "Read this mail on a different device";
"ReadOnOtherDevices" = "Read secure mails on different devices!";
"Receive" = "Receive";
"ReceiveError" = "An error occured";
"ReceiveError" = "An error occurred";
"ReceiveDamagedInfo" = "The cryptographic properties of this mail are broken. The content has be manipulated."; // Other reasons?
"ReceiveSecureInfo" = "Only you and the sender know the content of the mail.";
"ReadView.Icon.Association.No" = "The person sent you no confidential mails before."; // NEW
......@@ -93,7 +93,7 @@
"ReadView.Icon.Association.Multi" = "The person sent you %@ confidential mails before."; // NEW
"ReadView.Icon.Secure.Expert" = "For experts: This mail was encrypted and signed.";
"ReadView.Icon.Advice" = "Think twice when clicking on links.";
"ReceiveInsecureInfo" = "You, the sender and both mail providers know the content of the mail. But we do not know if the sender address represents the real sender. Be aware that a fraud can impersonate the sender.";
"ReceiveInsecureInfo" = "We do not know if the sender address represents the real sender. Be aware that a fraud can impersonate the sender. But you, the sender and both mail providers know the content of the mail.";
"ReadView.Icon.Insecure.Expert" = "For experts: This mail was neither encrypted nor signed.";
"ReadView.Icon.Key" = "We know that the sender can send confidential mails.";
"ReadView.Icon.NoKey" = "We do not know if the sender can send confidential mails.";
......@@ -108,7 +108,7 @@
"SaveAsDraft" = "Save as draft";
"Secure" = "Secure"; //???
"Send" = "Send";
"SendError" = "An error occured"; //mehr spezifizieren?
"SendError" = "An error occurred"; //mehr spezifizieren?
"SendInsecureInfo" = "This mail would be sent not confidentially to all orange contacts. You, the receivers and the mail providers will know the content. You could ask them to communicate confidentially. \nFor experts: The mail will be neither signed nor encrypted for orange contacts.";
"SendInsecureInfoAll" = "This mail will not be confidential. You, the receivers and the mail providers will know the content. You could ask them to communicate confidentially. \nFor experts: The mail will be neither signed nor encrypted.";
"SendSecureInfo" = "This mail will be confidential. Only you and the receivers will know the content. \nFor experts: The mail will be signed and encrypted.";
......@@ -137,11 +137,11 @@
"LastUpdate" = "Last Update";
"notVerified" = "Contact is not verified yet.";
"noEncryption" = "Contact has never sent confidential mails.";
"otherEncryption" = "This is the not confidential tray with this Contact"; //What about association????
"otherEncryption" = "This is the insecure tray with this Contact"; //What about association????
"hasKeyButNoMail" = "Contact could send and receive confidential mails but never send confidential mails.";
"Verified" = "Contact is verified"; //TODO other word for verified
"verifyNow" = "Verify now";
"toEncrypted" = "Switch to confidential tray";
"toEncrypted" = "Switch to confidential and genuine tray";
"invite" = "Ask for confidential communication"; // Volker: ask???
"discardButton" = "Discard";
"allMessages" = "All messages from this tray";
......@@ -152,8 +152,8 @@
"Body" = "Body";
"and" = "and";
"more" = "more";
"encryptedBeforeHeadline" = "Not Confidential Mail";
"encryptedBeforeText" = "You received confidential mails from this address before. However, the sender address and content could be manipulated. You should be caution when opening the mail. For your safety, do not click on links.\n"; // IDEE: Auf Links klicken verbieten. Hinterfragen.
"encryptedBeforeHeadline" = "Insecure Mail";
"encryptedBeforeText" = "You received confidential and genuine mails from this address before. However, the sender address and content could be manipulated. You should be caution when opening the mail. For your safety, do not click on links.\n"; // IDEE: Auf Links klicken verbieten. Hinterfragen.
"corruptedText" = "This E-Mail has been manipulated! If you want to read it anyways, please be cautions.";
"corruptedHeadline" = "Attention!";
"answer" = "Answer";
......@@ -170,7 +170,7 @@
"IWantToTravel" = "I want to travel!";
"SendViewBorderCrossingInfo" = "You are currently crossing the border and therefore can't send letters. If you passed the border you can send letters again.";
"newKeyHeadline" = "No Association to Previous Mails!";
"newKeyText" = "This mail is confidential but cannot be associated to previous confidential mails. We cannot decide if a fraud tries to impersonate the sender or the sender got a new device. You should be cautions with the mail. For your safety, do not click on links. If the mail seems to be strange, contact the sender."; // Verification via phone, messenger? See contact book.
"newKeyText" = "This mail is confidential but cannot be associated to previous confidential and genuine mails. We can not decide if a fraud tries to impersonate the sender or the sender got a new device. You should be cautions with the mail. For your safety, do not click on links. If the mail seems to be strange, contact the sender."; // Verification via phone, messenger? See contact book.
"inviteContacts" = "Ask for confidential communication";
"inviteContacts.Censor" = "Show explanation";
"inviteSubject" = "Let's try to use confidential mail!";
......@@ -193,9 +193,9 @@
"fingerprintMissmatchShort" = "Fingerprint does not match!";
"fingerprintMissmatchText" = "Make sure you scanned to verify the qr code from the correct person. If you did, you might be victim of a man-in-the-middle-attack.";
"scanDifferentCode" = "Scan different QR Code";
"secureContacts" = "Confidential Contacts";
"secureCommunication" = "Confidential Communication";
"ErrorText" = "An error occured. Are you connected to the internet?";
"secureContacts" = "Genuine Contacts";
"secureCommunication" = "Confidential and genuine Communication";
"ErrorText" = "An error occurred. Are you connected to the internet?";
"about" = "About";
"YourBadges" = "Your Badges";
"copied" = "Copied key to your clipboard";
......@@ -236,7 +236,7 @@
"MailServerError.OAUTH.Body" = "Couldn't connect to server.\n Google provides a more secure access to your mail account. Please, use the specific google login.";
"MailServerError.Default.Body" = "Couldn't connect to server.\n Please, check your account name, password and server configuration. You can also compare the server configuration with the configuration listed on the website of your provider. In some cases, you have to activate the IMAP/SMTP connection in your account settings.";
"Read.Import.Secret.Title" = "New secret";
"Read.Import.Secret.Body.PW" = "Please, enter the password to import the new secret with the id: %@.";
"Read.Import.Secret.Body.PW" = "Please, enter the password to import the new secret key with the id: %@.";
"Read.Import.Secret.Body.Plain" = "Import the new secret key with the id: %@.";
"Read.Import.Secret.No" = "No import";
"Read.Import.Secret.Ok" = "Ok";
......
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFph9a4BEADQkqhIdBxaXcEARlQceyhxdT6oV8muzUwLKMmTGAYwPm4/MhqN
acYTv3fgpd94Dh2C4ge5bm9RNwBqnIUhcvahlVIghm6HQLeaTyE9dJtVAeGUlxrb
/r6PQoMqGZ73kyGh2oopEAjt5YX37rAoyyMrWLSJcAJ88T10+T8rW8CPZ1VlO4mY
0tr8llLh6/e36Y4awVOCRBoGq8bTi8ayim7AwZ3Q2KBP3WYLfxLU0/VklzZ63TRj
65yH0g8FKfEQDMbwoIjqB+IUnqV7m+1rRlMrdSwqvLaJ3R6Z29roNFWAAOabc0h4
sptJ6LKUwhoSZl9yzR5dAuxTlSCGM696otCKQ8eKp/UWTUBvAB8tXLXiRLl+9BZm
bBVg1mX02fsX2m1nQVi1InAwFNBGCBYb04Qw5uh3bnJJ+yUrcdFISgImdbG62Kan
nay0PanspLlUCfa/FZnmXc7RIm3ZpwgKeVHMUMRfT0ECitN8xwutEtwG5M7NHZK4
VVc3HvqeFqo9He2MWcxyUjcAGpQFzGlyVvM1fiOQ3glEbopGOJLXA0WOvzdnXIon
sWntB21sbLJirfUThvkwYE8/36XjVHtqJywlKziqP9884GE0h0Q/ye4+yrMI96CR
iHzYoAE3wpBkbzV3xCUF06U2mq5tzYQT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wIUIHvE
ovdiSgaEKnZCAB658BOQHRFsNoKO04oC3ibOzlck0lStiveXWmBRDPrsSOXvmOid
1vnZqzh8npZAa+7QhvCy9/AbEztqK9cASziOWHnKyqAa5exYatuWebpkU9ljk5Zs
yM0Ltm1KU03SqA==
=e4Fc
-----END PGP PUBLIC KEY BLOCK-----
......@@ -68,9 +68,6 @@ enum SecurityIndicator: Int, StudyParameterProtocol {
if button {
return IconsStyleKit.imageOfLetterButton
}
if open {
return IconsStyleKit.imageOfLetterOpen
}
if background {
return IconsStyleKit.imageOfLetterBG
}
......
......@@ -28,11 +28,13 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
let msg10 = "2 LOGIN \"sadasfai@asfaf.com\" asdadf3\r\n"
let msg11 = "2 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)\r\n"
let noJson = ["2"]
let noJson = ["2", "5"]
var result: Bool?
var expect: XCTestExpectation?
var userAdr: String?
override func setUp() {
super.setUp()
datahandler.reset()
......@@ -141,7 +143,7 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
XCTFail("No testing of config...")
}
if let expect = expect {
var time = 20
var time = 40
if !correctPW || shouldFail {
time = 60
}
......@@ -190,14 +192,14 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
if session.startTestingServerConfigFromList() {
XCTFail("Wrong test case! Json file exists.")
}
if !session.startLongSearchOfServerConfig(hostFromAdr: true) {
if !session.startLongSearchOfServerConfig(hostFromAdr: false) {
XCTFail("Could not start.")
}
expect = expectation(description: "Login result")
expect = expectation(description: "Login result: \n \(session.server.discription) \n IMAP?: \(imap)")
if let expect = expect {
var waitingTime = 10
var waitingTime = 30
if !correctPW {
waitingTime = 60
waitingTime = 250
}
wait(for: [expect], timeout: TimeInterval(waitingTime))
}
......@@ -205,7 +207,7 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
XCTAssertEqual(res, !shouldFail)
}
else {
XCTFail("No result! We should be faster.")
XCTFail("No result! We should be faster. \n \(session.server.discription) \n IMAP?: \(imap) Should fail? \(shouldFail)")
}
tearDown()
}
......@@ -247,7 +249,7 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
}
expect = expectation(description: "Login result")
if let expect = expect {
var time = 30
var time = 20
if !correctPW {
time = 50
}
......@@ -308,6 +310,44 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
XCTAssert(result ?? false, "Faild result for: \(account.name)")
}
func testMailFetch() {
let accounts = MailServerConfigurationTest.loadDetailAccounts()
guard accounts.count > 0 else {
XCTFail("No account for testing!")
return
}
if let account = accounts["1"] {
setAccount(adr: account.adr, pw: account.pw, hostIMAP: account.hostIMAP, portIMAP: account.portIMAP, conTypeIMAP: account.conTypeIMAP)
}
else {
XCTFail("No account for testing!")
}
}
private func setAccount(adr: String, pw: String, hostIMAP: String, portIMAP: String, conTypeIMAP: String) {
userAdr = adr
// IMAP
guard let imapPort = UInt32(portIMAP) else {
XCTFail("Could not set up account. Wrong imap port: \(portIMAP)")
return
}
var connType = MCOConnectionType.TLS
if conTypeIMAP == "StartTLS" {
connType = MCOConnectionType.startTLS
}
let promise = expectation(description: "Set up account: \(hostIMAP)")
let server = MailServer(sessionType: .IMAP, username: adr, password: pw, hostname: hostIMAP, port: imapPort, connectionType: connType , authType: nil, callback: {(error: MailServerConnectionError?, server: MailServer) -> () in
promise.fulfill()
self.callbackSetup(error: error, server: server)
} )
XCTAssertTrue(server.findHost())
wait(for: [promise], timeout: 1)
}
func testFinish(result: Bool) {
guard let expect = expect else {
XCTFail("No expectation!")
......@@ -317,6 +357,38 @@ class MailServerConfigurationTest: XCTestCase, MailSessionListener{
expect.fulfill()
}
private func callbackSetup(error: MailServerConnectionError?, server: MailServer) -> () {
guard error == nil else {
XCTFail("No connection to server! \(String(describing: error)) \(server.hostname) for \(server.discription)")
return
}
print("We have a connection.")
let store = server.storeToUserDefaults(mailAddr: userAdr!)
XCTAssertTrue(store)
// Test fetching mails!
let mailHandler = AppDelegate.getAppDelegate().mailHandler
print("Now load messages...")
let promise = expectation(description: "Call for mails!")
mailHandler.loadMailsForInbox(completionCallback: {(error: MailServerConnectionError?) -> () in
promise.fulfill()
self.loadMailsCallback(error: error)
})
wait(for: [promise], timeout: 90)
}
private func loadMailsCallback(error: MailServerConnectionError?) {
print("We have an answer!")
guard error == nil else {
XCTFail("Error! \(String(describing: error)) for \(String(describing: userAdr))")
return
}
var mails = 0
DataHandler.handler.allFolders.forEach{mails = mails + $0.counterMails}
print("We received mails! \(mails)")
result = true
}
private static func loadAccounts() -> [String:(name: String, pw: String)] {
let bundle = Bundle(for: self)
var newAccounts = [String:(name: String, pw: String)]()
......