mu4e is an emacs-based e-mail client. It’s based on the mu e-mail indexer/searcher. It attempts to be a super-efficient tool to withstand the daily e-mail tsunami.

To quote Prof. Shirky: It's not information overload. It's filter failure. mu4e’s mission is to be a better filter.



mu4e’s first release is as part of mu 0.9.8, end of January 2012, and the most recent one is 0.9.18, released in December 2016 (see


Context templates

Defining mu4e contexts for multiple email addresses that only differ in the “from” field and maybe signature, while automatically matching their corresponding address using their :match-func (when replying to messages) can quickly get pretty verbose and clunky. To keep it lean and avoid code duplication, one can define a function to build a context based on a template:

  (defun my-make-mu4e-context (name address signature)
    "Return a mu4e context named NAME with :match-func matching
  its ADDRESS in From or CC fields of the parent message. The
  context's `user-mail-address' is set to ADDRESS and its
  `mu4e-compose-signature' to SIGNATURE."
    (lexical-let ((addr-lex address))
      (make-mu4e-context :name name
                         :vars `((user-mail-address . ,address)
                                 (mu4e-compose-signature . ,signature))
                         (lambda (msg)
                           (when msg
                             (or (mu4e-message-contact-field-matches msg :to addr-lex)
                                 (mu4e-message-contact-field-matches msg :cc addr-lex)))))))

Then, easily define contexts:

    (setq mu4e-contexts
        `( ,(my-make-mu4e-context "main" ""
                                  "Emacs is awesome.")
           ,(my-make-mu4e-context "work" ""
                                  "A very professional signature.")
           ,(my-make-mu4e-context "other" ""
                                  "Plain text mail forever.")))