[mu4e] 我在使用Doom Emacs时,配置完mu4e后,报error in process filter: Wrong type argument: stringp, nil

大家好,

我想问一个 问题关于mu4e, 我已经用mbsyn,可以成功的收到了邮件。但是,我在配置mu4e之后,打开mu4e后会报下方的这个error。想问问大家以前遇到过,这个错误吗?有什么推荐的mu4e的配置吗?谢谢

error in process filter: Wrong type argument: stringp, nil

这个是我的配置文件。

;; mu4e setup
(after! mu4e
  (setq mu4e-root-maildir (expand-file-name "~/MailDir")
        mu4e-get-mail-command "mbsync -a -c  ~/.config/mu4e/mbsyncrc"
        mu4e-index-update-in-background t
        mu4e-use-fancy-chars t
        mu4e-view-show-addresses t
        mu4e-view-show-images t
        mu4e-compose-format-flowed t
        mu4e-compose-signature-auto-include t
        mu4e-change-filenames-when-moving t

        mu4e-attachment-dir "~/Downloads"
        mu4e-compose-signature-auto-include nil


        sendmail-program (executable-find "msmtp")
        message-send-mail-function #'smtpmail-send-it
        message-sendmail-f-is-evil t
        message-sendmail-extra-arguments '("--read-envelope-from")
        message-send-mail-function #'message-send-mail-with-sendmail

        message-citation-line-format "On %a %d %b %Y at %R, %f wrote:\n"
        message-citation-line-function 'message-insert-formatted-citation-line
        message-kill-buffer-on-exit t
        org-mu4e-convert-to-html t)
  (add-hook 'mu4e-compose-mode-hook 'turn-off-auto-fill)
  (add-hook 'mu4e-compose-mode-hook (lambda() (use-hard-newlines -1))))

;; Email alert
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)

;; Setup email account
(set-email-account! "gmail"
                    '((mu4e-sent-folder                 .       "/gmail/Sent")
                      (mu4e-drafts-folder               .       "/gmail/Drafts")
                      (mu4e-trash-folder                .       "/gmail/Trash")
                      (mu4e-refile-folder               .       "/gmail/INBOX")
                      (mu4e-maildir-shortcuts
                       '(
                         ("[Gmail].All Mail"    .       ?a)
                         ("[Gmail].Sent Mail"   .       ?s)
                         ("[Gmail].Starred"     .       ?i)
                         )
                       )
                      (message-send-mail-function       .       smtpmail-send-it)
                      (smtpmail-smtp-user               .       "[email protected]")
                      (user-mail-address                .       "[email protected]")
                      (mu4e-compose-signature . "---\nBoyang Yan")
                      (mu4e-update-interval             .       300))
                    t)

(after! org-msg
  (setq org-msg-default-alternatives nil))

M-x toggle-debug-on-error 然后把错贴出来才行

Debugger entered–Lisp error: (wrong-type-argument stringp nil) string-width(nil) mu4e~longest-of-maildirs-and-bookmarks() mu4e~main-bookmarks() mu4e~main-redraw-buffer() mu4e~main-view-real-1(nil) mu4e~main-view() mu4e~pong-handler((:pong “mu” :props (:version “1.6.7” :personal-addresses (“[email protected]”) :database-path “/home/yanboyang713/.cache/mu/xapian” :root-maildir “/home/yanboyang713/MailDir” :doccount 12182 :queries ((:query “flag:unread AND NOT flag:trashed” :count 918 :unread 918) (:query “date:today…now” :count 0 :unread 0) (:query “mime:image/" :count 1079 :unread 28) (:query “flag:flagged” :count 137 :unread 0) (:query “maildir:“nil”” :count 0 :unread 0)))) mu4e~main-view) #f(compiled-function (info) #<bytecode 0x157e52706445>)((:pong “mu” :props (:version “1.6.7” :personal-addresses (“[email protected]”) :database-path “/home/yanboyang713/.cache/mu/xapian” :root-maildir “/home/yanboyang713/MailDir” :doccount 12182 :queries ((:query “flag:unread AND NOT flag:trashed” :count 918 :unread 918) (:query “date:today…now” :count 0 :unread 0) (:query "mime:image/” :count 1079 :unread 28) (:query “flag:flagged” :count 137 :unread 0) (:query “maildir:“nil”” :count 0 :unread 0))))) mu4e~proc-filter(#<process mu4e-proc> “\3761cc\377(:pong “mu” :props (:version “1.6.7” :persona…”)

我也运行过了

[[email protected]] ➜ ~ mu index
indexing maildir /home/yanboyang713/MailDir -> store /home/yanboyang713/.cache/mu/xapian
\ indexing messages; processed: 12182; updated/new: 12182; cleaned-up: 0

@Voleking 您好谢谢您的回复,

我还想问问您发邮件用的什么?用的msmtp吗?您有什么推荐吗? 我看doom emacs的文档,推荐msmtp

To send mail, mu4e uses [smtpmail](https://www.gnu.org/software/emacs/manual/html_mono/smtpmail.html) (an Emacs library) by default. You can also run a local SMTP server like  `sendmail`  or  `postfix` , or use an SMTP forwarder such as  `msmtp`  (recommended). 

看了下 mu4e-bookmarks 那块出了问题,没看出来为啥。

就用默认的,够用,msmtp 我记得又要单独把配一波,当时懒得弄了

@Voleking 谢谢您, 我好像没有对mu4e-bookmarks, 配置呀

建议你二分自己的配置,看哪里导致的问题,或者没有配置运行 mu4e 也有问题(那就像 doom 反馈 issue)

C-h f mu4e~longest-of-maildirs-and-bookmarks 找到函数定义

(defun mu4e~longest-of-maildirs-and-bookmarks ()
  "Return the length of longest name of bookmarks and maildirs."
  (cl-loop for b in (append (mu4e-bookmarks)
                            (mu4e~maildirs-with-query))
           maximize (string-width (plist-get b :name))))

Eval 一下 (mu4e-bookmarks) (mu4e~maildirs-with-query) 看是不是有什么异常值,如果是自已引起的异常数据,则修复异常数据即可。 看一下 mu4e 的 Issues 或 Merge Requests 是不是有人在修复这个问题。 或者提一个 Merge Request 或 Issues。

急的话试一下装回旧的 mu4e 版本。

我没有用到这方面的功能,没有遇到过这个问题。

我发现了,是这块配置的问题。

(mu4e-maildir-shortcuts
                       '(
                         ("[Gmail].All Mail"    .       ?a)
                         ("[Gmail].Sent Mail"   .       ?s)
                         ("[Gmail].Starred"     .       ?i)
                         )
                       )

@tangxinfa 谢谢您的帮助,我在接着研究一下。 感觉是我的配置的问题。我刚用这个mu4e

你这是不是 mu4e-maildir-shortcuts 后面漏了一个 .

1 个赞