     (beginning-of-line)
     (setq-local buffer-read-only nil)
     (delete-char 1)
-    (insert "o")
+    (insert mark)
     (setq-local buffer-read-only t)))
+
+(defun olm-summary-delete ()
+  (interactive)
+  (olm-summary-refile olm-deleted-items-folder-id "D"))
+
 
 ;;; A helper function for olm-summary-mode functions.
 (defun olm-summary-message-entry-id ()

  (setq olm-folder-id (assoc-default olm-folder-name olm-folder-alist))
  (olm-scan))

(defun olm-summary-refile ()
  (interactive)
  (let* ((from (olm-summary-message-entry-id))
         (folder-name (completing-read "Refile to: "
                                       (olm-folder-names)
                                       nil
                                       t))
         (to (assoc-default folder-name olm-folder-alist))
         (n (line-number-at-pos)))
    ;; insert the destination entry id into the org-ids buffer
    (with-current-buffer (olm-buf-entry-ids)
      (goto-line n)

    (olm-do-command "Olm.default_folder_id" (current-buffer))
    (buffer-substring-no-properties (point-min) (1- (point-max)))))

(defun olm-deleted-items-folder-id ()
  (with-current-buffer (get-buffer-create "*olm-deleted-items-folder-id*")
    (erase-buffer)
    (olm-do-command "Olm.deleted_items_folder_id" (current-buffer))
    (buffer-substring-no-properties (point-min) (1- (point-max)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; buffers
