diff --git a/enzevalos_iphone/InboxViewController.swift b/enzevalos_iphone/InboxViewController.swift
index 302cd8ceee92007d31b8f6b52cd0eb07f4a337e1..50cbd5ab302260fa396a8fcac6006942dadc5b4c 100644
--- a/enzevalos_iphone/InboxViewController.swift
+++ b/enzevalos_iphone/InboxViewController.swift
@@ -267,18 +267,50 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
         }
     }
     
+    /**
+     Function to be used to find mails that contain the search terms. All terms (separated by spaces) need to be contained in the search text.
+     - parameters:
+        - content: The String that will be searched
+        - searchText: Search terms (space-separated) that will be searched for
+    */
+    private func containsSearchTerms ( content : String?, searchText: String) -> Bool
+    {
+        if  searchText == ""
+        {
+            return true ///Case empty search
+        }
+        if content == nil
+        {
+            return false ///Case Mail has no body/subject
+        }
+        //var terms = searchText.characters.split(separator: " ")
+        let terms = searchText.lowercased().components(separatedBy : " ")
+        var found = true
+        for t in terms
+        {
+            found = found && content!.lowercased().contains(t)
+        }
+        return found
+    }
+    
+    /**
+    Filters emails by a user input string and scope
+     
+     - parameters:
+        -scope: 0 =
+     */
     private func _filterContentForSearchText(_ searchText: String, scope: Int = 0) {
         var records = [KeyRecord]()
         if scope == 0 || scope == 3 {
             records += folder.records.filter({ (record: KeyRecord) -> Bool in
-                return record.name.lowercased().contains(searchText.lowercased())
+                return containsSearchTerms(content: record.name, searchText: searchText)
             })
         }
         if scope == 1 || scope == 3 {
             records += folder.records.filter({ (record: KeyRecord) -> Bool in
                 let mails = record.inboxMails
                 return mails.filter({ (mail: PersistentMail) -> Bool in
-                    mail.subject?.lowercased().contains(searchText.lowercased()) ?? false
+                    containsSearchTerms(content: mail.subject, searchText: searchText)
                 }).count > 0
             })
         }
@@ -287,9 +319,9 @@ class InboxViewController: UITableViewController, InboxCellDelegator {
                 let mails = record.inboxMails
                 return mails.filter({ (mail: PersistentMail) -> Bool in
                     if let decryptedBody = mail.decryptedBody {
-                        return decryptedBody.lowercased().contains(searchText.lowercased())
+                        return  containsSearchTerms(content: decryptedBody, searchText: searchText)
                     } else if !mail.isEncrypted {
-                        return mail.body?.lowercased().contains(searchText.lowercased()) ?? false
+                        return containsSearchTerms(content: mail.body, searchText: searchText)
                     }
                     return false
                 }).count > 0