I'm trying to set up mu4e with mbsync and two gmail accounts. The structure of my Maildir is as follows:

|--> school_address
   |--> INBOX
   |--> Sent
   |--> Drafts
   |--> Trash
   |--> etc...
|--> personal_address
   |--> INBOX
   |--> Sent
   |--> Drafts
   |--> Trash
   |--> etc...

I indexed my Maildir with mu index -m ~/.mail/personal_address and mu index -m ~/.mail/school_address and was able to effectively search for emails.

The latest ineffective iteration of my mu4e configuration is as follows:

(require 'mu4e)
(setq mu4e-maildir "~/.mail")
(setq mail-user-agent 'mu4e-user-agent)
(setq user-full-name "My Name")
(setq mu4e-contexts
      `( ,(make-mu4e-context
       :name "school_address"
       :enter-func (lambda () (mu4e-message "Entering School Context"))
       :leave-func (lambda () (mu4e-message "Leaving School Context"))
       :match-func (lambda (msg)
             (when msg
               (mu4e-message-contact-field-matches msg :to "school_address@school.edu")))
       :vars '((user-mail-address . "school_address@school.edu")
           (mu4e-compose-reply-to-address "school_address@school.edu")
           (smtpmail-smtp-user . "school_address")
           (mu4e-trash-folder . "/school_address/Trash")
           (mu4e-sent-folder . "/school_address/Sent")
           (mu4e-drafts-folder . "/school_address/Drafts")))
       :name "Personal"
       :enter-func (lambda () (mu4e-message "Switch to Personal Context"))
       :match-func (lambda (msg)
             (when msg
               (string-match-p "^/personal_address" (mu4e-message-field msg :maildir))))
       :vars '((user-mail-address . "personal_address@gmail.com")
           (mu4e-compose-reply-to-address "personal_address@gmail.com")
           (user-full-name . "My Name")
           (smtpmail-smtp-user . "personal_address")
           (mu4e-trash-folder . "/personal_address/Trash")
           (mu4e-sent-folder . "/personal_address/Sent")
           (mu4e-drafts-folder . "/personal_address/Drafts")))))

;; smtp mail settings
(setq message-send-mail-function  'smtpmail-send-it
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server  "smtp.gmail.com"
      smtpmail-local-domain "gmail.com"
      smtpmail-smtp-service 587
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))

The Problems

  1. When I launch mu4e, it displays the the Main View, but when I jump to a folder with j, instead of seeing my emails, I see the message No matching messages found.

  2. When I attempt to compose an email with C or C-x m I am prompted for the context, but after selecting the context I receive the message Wrong type argument: stringp, ("school_address@school.edu") (this is true for both addresses)


  1. It seems that mu can only index one maildir at a time, so I just indexed ~/.mail. Though this allows emails to show up in the index, I have been unable to get per-context shortcuts working.

  2. Best as I can tell, I was missing a period between mu4e-compose-reply-to-address and the values.

  • Tag [elisp] does not apply here. Please do not add it back again. It's for questions about the language itself, as a Lisp dialect. – Drew Oct 2 '19 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.