         ;; don't save message to Sent Messages, Gmail/IMAP takes care of this
         mu4e-sent-messages-behavior 'delete
         ;; allow for updating mail using 'U' in the main view:
-        mu4e-get-mail-command "offlineimap -o -q"
+        ;; for mbsync
+        mu4e-change-filenames-when-moving t
+        mu4e-get-mail-command "mbsync -a"
+        ;; for offlineimap
+        ;; mu4e-get-mail-command "offlineimap -o -q"
         ;; configuration for sending mail
         message-send-mail-function 'smtpmail-send-it
         smtpmail-stream-type 'starttls

        ;; compose with the current context, or ask
        mu4e-compose-context-policy 'ask-if-none
        ;; use helm/ivy
        mu4e-completing-read-function 'ido-completing-read
        ;; close message after sending it
        message-kill-buffer-on-exit t
        ;; no need to ask
        mu4e-confirm-quit nil
        ;; remove 'lists' column
        mu4e-headers-fields (assq-delete-all :mailing-list mu4e-headers-fields))

  ;; By default, mark-for-trash deletes the email completely, even from the
  ;; server. This fix sends trashed email to the trash folder, instead. Note:
  ;; you have to update your mail for them to actually show up in Trash.
  (setq mu4e-marks (assq-delete-all 'trash mu4e-marks))
  (push '(trash :char ("d" . "▼")
                :prompt "dtrash"
                :dyn-target
                (lambda (target msg) (mu4e-get-trash-folder msg))
                :action
                (lambda (docid msg target)
                  (mu4e~proc-move docid (mu4e~mark-check-target target) "+S-N")))
        mu4e-marks)

  ;; mark-as-read doesn't seem to work by default, and seems absent from
  ;; `mu4e-marks', so I add it back in.
  (push '(read :char ("!" . "◻")
               :prompt "!read"
               :show-target (lambda (target) "read")
               :action
               (lambda (docid msg target) (mu4e~proc-move docid nil "+S-N")))
        mu4e-marks)

  ;; Brighter + no mode-line in message windows
  (after! doom-themes

  :commands (mu4e mu4e-compose-new)
  :config
  (setq mu4e-maildir +email-mu4e-mail-path
        mu4e-attachment-dir "~/Downloads"
        mu4e-user-mail-address-list nil
        mu4e-update-interval nil
        mu4e-compose-format-flowed t ; visual-line-mode + auto-fill upon sending
        mu4e-view-show-addresses t
        mu4e-headers-skip-duplicates t
        ;; try to show images
        mu4e-show-images t
        mu4e-view-show-images t
