Usage of Contexts

19 views
Skip to first unread message

gspe

unread,
Sep 12, 2017, 6:13:19 AM9/12/17
to mu-discuss
Hi,
I would like to use mu4e with multiple email account, reading the manual I understand that the way to go is use context and set the appropriate var in appropriate context.
One thing is not clear, where to specify the special folder

Have I to define special folders in var? Something like this:

,(make-mu4e-context
         
:name "Cycling"
         
:enter-func (lambda () (mu4e-message "Switch to the Cycling context"))
         
;; no leave-func
         
;; we match based on the maildir of the message; assume all
         
;; cycling-related messages go into the /cycling maildir
         
:match-func (lambda (msg)
                       
(when msg
                         
(string= (mu4e-message-field msg :maildir) "/cycling")))
         
:vars '( ( mu4e-drafts-folder          . "/cycling/drafts" )
                   ( mu4e-sent-folder            . "/cycling/sent" )
                   ( mu4e-trash-folder           . "/cycling/bin" )
                   ( mu4e-refile-folder          . "/cycling/archive" )

                   ( user-mail-address       . "ader...@example.com" )
                   ( user-full-name          . "AliceD" )
                   ( mu4e-compose-signature  . nil)))))

Or I have to user the same special folder name for every account?

Dirk-Jan C. Binnema

unread,
Sep 14, 2017, 1:28:20 PM9/14/17
to mu-di...@googlegroups.com

Hi Gspe,
Ultimately, a context is just a named bundle of settings (with some
hooks), and the context system allows you to switch between these
bundles. Mu4e just uses whatever values the variables currently have,
without looking at the context.

So, you can freely mix & match between contexts; e.g you can share
special folders between contexts, or keep them separately, whatever
works best for you.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
Reply all
Reply to author
Forward
0 new messages