imap.lisp 1023 B

123456789101112131415161718
  1. (defvar *imap-recent* 0)
  2. (defcommand imap-update-recent-count () ()
  3. (setq *imap-recent*
  4. (apply '+
  5. (mapcar (lambda (mailbox)
  6. (parse-integer
  7. (second (split-string (car (filter (lambda (str)
  8. (uiop/utility:string-suffix-p str "RECENT"))
  9. (mapcar (lambda (str)
  10. (string-trim '(#\Newline) str))
  11. (split-string (run-shell-command (format nil "curl --request 'EXAMINE ~a' --user 'oleg:~a' imap://localhost" mailbox (password-store-show "localhost/imap/oleg")) t)
  12. '(#\^M)))))
  13. '(#\space)))))
  14. '("INBOX" "majordomo"))))
  15. (mode-line-update))