 
 (fx/defn resend-request
   [{:keys [db] :as cofx} {:keys [request-id]}]
-  (if (>= maximum-number-of-attemps
-          (get-in [:transport.inbox/current-request :attemps] db))
+  (if (<= maximum-number-of-attemps
+          (get-in db [:transport.inbox/current-request :attemps]))
     (fx/merge cofx
               {:db (update db :transport.inbox/current-request dissoc :attemps)}
               (change-mailserver))

                    (clj->js {:topic          topic
                              :mailServerPeer address
                              :symKeyID       sym-key-id
                              :from           from
                              :to             to})
                    (fn [error request-id]


(def one-day (* 24 3600))
(def seven-days (* 7 one-day))
(def maximum-number-of-attemps 2)
(def request-timeout 30)

(def connection-timeout
  "Time after which mailserver connection is considered to have failed"
  10000)

(defn- parse-json
  ;; NOTE(dmitryn) Expects JSON response like:
