2011-12-14 08:11:40 +01:00
|
|
|
\input texinfo.tex @c -*-texinfo-*-
|
2016-12-31 17:01:30 +01:00
|
|
|
@documentencoding UTF-8
|
2018-03-22 12:35:44 +01:00
|
|
|
@include version.texi
|
2011-12-14 08:11:40 +01:00
|
|
|
@c %**start of header
|
|
|
|
@setfilename mu4e.info
|
2018-03-22 12:35:44 +01:00
|
|
|
@settitle Mu4e @value{VERSION} user manual
|
2012-09-30 19:12:07 +02:00
|
|
|
|
|
|
|
@c Use proper quote and backtick for code sections in PDF output
|
|
|
|
@c Cf. Texinfo manual 14.2
|
|
|
|
@set txicodequoteundirected
|
|
|
|
@set txicodequotebacktick
|
2011-12-14 08:11:40 +01:00
|
|
|
@c %**end of header
|
2012-10-20 11:51:19 +02:00
|
|
|
|
2011-12-14 08:11:40 +01:00
|
|
|
@copying
|
2020-01-21 19:53:09 +01:00
|
|
|
Copyright @copyright{} 2012-2020 Dirk-Jan C. Binnema
|
2011-12-14 08:11:40 +01:00
|
|
|
|
|
|
|
@quotation
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
2012-01-01 21:48:11 +01:00
|
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
2011-12-14 08:11:40 +01:00
|
|
|
any later version published by the Free Software Foundation; with no
|
2012-01-01 21:48:11 +01:00
|
|
|
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
|
|
|
copy of the license is included in the section entitled ``GNU Free
|
|
|
|
Documentation License.''
|
2011-12-14 08:11:40 +01:00
|
|
|
@end quotation
|
|
|
|
@end copying
|
|
|
|
|
2012-09-28 16:12:09 +02:00
|
|
|
@titlepage
|
2018-06-13 12:21:22 +02:00
|
|
|
@title @t{Mu4e} --- an e-mail client for GNU Emacs
|
2018-03-22 12:35:44 +01:00
|
|
|
@subtitle version @value{VERSION}, @value{UPDATED}
|
2012-09-30 19:12:07 +02:00
|
|
|
@author Dirk-Jan C. Binnema
|
2012-09-28 16:12:09 +02:00
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
@c The following two commands start the copyright page.
|
|
|
|
@page
|
|
|
|
@vskip 0pt plus 1filll
|
|
|
|
@insertcopying
|
|
|
|
@end titlepage
|
2012-09-28 16:12:09 +02:00
|
|
|
|
|
|
|
@dircategory Emacs
|
|
|
|
@direntry
|
2018-06-13 12:21:22 +02:00
|
|
|
* Mu4e: (Mu4e). An email client for GNU Emacs.
|
2012-09-28 16:12:09 +02:00
|
|
|
@end direntry
|
|
|
|
|
|
|
|
@contents
|
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
@ifnottex
|
2011-12-14 08:11:40 +01:00
|
|
|
@node Top
|
2012-09-30 19:12:07 +02:00
|
|
|
@top mu4e manual
|
|
|
|
@end ifnottex
|
|
|
|
|
|
|
|
@iftex
|
|
|
|
@node Welcome to mu4e
|
|
|
|
@unnumbered Welcome to mu4e
|
|
|
|
@end iftex
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2018-03-22 12:35:44 +01:00
|
|
|
Welcome to @t{mu4e} @value{VERSION}.
|
2011-12-29 00:26:43 +01:00
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
@t{mu4e} (@t{mu}-for-emacs) is an e-mail client for GNU Emacs version
|
2016-07-31 10:23:38 +02:00
|
|
|
24.4 or higher, built on top of the
|
2018-03-24 12:20:00 +01:00
|
|
|
@t{mu}@footnote{@url{https://www.djcbsoftware.nl/code/mu}} e-mail search
|
2018-06-13 12:21:22 +02:00
|
|
|
engine. @t{mu4e} is optimized for quickly processing large amounts of
|
2015-12-25 08:41:35 +01:00
|
|
|
e-mail.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
Some of its highlights:
|
2012-06-26 21:47:25 +02:00
|
|
|
@itemize
|
2012-10-11 16:50:32 +02:00
|
|
|
@item Fully search-based: there are no folders@footnote{that is, instead of
|
2013-07-06 09:47:15 +02:00
|
|
|
folders, you use queries that match messages in a particular folder}, only
|
2013-10-12 15:04:12 +02:00
|
|
|
queries.
|
2012-06-26 21:47:25 +02:00
|
|
|
@item Fully documented, with example configurations
|
2012-10-11 16:50:32 +02:00
|
|
|
@item User-interface optimized for speed, with quick key strokes for common actions
|
2015-12-25 08:41:35 +01:00
|
|
|
@item Support for non-English languages (so ``angstrom'' matches ``Ångström'')
|
|
|
|
@item Asynchronous: heavy actions don't block @t{emacs}@footnote{currently,
|
|
|
|
the only exception to this is @emph{sending mail}; there are solutions
|
2016-12-31 17:01:30 +01:00
|
|
|
for that though --- see the @ref{FAQ}}
|
|
|
|
@item Support for cryptography --- signing, encrypting and decrypting
|
2013-03-17 18:43:12 +01:00
|
|
|
@item Address auto-completion based on the contacts in your messages
|
|
|
|
@item Extendable with your own snippets of elisp
|
2012-06-26 21:47:25 +02:00
|
|
|
@end itemize
|
|
|
|
|
2015-12-25 08:41:35 +01:00
|
|
|
In this manual, we go through the installation of @t{mu4e}, do some
|
|
|
|
basic configuration and explain its daily use. We also show you how you
|
2016-01-03 12:29:19 +01:00
|
|
|
can customize @t{mu4e} for your special needs.
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
At the end of the manual, there are some example configurations, to get
|
2018-06-13 12:21:22 +02:00
|
|
|
you up to speed quickly: @ref{Example configs}. There's also a
|
2016-07-31 10:23:38 +02:00
|
|
|
section with answers to frequenly asked questions, @ref{FAQ}.
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2011-12-14 08:11:40 +01:00
|
|
|
@menu
|
2016-12-31 17:01:30 +01:00
|
|
|
* Introduction:: Where to begin
|
2012-06-20 10:29:57 +02:00
|
|
|
* Getting started:: Setting things up
|
2015-12-25 08:41:35 +01:00
|
|
|
* Main view:: The @t{mu4e} overview
|
2012-09-27 16:21:45 +02:00
|
|
|
* Headers view:: Lists of message headers
|
|
|
|
* Message view:: Viewing specific messages
|
|
|
|
* Editor view:: Creating / editing messages
|
2020-02-24 20:58:45 +01:00
|
|
|
* Searching:: Some more background on searching/queries`
|
2012-06-26 21:47:25 +02:00
|
|
|
* Marking:: Marking messages and performing actions
|
2015-12-13 16:44:47 +01:00
|
|
|
* Contexts:: Defining contexts and switching between them
|
2015-12-25 08:41:35 +01:00
|
|
|
* Dynamic folders:: Folders that change based on circumstances
|
2012-06-12 09:21:44 +02:00
|
|
|
* Actions:: Defining and using custom actions
|
2012-10-11 16:50:32 +02:00
|
|
|
* Extending mu4e:: Writing code for @t{mu4e}
|
2012-01-01 21:48:11 +01:00
|
|
|
|
|
|
|
Appendices
|
2018-06-13 12:21:22 +02:00
|
|
|
* Other tools:: mu4e and the rest of the world
|
|
|
|
* Example configs:: Some examples to set you up quickly
|
2012-10-14 16:00:25 +02:00
|
|
|
* FAQ:: Common questions and answers
|
2013-02-11 22:38:14 +01:00
|
|
|
* Tips and Tricks:: Useful tips
|
2012-05-02 16:28:43 +02:00
|
|
|
* How it works:: Some notes about the implementation of @t{mu4e}
|
2018-06-13 12:21:22 +02:00
|
|
|
* Debugging:: How to debug problems in @t{mu4e}
|
|
|
|
|
2012-05-02 16:28:43 +02:00
|
|
|
* GNU Free Documentation License:: The license of this manual
|
2011-12-14 08:11:40 +01:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Introduction
|
|
|
|
@chapter Introduction
|
|
|
|
|
2016-07-31 10:23:38 +02:00
|
|
|
Let's get started!
|
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Why another e-mail client::Aren't there enough already
|
2016-12-31 17:01:30 +01:00
|
|
|
* Other mail clients::Where @t{mu4e} takes its inspiration from
|
2016-01-10 10:56:58 +01:00
|
|
|
* What mu4e does not do::Focus on the core-business, delegate the rest
|
|
|
|
* Becoming a mu4e user::Joining the club
|
2011-12-19 08:07:03 +01:00
|
|
|
@end menu
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Why another e-mail client
|
2011-12-22 23:39:32 +01:00
|
|
|
@section Why another e-mail client?
|
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
I (@t{mu4e}'s author) spend a @emph{lot} of time dealing with e-mail,
|
|
|
|
both professionally and privately. Having an efficient e-mail client
|
|
|
|
is essential. Since none of the existing ones worked the way I wanted,
|
|
|
|
I thought about creating my own.
|
2015-12-25 08:41:35 +01:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs is an integral part of my workflow, so it made a lot of
|
2015-12-25 08:41:35 +01:00
|
|
|
sense to use it for e-mail as well. And as I had already written an
|
|
|
|
e-mail search engine (@t{mu}), it seemed only logical to use that as a
|
|
|
|
basis.
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2012-01-19 20:40:26 +01:00
|
|
|
@node Other mail clients
|
|
|
|
@section Other mail clients
|
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
Under the hood, @t{mu4e} is fully search-based, similar to programs
|
|
|
|
like @t{notmuch}@footnote{@url{https://notmuchmail.org/}} and
|
2018-03-24 12:20:00 +01:00
|
|
|
@t{sup}@footnote{@url{https://sup-heliotrope.github.io/}}.
|
2015-12-25 08:41:35 +01:00
|
|
|
|
|
|
|
However, @t{mu4e}'s user-interface is quite different. @t{mu4e}'s mail
|
|
|
|
handling (deleting, moving etc.) is inspired by
|
2018-08-11 19:32:25 +02:00
|
|
|
Wanderlust@footnote{@url{http://www.gohome.org/wl/}} (another
|
2020-03-01 16:34:16 +01:00
|
|
|
Emacs-based e-mail client),
|
2016-01-03 12:29:19 +01:00
|
|
|
@t{mutt}@footnote{@url{http://www.mutt.org/}} and the @t{dired}
|
|
|
|
file-manager for emacs.
|
2011-12-23 15:48:29 +01:00
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
@t{mu4e} keeps all the `state' in your maildirs, so you can easily
|
|
|
|
switch between clients, synchronize over @abbr{IMAP}, backup with
|
|
|
|
@t{rsync} and so on. The Xapian-database that @t{mu} maintains is
|
|
|
|
mererly a @emph{cache}; if you delete it, you won't lose any
|
|
|
|
information.
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2012-06-26 21:47:25 +02:00
|
|
|
@node What mu4e does not do
|
2012-10-14 16:00:25 +02:00
|
|
|
@section What @t{mu4e} does not do
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2016-07-31 10:23:38 +02:00
|
|
|
There are a number of things that @t{mu4e} does @b{not} do, by design:
|
2012-10-14 16:00:25 +02:00
|
|
|
@itemize
|
2013-05-25 18:26:54 +02:00
|
|
|
@item @t{mu}/@t{mu4e} do @emph{not} get your e-mail messages from
|
2020-03-01 16:34:16 +01:00
|
|
|
a mail server. Nor does it sync-back any changes. Those tasks are
|
|
|
|
delegated to other tools, such as
|
2018-03-24 12:20:00 +01:00
|
|
|
@t{offlineimap}@footnote{@url{https://www.offlineimap.org/}},
|
2014-11-30 10:27:41 +01:00
|
|
|
@t{isync/mbsync}@footnote{@url{http://isync.sourceforge.net/}} or
|
2020-03-01 16:34:16 +01:00
|
|
|
@t{fetchmail}@footnote{@url{http://www.fetchmail.info/}}; As long as
|
|
|
|
the messages end up in a maildir, @t{mu4e} and @t{mu} are happy to
|
|
|
|
deal with them.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @t{mu4e} also does @emph{not} implement sending of messages; instead, it
|
2016-01-03 12:29:19 +01:00
|
|
|
depends on @t{smtpmail} (@inforef{Top,,smtpmail}), which is part of
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs. In addition, @t{mu4e} piggybacks on Gnus' message editor;
|
2012-10-11 16:50:32 +02:00
|
|
|
@inforef{Top,,message}.
|
2012-10-14 16:00:25 +02:00
|
|
|
@end itemize
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-05-02 16:28:43 +02:00
|
|
|
Thus, many of the things an e-mail client traditionally needs to do, are
|
2012-04-30 16:48:07 +02:00
|
|
|
delegated to other tools. This leaves @t{mu4e} to concentrate on what it does
|
2012-05-02 16:28:43 +02:00
|
|
|
best: quickly finding the mails you are looking for, and handle them as
|
2012-04-24 21:37:50 +02:00
|
|
|
efficiently as possible.
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@node Becoming a mu4e user
|
|
|
|
@section Becoming a @t{mu4e} user
|
|
|
|
|
2016-07-31 10:23:38 +02:00
|
|
|
If @t{mu4e} sounds like something for you, give it a shot! We're trying
|
2015-12-25 08:41:35 +01:00
|
|
|
hard to make it as easy as possible to set up and use; and while you can
|
|
|
|
use elisp in various places to augment @t{mu4e}, a lot of knowledge
|
|
|
|
about programming or elisp shouldn't be required. The idea is to provide
|
|
|
|
sensible defaults, and allow for customization.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
|
|
|
When you take @t{mu4e} into use, it's a good idea to subscribe to the
|
|
|
|
@t{mu}/@t{mu4e}-mailing
|
2018-03-24 12:20:00 +01:00
|
|
|
list@footnote{@url{https://groups.google.com/group/mu-discuss}}.
|
2013-03-17 18:43:12 +01:00
|
|
|
|
2016-02-13 17:29:40 +01:00
|
|
|
Sometimes, you might encounter some unexpected behavior while using
|
|
|
|
@t{mu4e}. It could be a bug in @t{mu4e}, it could be an issue in other
|
|
|
|
software. Or it could just be a misunderstanding. In any case, if you
|
|
|
|
want to report this (either to the mailing list or to
|
|
|
|
@url{https://github.com/djcb/mu/issues}, the latter is preferred),
|
|
|
|
please always include the following information:
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item what did you expect that should happen? what actually happened?
|
|
|
|
@item can you provide some exact steps to reproduce?
|
2016-12-31 17:01:30 +01:00
|
|
|
@item what version of @t{mu4e} and @t{emacs} were you using? What operating system?
|
|
|
|
@item can you reproduce it with @command{emacs -q} and only loading @t{mu4e}?
|
|
|
|
@item if the problem is related to some specific message, please include the raw message file (appropriately anonymized, of course)
|
2016-02-13 17:29:40 +01:00
|
|
|
@end itemize
|
2013-05-25 18:26:54 +02:00
|
|
|
|
2011-12-17 10:33:50 +01:00
|
|
|
@node Getting started
|
|
|
|
@chapter Getting started
|
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
In this chapter, we go through the installation of @t{mu4e} and its
|
|
|
|
basic setup. After we have succeeded in @ref{Getting mail}, and
|
2016-01-03 12:29:19 +01:00
|
|
|
@pxref{Indexing your messages}, we discuss the @ref{Basic
|
|
|
|
configuration}.
|
2012-03-26 20:19:11 +02:00
|
|
|
|
2012-10-01 15:42:37 +02:00
|
|
|
After these steps, @t{mu4e} should be ready to go!
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@menu
|
2012-10-14 16:00:25 +02:00
|
|
|
* Requirements:: What is needed
|
2012-09-27 16:21:45 +02:00
|
|
|
* Installation:: How to install @t{mu} and @t{mu4e}
|
|
|
|
* Getting mail:: Getting mail from a server
|
2020-02-06 19:28:24 +01:00
|
|
|
* Initializing the message store:: Settings things up
|
2012-09-27 16:21:45 +02:00
|
|
|
* Indexing your messages:: Creating and maintaining the index
|
|
|
|
* Basic configuration:: Settings for @t{mu4e}
|
|
|
|
* Folders:: Setting up standard folders
|
2016-12-31 17:01:30 +01:00
|
|
|
* Retrieval and indexing:: Doing it from @t{mu4e}
|
2012-09-27 16:21:45 +02:00
|
|
|
* Sending mail:: How to send mail
|
2012-09-28 16:12:09 +02:00
|
|
|
* Running mu4e:: Overview of the @t{mu4e} views
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@end menu
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@node Requirements
|
|
|
|
@section Requirements
|
|
|
|
|
2015-12-27 13:30:02 +01:00
|
|
|
@t{mu}/@t{mu4e} are known to work on a wide variety of Unix- and
|
2020-02-06 19:28:24 +01:00
|
|
|
Unix-like systems, including many Linux distributions, OS X and
|
2020-02-24 20:58:45 +01:00
|
|
|
FreeBSD, and even on MS-Windows (with Cygwin). Emacs 24 or
|
2020-02-06 19:28:24 +01:00
|
|
|
higher is required, as well as
|
2018-03-24 12:20:00 +01:00
|
|
|
Xapian@footnote{@url{https://xapian.org/}} and
|
2013-03-17 18:43:12 +01:00
|
|
|
GMime@footnote{@url{http://spruce.sourceforge.net/gmime/}}.
|
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
@t{mu} has optional support for the Guile 2.2 (Scheme) programming
|
2020-02-06 19:28:24 +01:00
|
|
|
language. There are also some GUI-toys, which require GTK+ 3.x and
|
2014-11-30 10:27:41 +01:00
|
|
|
Webkit.
|
2013-03-17 18:43:12 +01:00
|
|
|
|
2013-05-25 18:26:54 +02:00
|
|
|
If you intend to compile @t{mu} yourself, you need to have the typical
|
|
|
|
development tools, such as C and C++ compilers (both @command{gcc} and
|
2018-09-01 09:25:48 +02:00
|
|
|
@command{clang} should work), GNU Autotools and @command{make}, and
|
|
|
|
the development packages for GMime 3.x, GLib and Xapian. Optionally,
|
2013-05-25 18:26:54 +02:00
|
|
|
you also need the development packages for GTK+, Webkit and Guile.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Installation
|
|
|
|
@section Installation
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
@t{mu4e} is part of @t{mu} --- by installing the latter, the former is
|
|
|
|
installed as well. Some Linux distributions provide packaged versions
|
|
|
|
of @t{mu}/@t{mu4e}; if you can use those, there is no need to compile
|
|
|
|
anything yourself. However, if there are no packages for your
|
|
|
|
distribution, if they are outdated, or if you want to use the latest
|
|
|
|
development versions, you can follow the steps below.
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
First, you need make sure you have the necessary dependencies; the
|
|
|
|
details depend on your distribution. If you're using another
|
|
|
|
distribution (or another OS), the below can at least be helpful in
|
|
|
|
identifying the packages to install.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
We provide some instructions for Debian, Ubuntu and Fedora; if those do not
|
|
|
|
apply to you, you can follow either @ref{Building from a release tarball} or
|
2012-10-17 17:35:23 +02:00
|
|
|
@ref{Building from git}.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@subsection Dependencies for Debian/Ubuntu
|
2012-01-19 20:40:26 +01:00
|
|
|
|
|
|
|
@example
|
2018-09-01 09:25:48 +02:00
|
|
|
$ sudo apt-get install libgmime-3.0-dev libxapian-dev
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2018-09-01 09:25:48 +02:00
|
|
|
# get emacs 25 or higher if you don't have it yet
|
2017-10-28 10:17:03 +02:00
|
|
|
$ sudo apt-get install emacs
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2012-01-19 20:40:26 +01:00
|
|
|
# optional
|
2020-03-01 16:34:16 +01:00
|
|
|
$ sudo apt-get install guile-2.2-dev html2text xdg-utils
|
2012-10-01 15:42:37 +02:00
|
|
|
|
|
|
|
# optional: only needed for msg2pdf and mug (toy gtk+ frontend)
|
2018-05-14 14:43:45 +02:00
|
|
|
$ sudo apt-get install libwebkitgtk-3.0-dev
|
2012-01-19 20:40:26 +01:00
|
|
|
@end example
|
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@subsection Dependencies for Fedora
|
|
|
|
|
|
|
|
@example
|
2018-09-01 09:25:48 +02:00
|
|
|
$ sudo yum install gmime30-devel xapian-core-devel
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2017-10-28 10:17:03 +02:00
|
|
|
# get emacs 25 or higher if you don't have it yet
|
2012-10-11 16:50:32 +02:00
|
|
|
$ sudo yum install emacs
|
|
|
|
|
|
|
|
# optional
|
2020-03-01 16:34:16 +01:00
|
|
|
$ sudo yum install html2text xdg-utils guile22-devel
|
2012-10-11 16:50:32 +02:00
|
|
|
|
|
|
|
# optional: only needed for msg2pdf and mug (toy gtk+ frontend)
|
2013-12-17 23:40:30 +01:00
|
|
|
$ sudo yum install webkitgtk3-devel
|
2012-10-11 16:50:32 +02:00
|
|
|
@end example
|
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
@subsection Building on Msys2
|
|
|
|
@example
|
|
|
|
# 1) install makepkg tool
|
|
|
|
|
|
|
|
pacman -S base-devel msys-devel gcc git
|
|
|
|
|
|
|
|
# 2) clone packages repo
|
|
|
|
|
|
|
|
cd ~
|
|
|
|
git clone https://github.com/msys2-unofficial/MSYS2-packages.git --depth=1
|
|
|
|
|
|
|
|
# make and install dependencies
|
|
|
|
|
|
|
|
cd ~/MSYS2-packages/xapian-core
|
|
|
|
makepkg -s
|
|
|
|
pacman -U xapian-core-1.4.15-1-x86_64.pkg.tar.xz
|
|
|
|
|
|
|
|
cd ~/MSYS2-packages/gmime3
|
|
|
|
makepkg -s
|
|
|
|
pacman -U gmime3-devel-3.2.6-1-x86_64.pkg.tar.xz
|
|
|
|
|
|
|
|
# 4) make and install mu from git (changes versions as needed)
|
|
|
|
|
|
|
|
cd ~/MSYS2-packages/mu
|
|
|
|
makepkg -sfp PKGBUILD-git
|
|
|
|
pacman -U mu-git-2020-03-01-r4854.17f38dc4-1-x86_64.pkg.tar.xz
|
|
|
|
@end example
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@subsection Building from a release tarball
|
|
|
|
@anchor{Building from a release tarball}
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2012-09-29 13:24:58 +02:00
|
|
|
Using a release-tarball (as available from
|
2016-12-31 17:01:30 +01:00
|
|
|
GitHub@footnote{@url{https://github.com/djcb/mu/releases}}),
|
2013-05-25 18:26:54 +02:00
|
|
|
installation follows the typical steps:
|
2012-04-30 16:48:07 +02:00
|
|
|
|
2011-12-14 08:11:40 +01:00
|
|
|
@example
|
2011-12-17 10:33:50 +01:00
|
|
|
$ tar xvfz mu-<version>.tar.gz # use the specific version
|
2011-12-19 08:07:03 +01:00
|
|
|
$ cd mu-<version>
|
2012-10-14 20:42:51 +02:00
|
|
|
# On the BSDs: use gmake instead of make
|
|
|
|
$ ./configure && make
|
2012-06-06 23:17:18 +02:00
|
|
|
$ sudo make install
|
|
|
|
@end example
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Xapian, GMime and their dependencies must be installed.
|
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@subsection Building from git
|
2012-10-14 16:00:25 +02:00
|
|
|
@anchor{Building from git}
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2016-12-13 22:03:25 +01:00
|
|
|
Alternatively, if you build from the git repository or use a tarball
|
|
|
|
like the ones that @t{github} produces, the instructions are slightly
|
2017-10-29 10:22:22 +01:00
|
|
|
different, and require you to have autotools (@t{autoconf},
|
|
|
|
@t{automake}, @t{libtool}, @t{texinfo}) installed:
|
2012-06-06 23:17:18 +02:00
|
|
|
|
|
|
|
@example
|
2012-10-01 20:18:59 +02:00
|
|
|
# get from git (alternatively, use a github tarball)
|
2012-10-03 11:53:24 +02:00
|
|
|
$ git clone git://github.com/djcb/mu.git
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2012-10-01 20:18:59 +02:00
|
|
|
$ cd mu
|
2020-02-24 20:58:45 +01:00
|
|
|
$ ./autogen.sh && make
|
2012-10-14 20:42:51 +02:00
|
|
|
# On the BSDs: use gmake instead of make
|
2011-12-14 08:11:40 +01:00
|
|
|
$ sudo make install
|
|
|
|
@end example
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
(Xapian, GMime and their dependencies must be installed).
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
After this, @t{mu} and @t{mu4e} should be installed @footnote{there's
|
|
|
|
a hard dependency between versions of @t{mu4e} and @t{mu} --- you
|
|
|
|
cannot combine different versions} on your system, and be available
|
|
|
|
from the command line and in Emacs.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
You may need to restart Emacs, so it can find @t{mu4e} in its
|
|
|
|
@code{load-path}. If, even after restarting, Emacs cannot find
|
2013-08-24 10:17:00 +02:00
|
|
|
@t{mu4e}, you may need to add it to your @code{load-path} explicitly; check
|
|
|
|
where @t{mu4e} is installed, and add something like the following to your
|
2012-10-14 20:42:51 +02:00
|
|
|
configuration before trying again:
|
|
|
|
@lisp
|
2016-12-31 17:01:30 +01:00
|
|
|
;; the exact path may differ --- check it
|
2012-10-14 20:42:51 +02:00
|
|
|
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
|
|
|
|
@end lisp
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2012-04-02 19:00:42 +02:00
|
|
|
@subsection mu4e and emacs customization
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
There is some support for using the Emacs customization system in
|
2012-10-01 20:18:59 +02:00
|
|
|
@t{mu4e}, but for now, we recommend setting the values manually. Please refer
|
2018-06-13 12:21:22 +02:00
|
|
|
to @ref{Example configs} for a couple of examples of this; here we go
|
2012-10-01 20:18:59 +02:00
|
|
|
through things step-by-step.
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Getting mail
|
|
|
|
@section Getting mail
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
In order for @t{mu} (and, by extension, @t{mu4e}) to work, you need to
|
|
|
|
have your e-mail messages stored in a
|
|
|
|
@emph{maildir}@footnote{@url{https://en.wikipedia.org/wiki/Maildir};
|
|
|
|
in this manual we use the term `maildir' for both the standard and the
|
|
|
|
hierarchy of maildirs that store your messages} --- a specific
|
2020-03-31 20:11:25 +02:00
|
|
|
directory structure with one-file-per-message.
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2020-03-31 20:11:25 +02:00
|
|
|
If you are already using a maildir, you are lucky. If not, some setup
|
|
|
|
is required:
|
2012-10-11 16:50:32 +02:00
|
|
|
@itemize
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @emph{Using an external IMAP or POP server} --- if you are using an
|
2012-10-16 20:43:49 +02:00
|
|
|
@abbr{IMAP} or @abbr{POP} server, you can use tools like @t{getmail},
|
2020-02-06 19:28:24 +01:00
|
|
|
@t{fetchmail}, @t{offlineimap} or @t{isync} to download your messages
|
|
|
|
into a maildir (@file{~/Maildir}, often). Because it is such a common
|
|
|
|
case, there is a full example of setting @t{mu4e} up with
|
|
|
|
@t{offlineimap} and Gmail; @pxref{Gmail configuration}.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @emph{Using a local mail server} --- if you are using a local mail-server
|
2020-02-06 19:28:24 +01:00
|
|
|
(such as @t{postfix} or @t{qmail}), you can teach them to deliver into
|
|
|
|
a maildir as well, maybe in combination with @t{procmail}. A bit of
|
|
|
|
googling should be able to provide you with the details.
|
2012-10-11 16:50:32 +02:00
|
|
|
@end itemize
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2020-03-31 20:11:25 +02:00
|
|
|
The maildir must be on a single file-system; and symbolic links are
|
|
|
|
not supported.
|
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
@node Initializing the message store
|
|
|
|
@section Initializing the message store
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
The first time you run @t{mu}, you need to initialize its store
|
2020-02-06 19:28:24 +01:00
|
|
|
(database). The default location for that is @t{~/.cache/mu/xapian},
|
|
|
|
but you can change this using the @t{--muhome} option, and remember to
|
|
|
|
pass that to the other commands as well.
|
|
|
|
|
|
|
|
Assuming that your maildir is at @file{~/Maildir}, we issue the
|
|
|
|
following command:
|
|
|
|
@example
|
|
|
|
$ mu init --maildir=~/Maildir
|
|
|
|
@end example
|
|
|
|
|
|
|
|
Optionally, you can add some e-mail addresses, so @t{mu} recognizes
|
|
|
|
them as yours:
|
|
|
|
|
|
|
|
@example
|
|
|
|
$ mu init --maildir=~/Maildir --my-address=jim@@example.com --my-address=bob@@example.com
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@t{mu} remembers the maildir and your addresses and uses them when
|
|
|
|
indexing messages. If you want to change them, you need to @t{init}
|
|
|
|
once again.
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
If you want to see the current values, you can use @command{mu info}.
|
2020-02-06 19:28:24 +01:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Indexing your messages
|
|
|
|
@section Indexing your messages
|
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
After you have succeeded in @ref{Getting mail} and initialized the
|
|
|
|
message database, we need to @emph{index} the messages. That is --- we
|
|
|
|
need to scan the messages in the maildir and store the information
|
|
|
|
about them in a special database.
|
|
|
|
|
|
|
|
We can do that from @t{mu4e} --- @ref{Main view}, but the first time,
|
|
|
|
it is a good idea to run it from the command line, which makes it
|
|
|
|
easier to verify that everything works correctly.
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2013-08-24 10:17:00 +02:00
|
|
|
Assuming that your maildir is at @file{~/Maildir}, we issue the following
|
2012-10-01 20:18:59 +02:00
|
|
|
command:
|
2011-12-17 10:33:50 +01:00
|
|
|
@example
|
2020-02-06 19:28:24 +01:00
|
|
|
$ mu index
|
2011-12-17 10:33:50 +01:00
|
|
|
@end example
|
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
This should scan your messages and fill the database, and give
|
|
|
|
progress information while doing so.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
The indexing process may take a few minutes the first time you do it
|
|
|
|
(for thousands of e-mails); afterwards it is much faster, since @t{mu}
|
|
|
|
only scans messages that are new or have changed. Indexing is discussed
|
|
|
|
in full detail in the @t{mu-index} man-page.
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2012-04-24 21:37:50 +02:00
|
|
|
After the indexing process has finished, you can quickly test if everything
|
2012-10-11 16:50:32 +02:00
|
|
|
worked, by trying some command-line searches, for example
|
2011-12-17 10:33:50 +01:00
|
|
|
@example
|
2016-01-12 20:38:07 +01:00
|
|
|
$ mu find hello
|
2011-12-17 10:33:50 +01:00
|
|
|
@end example
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2013-08-24 10:17:00 +02:00
|
|
|
which lists all messages that match @t{hello}. For more examples of searches,
|
|
|
|
see @ref{Queries}, or check the @t{mu-find} and @t{mu-easy} man pages. If all
|
|
|
|
of this worked well, we are well on our way setting things up; the next step
|
|
|
|
is to do some basic configuration for @t{mu4e}.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
|
|
|
@node Basic configuration
|
|
|
|
@section Basic configuration
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
Before we can start using @t{mu4e}, we need to tell Emacs to load
|
2012-10-14 16:00:25 +02:00
|
|
|
it. So, add to your @file{~/.emacs} (or its moral equivalent, such as
|
2012-09-27 16:21:45 +02:00
|
|
|
@file{~/.emacs.d/init.el}) something like:
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-10-01 20:18:59 +02:00
|
|
|
@lisp
|
2012-04-24 21:37:50 +02:00
|
|
|
(require 'mu4e)
|
2012-10-01 20:18:59 +02:00
|
|
|
@end lisp
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
If Emacs complains that it cannot find @t{mu4e}, check your
|
2012-10-17 10:15:07 +02:00
|
|
|
@code{load-path} and make sure that @t{mu4e}'s installation directory is part
|
|
|
|
of it. If not, you can add it:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'load-path MU4E-PATH)
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
with @t{MU4E-PATH} replaced with the actual path.
|
|
|
|
|
2012-04-24 21:37:50 +02:00
|
|
|
@node Folders
|
|
|
|
@section Folders
|
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
The next step is to tell @t{mu4e} where it can find your Maildir, and
|
2016-12-31 17:01:30 +01:00
|
|
|
some special folders.
|
2015-12-29 17:47:12 +01:00
|
|
|
|
|
|
|
So, for example@footnote{Note that the folders (@t{mu4e-sent-folder},
|
|
|
|
@t{mu4e-drafts-folder}, @t{mu4e-trash-folder} and
|
2014-11-30 10:27:41 +01:00
|
|
|
@t{mu4e-refile-folder}) can also be @emph{functions} that are evaluated
|
|
|
|
at runtime. This allows for dynamically changing them depending on the
|
2015-12-29 17:47:12 +01:00
|
|
|
situation. See @ref{Dynamic folders} for details.}:
|
2012-04-24 21:37:50 +02:00
|
|
|
@lisp
|
2016-01-10 10:56:58 +01:00
|
|
|
;; these are actually the defaults
|
|
|
|
(setq
|
2016-01-12 20:38:07 +01:00
|
|
|
mu4e-sent-folder "/sent" ;; folder for sent messages
|
|
|
|
mu4e-drafts-folder "/drafts" ;; unfinished messages
|
|
|
|
mu4e-trash-folder "/trash" ;; trashed messages
|
|
|
|
mu4e-refile-folder "/archive") ;; saved messages
|
2012-04-24 21:37:50 +02:00
|
|
|
@end lisp
|
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
Note, the folder names are all relative to the root-maildir (see the
|
2020-02-24 20:58:45 +01:00
|
|
|
output of @command{mu info}). If you use @t{mu4e-context}, see
|
|
|
|
@ref{Contexts and special folders} for what that means for these
|
|
|
|
special folders.
|
2015-12-29 17:47:12 +01:00
|
|
|
|
2012-10-01 15:42:37 +02:00
|
|
|
@node Retrieval and indexing
|
2014-11-30 10:27:41 +01:00
|
|
|
@section Retrieval and indexing with mu4e
|
2012-10-01 15:42:37 +02:00
|
|
|
|
|
|
|
As we have seen, we can do all of the mail retrieval @emph{outside} of
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs/@t{mu4e}. However, you can also do it from within
|
2015-12-21 21:15:47 +01:00
|
|
|
@t{mu4e}.
|
2014-11-30 10:27:41 +01:00
|
|
|
|
|
|
|
@subsection Basics
|
2015-12-21 21:15:47 +01:00
|
|
|
|
2019-11-06 16:13:39 +01:00
|
|
|
To set up mail-retrieval from within @t{mu4e}, set the variable
|
2014-11-30 10:27:41 +01:00
|
|
|
@code{mu4e-get-mail-command} to the program or shell command you want to
|
|
|
|
use for retrieving mail. You can then get your e-mail using @kbd{M-x
|
|
|
|
mu4e-update-mail-and-index}, or @kbd{C-S-u} in all @t{mu4e}-views;
|
|
|
|
alternatively, you can use @kbd{C-c C-u}, which may be more convenient
|
|
|
|
if you use emacs in a terminal.
|
2012-10-25 10:59:50 +02:00
|
|
|
|
2016-12-27 15:52:20 +01:00
|
|
|
You can kill the (foreground) update process with @kbd{q}.
|
2013-10-12 15:04:12 +02:00
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
It is possible to update your mail and index periodically in the
|
2016-02-27 16:12:49 +01:00
|
|
|
background or foreground, by setting the variable
|
|
|
|
@code{mu4e-update-interval} to the number of seconds between these
|
|
|
|
updates. If set to @code{nil}, it won't update at all. After you make
|
|
|
|
changes to @code{mu4e-update-interval}, @t{mu4e} must be restarted
|
|
|
|
before the changes take effect. By default, this will run in
|
|
|
|
background and to change it to run in foreground, set
|
2016-12-31 17:01:30 +01:00
|
|
|
@code{mu4e-index-update-in-background} to @code{nil}.
|
2014-11-30 10:27:41 +01:00
|
|
|
|
|
|
|
@subsection Handling errors during mail retrieval
|
|
|
|
|
|
|
|
If the mail-retrieval process returns with a non-zero exit code,
|
2015-12-25 08:41:35 +01:00
|
|
|
@t{mu4e} shows a warning (unless @code{mu4e-index-update-error-warning}
|
|
|
|
is set to @code{nil}), but then try to index your maildirs anyway
|
|
|
|
(unless @code{mu4e-index-update-error-continue} is set to @code{nil}).
|
2014-11-30 10:27:41 +01:00
|
|
|
|
|
|
|
Reason for these defaults is that some of the mail-retrieval programs
|
|
|
|
may return non-zero, even when the updating process succeeded; however,
|
2016-12-31 17:01:30 +01:00
|
|
|
it is hard to tell such pseudo-errors from real ones like `login
|
2014-11-30 10:27:41 +01:00
|
|
|
failed'.
|
|
|
|
|
|
|
|
If you need more refinement, it may be useful to wrap the mail-retrieval
|
|
|
|
program in a shell-script, for example @t{fetchmail} returns 1 to
|
2016-12-31 17:01:30 +01:00
|
|
|
indicate `no mail'; we can handle that with:
|
2014-11-30 10:27:41 +01:00
|
|
|
@lisp
|
2016-01-10 10:56:58 +01:00
|
|
|
(setq mu4e-get-mail-command "fetchmail -v || [ $? -eq 1 ]")
|
2014-11-30 10:27:41 +01:00
|
|
|
@end lisp
|
|
|
|
A similar approach can be used with other mail retrieval programs,
|
|
|
|
although not all of them have their exit codes documented.
|
|
|
|
|
2015-12-21 21:15:47 +01:00
|
|
|
@subsection Implicit mail retrieval
|
2014-11-30 10:27:41 +01:00
|
|
|
|
|
|
|
If you don't have a specific command for getting mail, for example
|
|
|
|
because you are running your own mail-server, you can leave
|
|
|
|
@code{mu4e-get-mail-command} at @t{"true"} (the default), in which case
|
|
|
|
@t{mu4e} won't try to get new mail, but still re-index your messages.
|
|
|
|
|
2016-07-24 11:49:49 +02:00
|
|
|
@subsection Speeding up indexing
|
|
|
|
|
|
|
|
If you have a large number of e-mail messages in your store,
|
2018-11-04 11:48:52 +01:00
|
|
|
(re)indexing might take a while. The defaults for indexing are to
|
|
|
|
ensure that we always have correct, up-to-date information about your
|
|
|
|
messages, even if other programs have modified the Maildir.
|
2016-07-24 11:49:49 +02:00
|
|
|
|
|
|
|
The downside of this thoroughness (which is the default) is that it is
|
|
|
|
relatively slow, something that can be noticeable with large e-mail
|
2020-03-14 23:58:31 +01:00
|
|
|
corpa on slow file-systems. For a faster approach, you can use the
|
|
|
|
following:
|
2016-07-24 11:49:49 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq
|
2020-03-14 23:58:31 +01:00
|
|
|
mu4e-index-cleanup nil ;; don't do a full cleanup check
|
2016-07-24 11:49:49 +02:00
|
|
|
mu4e-index-lazy-check t) ;; don't consider up-to-date dirs
|
|
|
|
@end lisp
|
|
|
|
|
2020-03-09 19:21:39 +01:00
|
|
|
In many cases, the mentioned thoroughness might not be needed, and
|
|
|
|
these settings give a very significant speed-up. Note that you can of
|
|
|
|
course occasionally run a thorough indexing round.
|
2018-11-04 11:48:52 +01:00
|
|
|
|
|
|
|
For further details, please refer to the @t{mu-index} manpage; in
|
|
|
|
particular, see @t{.noindex} and @t{.noupdate} which can help reducing
|
|
|
|
the indexing time.
|
2016-07-24 11:49:49 +02:00
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
@subsection Example setup
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2012-10-01 20:18:59 +02:00
|
|
|
A simple setup could look something like:
|
2012-10-01 15:42:37 +02:00
|
|
|
|
|
|
|
@lisp
|
2012-10-03 11:53:24 +02:00
|
|
|
(setq
|
2016-01-12 20:38:07 +01:00
|
|
|
mu4e-get-mail-command "offlineimap" ;; or fetchmail, or ...
|
|
|
|
mu4e-update-interval 300) ;; update every 5 minutes
|
2012-10-01 15:42:37 +02:00
|
|
|
@end lisp
|
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
A hook @code{mu4e-update-pre-hook} is available which is run right
|
|
|
|
before starting the process. That can be useful, for example, to
|
|
|
|
influence, @code{mu4e-get-mail-command} based on the the current
|
|
|
|
situation (location, time of day, ...).
|
2013-10-13 20:44:47 +02:00
|
|
|
|
2014-11-30 10:27:41 +01:00
|
|
|
It is possible to get notifications when the indexing process does any
|
2016-12-31 17:01:30 +01:00
|
|
|
updates --- for example when receiving new mail. See
|
2014-11-30 10:27:41 +01:00
|
|
|
@code{mu4e-index-updated-hook} and some tips on its usage in the
|
|
|
|
@ref{FAQ}.
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2011-12-20 07:45:07 +01:00
|
|
|
@node Sending mail
|
|
|
|
@section Sending mail
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@t{mu4e} re-uses Gnus' @code{message-mode} (@inforef{Top,,message}) for
|
2012-10-11 19:04:18 +02:00
|
|
|
writing mail and inherits the setup for sending mail as well.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-10-01 20:18:59 +02:00
|
|
|
For sending mail using @abbr{SMTP}, @t{mu4e} uses @t{smtpmail}
|
2015-11-22 11:17:36 +01:00
|
|
|
(@inforef{Top,,smtpmail}). This package supports many different ways to
|
|
|
|
send mail; please refer to its documentation for the details.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
Here, we only provide some simple examples --- for more, see
|
|
|
|
@ref{Example configs}.
|
2011-12-20 07:45:07 +01:00
|
|
|
|
2012-10-11 19:04:18 +02:00
|
|
|
A very minimal setup:
|
2011-12-20 07:45:07 +01:00
|
|
|
|
2012-03-26 20:19:11 +02:00
|
|
|
@lisp
|
2011-12-20 07:45:07 +01:00
|
|
|
;; tell message-mode how to send mail
|
|
|
|
(setq message-send-mail-function 'smtpmail-send-it)
|
|
|
|
;; if our mail server lives at smtp.example.org; if you have a local
|
2012-01-19 20:40:26 +01:00
|
|
|
;; mail-server, simply use 'localhost' here.
|
2011-12-20 07:45:07 +01:00
|
|
|
(setq smtpmail-smtp-server "smtp.example.org")
|
2012-03-26 20:19:11 +02:00
|
|
|
@end lisp
|
2011-12-20 07:45:07 +01:00
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
Since @t{mu4e} (re)uses the same @t{message mode} and @t{smtpmail} that Gnus
|
|
|
|
uses, many settings for those also apply to @t{mu4e}.
|
2011-12-20 07:45:07 +01:00
|
|
|
|
2012-10-01 20:18:59 +02:00
|
|
|
@subsection Dealing with sent messages
|
|
|
|
|
2012-10-11 19:04:18 +02:00
|
|
|
By default, @t{mu4e} puts a copy of messages you sent in the folder determined
|
2012-10-14 16:00:25 +02:00
|
|
|
by @code{mu4e-sent-folder}. In some cases, this may not be what you want -
|
2012-10-11 19:04:18 +02:00
|
|
|
for example, when using Gmail-over-@abbr{IMAP}, this interferes with Gmail's
|
2012-10-11 16:50:32 +02:00
|
|
|
handling of the sent messages folder, and you may end up with duplicate
|
|
|
|
messages.
|
|
|
|
|
2013-07-06 09:47:15 +02:00
|
|
|
You can use the variable @code{mu4e-sent-messages-behavior} to customize what
|
|
|
|
happens with sent messages. The default is the symbol @code{sent} which, as
|
|
|
|
mentioned, causes the message to be copied to your sent-messages folder. Other
|
|
|
|
possible values are the symbols @code{trash} (the sent message is moved to the
|
|
|
|
trash-folder (@code{mu4e-trash-folder}), and @code{delete} to simply discard
|
2015-03-21 17:28:20 +01:00
|
|
|
the sent message altogether (so Gmail can deal with it).
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
|
2012-10-11 19:04:18 +02:00
|
|
|
For Gmail-over-@abbr{IMAP}, you could add the following to your settings:
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
@verbatim
|
2012-09-30 19:12:07 +02:00
|
|
|
;; don't save messages to Sent Messages, Gmail/IMAP takes care of this
|
2012-10-11 16:50:32 +02:00
|
|
|
(setq mu4e-sent-messages-behavior 'delete)
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
@end verbatim
|
2012-10-01 20:18:59 +02:00
|
|
|
And that's it! We should now be ready to go.
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2015-03-21 17:28:20 +01:00
|
|
|
For more complex needs, @code{mu4e-sent-messages-behavior} can also be
|
2016-12-31 17:01:30 +01:00
|
|
|
a parameter-less function that returns one of the mentioned symbols;
|
2015-03-21 17:28:20 +01:00
|
|
|
see the built-in documentation for the variable.
|
2013-04-21 11:49:26 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Running mu4e
|
2012-09-27 16:21:45 +02:00
|
|
|
@section Running mu4e
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2015-03-21 17:28:20 +01:00
|
|
|
After following the steps in this chapter, we now (hopefully!) have a
|
|
|
|
working @t{mu4e} setup. Great! In the next chapters, we walk you
|
|
|
|
through the various views in @t{mu4e}.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-09-27 16:21:45 +02:00
|
|
|
For your orientation, the diagram below shows how the views relate to each
|
2012-10-11 16:50:32 +02:00
|
|
|
other, and the default key-bindings to navigate between them.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
|
|
|
@verbatim
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
[C] +--------+ [RFCE]
|
|
|
|
--------> | editor | <--------
|
|
|
|
/ +--------+ \
|
|
|
|
/ [RFCE]^ \
|
2016-01-10 10:56:58 +01:00
|
|
|
/ | \
|
2016-01-12 20:38:07 +01:00
|
|
|
+-------+ [sjbB]+---------+ [RET] +---------+
|
|
|
|
| main | <---> | headers | <----> | message |
|
|
|
|
+-------+ [q] +---------+ [qbBjs] +---------+
|
|
|
|
[sjbB] ^
|
2016-01-10 10:56:58 +01:00
|
|
|
[.] | [q]
|
2016-01-12 20:38:07 +01:00
|
|
|
V
|
|
|
|
+-----+
|
|
|
|
| raw |
|
|
|
|
+-----+
|
2016-01-10 10:56:58 +01:00
|
|
|
|
|
|
|
Default bindings
|
|
|
|
----------------
|
|
|
|
R: Reply s: search .: raw view (toggle)
|
|
|
|
F: Forward j: jump-to-maildir q: quit
|
|
|
|
C: Compose b: bookmark-search
|
|
|
|
E: Edit B: edit bookmark-search
|
2012-10-11 16:50:32 +02:00
|
|
|
|
|
|
|
@end verbatim
|
|
|
|
@end cartouche
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Main view
|
2012-09-30 19:12:07 +02:00
|
|
|
@chapter The main view
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-01-19 20:40:26 +01:00
|
|
|
After you have installed @t{mu4e} (@pxref{Getting started}), you can start it
|
2012-10-14 16:00:25 +02:00
|
|
|
with @kbd{M-x mu4e}. @t{mu4e} does some checks to ensure everything is set up
|
|
|
|
correctly, and then shows you the @t{mu4e} main view. Its major mode is
|
|
|
|
@code{mu4e-main-mode}.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@menu
|
2016-07-31 10:23:38 +02:00
|
|
|
* Overview: MV Overview. What is the main view
|
2016-01-10 10:56:58 +01:00
|
|
|
* Basic actions::What can we do
|
2016-07-31 10:23:38 +02:00
|
|
|
* Bookmarks: MV Bookmarks. Jumping to other places
|
2016-01-10 10:56:58 +01:00
|
|
|
* Miscellaneous::Notes
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node MV Overview
|
|
|
|
@section Overview
|
|
|
|
|
|
|
|
The main view looks something like the following:
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2011-12-17 10:33:50 +01:00
|
|
|
@verbatim
|
2020-03-05 21:25:28 +01:00
|
|
|
* mu4e - mu for emacs version @value{VERSION}
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Basics
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
* [j]ump to some maildir
|
|
|
|
* enter a [s]earch query
|
|
|
|
* [C]ompose a new message
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Bookmarks
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
* [bu] Unread messages (26119/26119)
|
|
|
|
* [bt] Today's messages (1/7)
|
|
|
|
* [bw] Last 7 days (30/126)
|
|
|
|
* [bp] Messages with images (268/2309)
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Misc
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2017-01-03 01:17:29 +01:00
|
|
|
* [;]Switch context
|
2016-01-12 20:38:07 +01:00
|
|
|
* [U]pdate email & database
|
2020-03-05 21:25:28 +01:00
|
|
|
* toggle [m]ail sending mode (currently direct)
|
2016-01-12 20:38:07 +01:00
|
|
|
|
|
|
|
* [N]ews
|
|
|
|
* [A]bout mu4e
|
|
|
|
* [H]elp
|
|
|
|
* [q]uit
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
Info
|
|
|
|
|
|
|
|
* database-path : /home/user/.cache/mu/xapian
|
|
|
|
* maildir : /home/user/Maildir
|
|
|
|
* in store : 78825 messages
|
2011-12-17 10:33:50 +01:00
|
|
|
@end verbatim
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-10-17 22:36:35 +02:00
|
|
|
Let's walk through the menu.
|
2012-10-22 19:27:49 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Basic actions
|
|
|
|
@section Basic actions
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2011-12-17 10:33:50 +01:00
|
|
|
First, the @emph{Basics}:
|
|
|
|
@itemize
|
2012-09-30 19:12:07 +02:00
|
|
|
@item @t{[j]ump to some maildir}: after pressing @key{j} (``jump''),
|
2020-02-06 19:28:24 +01:00
|
|
|
@t{mu4e} asks you for a maildir to visit. These are the maildirs you
|
|
|
|
set in @ref{Basic configuration} and any of your own. If you choose
|
|
|
|
@key{o} (``other'') or @key{/}, you can choose from all maildirs under
|
|
|
|
the root-maildir. After choosing a maildir, the messages in that
|
|
|
|
maildir are listed, in the @ref{Headers view}.
|
2012-09-30 19:12:07 +02:00
|
|
|
@item @t{enter a [s]earch query}: after pressing @key{s}, @t{mu4e} asks
|
|
|
|
you for a search query, and after entering one, shows the results in the
|
|
|
|
@ref{Headers view}.
|
2012-10-11 16:50:32 +02:00
|
|
|
@item @t{[C]ompose a new message}: after pressing @key{C}, you are dropped in
|
|
|
|
the @ref{Editor view} to write a new message.
|
2011-12-19 08:07:03 +01:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node MV Bookmarks
|
|
|
|
@section Bookmarks
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2020-01-21 19:53:09 +01:00
|
|
|
The next item in the Main view is @emph{Bookmarks}.
|
|
|
|
|
|
|
|
Bookmarks are predefined queries with a descriptive name and a
|
|
|
|
shortcut --- in the example above, we see the default bookmarks. You
|
|
|
|
can view the list of messages matching a certain bookmark by pressing
|
|
|
|
@key{b} followed by the bookmark's shortcut. If you'd like to edit the
|
|
|
|
bookmarked query first before invoking it, use @key{B}.
|
|
|
|
|
|
|
|
Next to each bookmark there is the number of (unread/all) messages
|
|
|
|
that match.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Bookmarks are stored in the variable @code{mu4e-bookmarks}; you can add your
|
2020-02-24 20:58:45 +01:00
|
|
|
own and/or replace the default ones; @xref{Bookmarks}. For instance:
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-bookmarks
|
|
|
|
;; add bookmark for recent messages on the Mu mailing list.
|
|
|
|
'( :name "Mu7Days"
|
|
|
|
:key ?m
|
|
|
|
:query "list:mu-discuss.googlegroups.com AND date:7d..now"))
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
There are optional keys @t{:hide} to hide the bookmark from the main
|
2020-05-04 20:02:57 +02:00
|
|
|
menu, but still have it available (using @key{b})) and
|
2020-02-24 20:58:45 +01:00
|
|
|
@t{:hide-unread} to avoid generating the unread-number; that can be
|
2020-05-04 20:02:57 +02:00
|
|
|
useful if you have bookmarks for slow queries. Note that
|
|
|
|
@t{:hide-unread} is implied when the query is not a string; this for
|
|
|
|
the common case where the query function involves some user input,
|
|
|
|
which would be disruptive in this case.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Miscellaneous
|
|
|
|
@section Miscellaneous
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2012-06-12 09:21:44 +02:00
|
|
|
Finally, there are some @emph{Misc} (miscellaneous) actions:
|
2011-12-19 08:07:03 +01:00
|
|
|
@itemize
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @t{[U]pdate email & database} executes the shell-command in the variable
|
2016-01-10 10:56:58 +01:00
|
|
|
@code{mu4e-get-mail-command}, and afterwards updates the @t{mu} database;
|
2012-10-25 10:59:50 +02:00
|
|
|
see @ref{Indexing your messages} and @ref{Getting mail} for details.
|
2012-09-30 19:12:07 +02:00
|
|
|
@item @t{toggle [m]ail sending mode (direct)} toggles between sending
|
2011-12-19 08:07:03 +01:00
|
|
|
mail directly, and queuing it first (for example, when you are offline), and
|
2012-09-30 19:12:07 +02:00
|
|
|
@t{[f]lush queued mail} flushes any queued mail. This item is visible only
|
2012-10-14 16:00:25 +02:00
|
|
|
if you have actually set up mail-queuing. @ref{Queuing mail}
|
|
|
|
@item @t{[A]bout mu4e} provides general information about the program
|
|
|
|
@item @t{[H]elp} shows help information for this view
|
|
|
|
@item Finally, @t{[q]uit mu4e} quits your @t{mu4e}-session
|
2011-12-19 08:07:03 +01:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@node Headers view
|
2012-09-30 19:12:07 +02:00
|
|
|
@chapter The headers view
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2015-03-21 17:28:20 +01:00
|
|
|
The headers view shows the results of a query. The header-line shows
|
|
|
|
the names of the fields. Below that, there is a line with those
|
|
|
|
fields, for each matching message, followed by a footer line. The
|
|
|
|
major-mode for the headers view is @code{mu4e-headers-mode}.
|
2012-09-29 12:30:49 +02:00
|
|
|
|
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Overview: HV Overview. What is the Header View
|
|
|
|
* Keybindings::Do things with your keyboard
|
2016-02-16 07:15:40 +01:00
|
|
|
* Marking: HV Marking. Selecting messages for doing things
|
2016-07-31 10:23:38 +02:00
|
|
|
* Sorting and threading::Influencing the display
|
2016-02-16 07:15:40 +01:00
|
|
|
* Custom headers: HV Custom headers. Adding your own headers
|
|
|
|
* Actions: HV Actions. Defining and using actions
|
2016-01-10 10:56:58 +01:00
|
|
|
* Split view::Seeing both headers and messages
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node HV Overview
|
|
|
|
@section Overview
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
An example headers view:
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2011-12-19 08:07:03 +01:00
|
|
|
@verbatim
|
2013-03-19 21:51:17 +01:00
|
|
|
Date V Flgs From/To List Subject
|
2018-04-25 03:17:38 +02:00
|
|
|
06:32 Nu To Edmund Dantès GstDev Gstreamer-V4L2SINK ...
|
|
|
|
15:08 Nu Abbé Busoni GstDev ├> ...
|
|
|
|
18:20 Nu Pierre Morrel GstDev │└> ...
|
|
|
|
07:48 Nu To Edmund Dantès GstDev └> ...
|
|
|
|
2013-03-18 S Jacopo EmacsUsr emacs server on win...
|
|
|
|
2013-03-18 S Mercédès EmacsUsr └> ...
|
|
|
|
2013-03-18 S Beachamp EmacsUsr Re: Copying a whole...
|
|
|
|
22:07 Nu Albert de Moncerf EmacsUsr └> ...
|
|
|
|
2013-03-18 S Gaspard Caderousse GstDev Issue with GESSimpl...
|
|
|
|
2013-03-18 Ss Baron Danglars GuileUsr Guile-SDL 0.4.2 ava...
|
2011-12-19 08:07:03 +01:00
|
|
|
End of search results
|
|
|
|
@end verbatim
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-04-06 10:00:39 +02:00
|
|
|
Some notes to explain what you see in the example:
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@itemize
|
|
|
|
@item The fields shown in the headers view can be influenced by customizing
|
2012-10-14 16:00:25 +02:00
|
|
|
the variable @code{mu4e-headers-fields}; see @code{mu4e-header-info} for the
|
2013-10-05 19:09:26 +02:00
|
|
|
list of built-in fields. Apart from the built-in fields, you can also create
|
2013-10-12 15:04:12 +02:00
|
|
|
custom fields using @code{mu4e-header-info-custom}; see @ref{HV Custom
|
|
|
|
headers} for details.
|
2012-10-19 11:02:13 +02:00
|
|
|
@item By default, the date is shown with the @t{:human-date} field, which
|
|
|
|
shows the @emph{time} for today's messages, and the @emph{date} for older
|
2019-03-11 13:30:19 +01:00
|
|
|
messages. If you do not want to distinguish between `today' and `older', you can use
|
2012-10-19 11:02:13 +02:00
|
|
|
the @t{:date} field instead.
|
|
|
|
@item You can customize the date and time formats with the variable
|
2012-10-22 19:27:49 +02:00
|
|
|
@code{mu4e-headers-date-format} and @code{mu4e-headers-time-format},
|
2019-03-11 13:30:19 +01:00
|
|
|
respectively. In the example, we use @code{:human-date}, which shows the
|
2013-03-19 21:51:17 +01:00
|
|
|
time when the message was sent today, and the date otherwise.
|
2015-03-22 10:49:57 +01:00
|
|
|
@item By default, the subject is shown using the @t{:subject} field;
|
|
|
|
however, it is also possible to use @t{:thread-subject}, which shows
|
|
|
|
the subject of a thread only once, similar to the display of the
|
|
|
|
@t{mutt} e-mail client.
|
2012-10-11 16:50:32 +02:00
|
|
|
@item The header field used for sorting is indicated by ``@t{V}'' or
|
2015-03-22 10:49:57 +01:00
|
|
|
``@t{^}''@footnote{or you can use little graphical triangles; see
|
|
|
|
variable @code{mu4e-use-fancy-chars}}, corresponding to the sort order
|
|
|
|
(descending or ascending, respectively). You can influence this by a
|
|
|
|
mouse click, or @key{O}. Not all fields allow sorting.
|
2012-05-02 21:14:54 +02:00
|
|
|
@item Instead of showing the @t{From:} and @t{To:} fields separately, you
|
2012-10-14 16:00:25 +02:00
|
|
|
can use From/To (@t{:from-or-to} in @code{mu4e-headers-fields} as a more
|
2012-05-02 21:14:54 +02:00
|
|
|
compact way to convey the most important information: it shows @t{From:}
|
2016-12-31 17:01:30 +01:00
|
|
|
@emph{except} when the e-mail was sent by the user (i.e., you) --- in that case
|
2012-05-13 14:02:40 +02:00
|
|
|
it shows @t{To:} (prefixed by @t{To}@footnote{You can customize this by
|
2012-10-14 16:00:25 +02:00
|
|
|
changing the variable @code{mu4e-headers-from-or-to-prefix} (a cons cell)}, as
|
2020-04-09 21:07:58 +02:00
|
|
|
in the example above).
|
2016-12-31 17:01:30 +01:00
|
|
|
@item The `List' field shows the mailing-list a message is sent to;
|
2013-03-19 21:51:17 +01:00
|
|
|
@code{mu4e} tries to create a convenient shortcut for the mailing-list name;
|
2015-11-15 11:35:23 +01:00
|
|
|
the variable @code{mu4e-user-mailing-lists} can be used to add your
|
|
|
|
your own shortcuts. You can use @code{mu4e-mailing-list-patterns} to
|
|
|
|
to specify generic shortcuts, e.g. to shorten list names which contain
|
2016-12-31 17:01:30 +01:00
|
|
|
dots (@t{mu4e} defaults to shortening up to the first dot):
|
2015-11-15 11:35:23 +01:00
|
|
|
@lisp
|
2015-11-16 14:42:24 +01:00
|
|
|
(setq mu4e-mailing-list-patterns '(``\\([-_a-z0-9.]+\\)\.lists\.company\.com'')))
|
2015-11-15 11:35:23 +01:00
|
|
|
@end lisp
|
2016-12-31 17:01:30 +01:00
|
|
|
@item The letters in the `Flags' field correspond to the following: D=@emph{draft},
|
|
|
|
F=@emph{flagged} (i.e., `starred'), N=@emph{new}, P=@emph{passed} (i.e.,
|
2012-10-16 20:43:49 +02:00
|
|
|
forwarded), R=@emph{replied}, S=@emph{seen}, T=@emph{trashed},
|
|
|
|
a=@emph{has-attachment}, x=@emph{encrypted}, s=@emph{signed},
|
|
|
|
u=@emph{unread}. The tooltip for this field also contains this information.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item The subject field also indicates the discussion threads @footnote{using
|
|
|
|
Jamie Zawinski's mail threading algorithm,
|
2018-03-24 12:20:00 +01:00
|
|
|
@url{https://www.jwz.org/doc/threading.html}}.
|
2012-10-24 17:36:50 +02:00
|
|
|
@item The headers view is @emph{automatically updated} if any changes are
|
2013-06-12 09:09:19 +02:00
|
|
|
found during the indexing process, and if there is no current
|
2012-10-24 17:36:50 +02:00
|
|
|
user-interaction. If you do not want such automatic updates, set
|
|
|
|
@code{mu4e-headers-auto-update} to @code{nil}.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item Just before executing a search, a hook-function
|
2016-02-19 06:39:52 +01:00
|
|
|
@code{mu4e-headers-search-hook} is invoked, which receives the search
|
|
|
|
expression as its parameter.
|
2016-02-18 19:59:02 +01:00
|
|
|
@item Also, there is a hook-function @code{mu4e-headers-found-hook} available which
|
2013-10-13 20:44:47 +02:00
|
|
|
is invoked just after @t{mu4e} has completed showing the messages in the
|
|
|
|
headers-view.
|
2011-12-17 10:33:50 +01:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Keybindings
|
|
|
|
@section Keybindings
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Using the below key bindings, you can do various things with these messages;
|
2020-03-05 19:50:51 +01:00
|
|
|
these actions are also listed in the @t{Mu4e} menu in the Emacs
|
2012-10-14 16:00:25 +02:00
|
|
|
menu bar.
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2011-12-19 21:11:47 +01:00
|
|
|
@verbatim
|
|
|
|
key description
|
2012-06-14 10:13:00 +02:00
|
|
|
===========================================================
|
2014-11-28 07:54:08 +01:00
|
|
|
n,p view the next, previous message
|
|
|
|
],[ move to the next, previous unread message
|
2012-04-09 10:52:49 +02:00
|
|
|
y select the message view (if it's visible)
|
2012-06-14 10:13:00 +02:00
|
|
|
RET open the message at point in the message view
|
2012-05-06 15:58:00 +02:00
|
|
|
|
2012-06-14 10:13:00 +02:00
|
|
|
searching
|
|
|
|
---------
|
2012-05-06 15:58:00 +02:00
|
|
|
s search
|
2012-06-07 15:30:33 +02:00
|
|
|
S edit last query
|
2012-05-06 15:58:00 +02:00
|
|
|
/ narrow the search
|
|
|
|
b search bookmark
|
2012-05-10 08:56:02 +02:00
|
|
|
B edit bookmark before search
|
2012-04-01 23:59:55 +02:00
|
|
|
j jump to maildir
|
2014-12-09 06:27:48 +01:00
|
|
|
M-left,\ previous query
|
2012-05-10 08:56:02 +02:00
|
|
|
M-right next query
|
2012-05-06 15:58:00 +02:00
|
|
|
|
2012-06-10 10:19:51 +02:00
|
|
|
O change sort order
|
|
|
|
P toggle threading
|
2012-06-11 23:34:56 +02:00
|
|
|
Q toggle full-search
|
2012-12-27 15:27:53 +01:00
|
|
|
V toggle skip-duplicates
|
|
|
|
W toggle include-related
|
2012-04-01 23:59:55 +02:00
|
|
|
|
2012-06-14 10:13:00 +02:00
|
|
|
marking
|
|
|
|
-------
|
2012-04-01 23:59:55 +02:00
|
|
|
d mark for moving to the trash folder
|
2014-08-08 13:18:29 +02:00
|
|
|
= mark for removing trash flag ('untrash')
|
2012-09-27 16:21:45 +02:00
|
|
|
DEL,D mark for complete deletion
|
2012-04-01 23:59:55 +02:00
|
|
|
m mark for moving to another maildir folder
|
2012-09-27 16:21:45 +02:00
|
|
|
r mark for refiling
|
2012-05-13 14:02:40 +02:00
|
|
|
+,- mark for flagging/unflagging
|
2012-09-28 16:12:09 +02:00
|
|
|
?,! mark message as unread, read
|
2012-06-14 10:13:00 +02:00
|
|
|
|
2012-04-01 23:59:55 +02:00
|
|
|
u unmark message at point
|
2012-06-20 19:42:39 +02:00
|
|
|
U unmark *all* messages
|
2012-06-14 10:13:00 +02:00
|
|
|
|
2012-04-24 21:37:50 +02:00
|
|
|
% mark based on a regular expression
|
2012-04-28 08:12:54 +02:00
|
|
|
T,t mark whole thread, subthread
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2014-08-21 04:11:39 +02:00
|
|
|
<insert>,* mark for 'something' (decide later)
|
2012-10-06 19:47:59 +02:00
|
|
|
# resolve deferred 'something' marks
|
2012-06-14 18:10:02 +02:00
|
|
|
|
2012-06-14 10:13:00 +02:00
|
|
|
x execute actions for the marked messages
|
|
|
|
|
|
|
|
composition
|
|
|
|
-----------
|
2012-04-01 23:59:55 +02:00
|
|
|
R,F,C reply/forward/compose
|
|
|
|
E edit (only allowed for draft messages)
|
|
|
|
|
2012-04-18 18:10:48 +02:00
|
|
|
|
2012-06-14 10:13:00 +02:00
|
|
|
misc
|
|
|
|
----
|
2017-01-03 01:17:29 +01:00
|
|
|
; switch context
|
2012-06-14 10:13:00 +02:00
|
|
|
a execute some custom action on a header
|
|
|
|
| pipe message through shell command
|
2012-05-14 09:45:39 +02:00
|
|
|
C-+,C-- increase / decrease the number of headers shown
|
2011-12-19 21:11:47 +01:00
|
|
|
H get help
|
2012-10-25 10:59:50 +02:00
|
|
|
C-S-u update mail & reindex
|
2016-02-06 11:48:14 +01:00
|
|
|
q leave the headers buffer
|
2011-12-19 21:11:47 +01:00
|
|
|
@end verbatim
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node HV Marking
|
|
|
|
@section Marking
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2013-08-24 10:17:00 +02:00
|
|
|
You can @emph{mark} messages for a certain action, such as deletion or
|
|
|
|
move. After one or more messages are marked, you can then execute
|
|
|
|
(@code{mu4e-mark-execute-all}, @key{x}) these actions. This two-step
|
|
|
|
mark-execute sequence is similar to what e.g. @t{dired} does. It is how
|
|
|
|
@t{mu4e} tries to be as quick as possible, while avoiding accidents.
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
The mark/unmark commands support the @emph{region} (i.e., ``selection'') ---
|
2012-10-11 16:50:32 +02:00
|
|
|
so, for example, if you select some messages and press @key{DEL}, all messages
|
|
|
|
in the region are marked for deletion.
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2012-05-13 14:02:40 +02:00
|
|
|
You can mark all messages that match a certain pattern with @key{%}. In
|
|
|
|
addition, you can mark all messages in the current thread (@key{T}) or
|
|
|
|
sub-thread (@key{t}).
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
When you do a new search or refresh the headers buffer while you still have
|
2016-12-31 17:01:30 +01:00
|
|
|
marked messages, you are asked what to do with those marks --- whether to
|
2012-10-14 16:00:25 +02:00
|
|
|
@emph{apply} them before leaving, or @emph{ignore} them. This behavior can be
|
|
|
|
influenced with the variable @code{mu4e-headers-leave-behavior}.
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
For more information about marking, see @ref{Marking}.
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2016-07-31 10:23:38 +02:00
|
|
|
@node Sorting and threading
|
|
|
|
@section Sorting and threading
|
2012-06-10 10:19:51 +02:00
|
|
|
|
|
|
|
By default, @t{mu4e} sorts messages by date, in descending order: the most
|
2012-06-12 09:21:44 +02:00
|
|
|
recent messages are shown at the top. In addition, the messages are
|
2012-10-14 16:00:25 +02:00
|
|
|
@emph{threaded}, i.e., shown in the context of a discussion thread; this also
|
2012-06-12 09:21:44 +02:00
|
|
|
affects the sort order.
|
2012-06-10 10:19:51 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
The header field used for sorting is indicated by ``@t{V}'' or
|
|
|
|
``@t{^}''@footnote{or you can use little graphical triangles; see variable
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-use-fancy-chars}}, indicating the sort order (descending or
|
2012-10-17 17:35:23 +02:00
|
|
|
ascending, respectively).
|
2012-10-11 16:50:32 +02:00
|
|
|
|
|
|
|
You can change the sort order by clicking the corresponding field with the
|
2012-10-14 16:00:25 +02:00
|
|
|
mouse, or with @kbd{M-x mu4e-headers-change-sorting} (@key{O}); note that not
|
2012-10-11 16:50:32 +02:00
|
|
|
all fields can be used for sorting. You can toggle threading on/off using
|
2012-10-14 16:00:25 +02:00
|
|
|
@kbd{M-x mu4e-headers-toggle-threading} or @key{P}. For both of these functions,
|
2012-10-11 16:50:32 +02:00
|
|
|
unless you provide a prefix argument (@key{C-u}), the current search is
|
|
|
|
updated immediately using the new parameters. You can toggle full-search
|
2012-10-14 16:00:25 +02:00
|
|
|
(@ref{Searching}) using @kbd{M-x mu4e-headers-toggle-full-search} or @key{Q}.
|
2012-06-10 10:19:51 +02:00
|
|
|
|
|
|
|
If you want to change the defaults for these settings, you can use the
|
2016-12-27 16:08:02 +01:00
|
|
|
variables @code{mu4e-headers-sort-field} and
|
|
|
|
@code{mu4e-headers-show-threads}, as well as
|
|
|
|
@code{mu4e-headers-change-sorting} to change the sorting of the current
|
|
|
|
search results.
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2013-10-12 15:04:12 +02:00
|
|
|
@node HV Custom headers
|
|
|
|
@section Custom headers
|
|
|
|
|
|
|
|
Sometimes the normal headers that @t{mu4e} offers (Date, From, To, Subject
|
|
|
|
etc.) may not be enough. For these cases, @t{mu4e} offers @emph{custom
|
|
|
|
headers} in both the headers-view and the message-view.
|
|
|
|
|
|
|
|
You can do so by adding a description of your custom header to
|
|
|
|
@code{mu4e-header-info-custom}, which is a list of custom headers.
|
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
Let's look at an example --- suppose we want to add a custom header that
|
|
|
|
shows the number of recipients for a message, i.e., the sum of the
|
|
|
|
number of recipients in the @t{To:} and @t{Cc:} fields. Let's further
|
|
|
|
suppose that our function takes a message-plist as its argument
|
|
|
|
(@ref{Message functions}).
|
2013-10-12 15:04:12 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-header-info-custom
|
2016-01-12 20:38:07 +01:00
|
|
|
'(:recipnum .
|
|
|
|
( :name "Number of recipients" ;; long name, as seen in the message-view
|
|
|
|
:shortname "Recip#" ;; short name, as seen in the headers view
|
|
|
|
:help "Number of recipients for this message" ;; tooltip
|
|
|
|
:function (lambda (msg)
|
|
|
|
(format "%d"
|
|
|
|
(+ (length (mu4e-message-field msg :to))
|
|
|
|
(length (mu4e-message-field msg :cc))))))))
|
2013-10-12 15:04:12 +02:00
|
|
|
@end lisp
|
|
|
|
|
2014-11-22 12:23:01 +01:00
|
|
|
Or, let's get the full mailing-list name:
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-header-info-custom
|
2016-01-12 20:38:07 +01:00
|
|
|
'(:full-mailing-list .
|
|
|
|
( :name "Mailing-list" ;; long name, as seen in the message-view
|
|
|
|
:shortname "ML" ;; short name, as seen in the headers view
|
|
|
|
:help "Full name for mailing list" ;; tooltip
|
|
|
|
:function (lambda (msg)
|
|
|
|
(or (mu4e-message-field msg :mailing-list) "")))))
|
2014-11-22 12:23:01 +01:00
|
|
|
@end lisp
|
2013-10-12 15:04:12 +02:00
|
|
|
|
2014-11-22 12:23:01 +01:00
|
|
|
You can then add the custom header to your @code{mu4e-headers-fields},
|
2016-12-31 17:01:30 +01:00
|
|
|
just like the built-in headers. After evaluation, your headers-view
|
2014-11-22 12:23:01 +01:00
|
|
|
should include a new header @t{Recip#} with the number of recipients,
|
|
|
|
and/or @t{ML} with the full mailing-list name.
|
|
|
|
|
|
|
|
This function can be used in both the headers-view and the message-view;
|
|
|
|
if you need something specific for one of these, you can check for the
|
|
|
|
mode in your function, or create separate functions.
|
2013-10-12 15:04:12 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node HV Actions
|
|
|
|
@section Actions
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-06-12 09:21:44 +02:00
|
|
|
@code{mu4e-headers-action} (@key{a}) lets you pick custom actions to perform
|
2012-04-21 11:48:00 +02:00
|
|
|
on the message at point. You can specify these actions using the variable
|
2012-10-11 16:50:32 +02:00
|
|
|
@code{mu4e-headers-actions}. See @ref{Actions} for the details.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu4e} defines some default actions. One of those is for @emph{capturing} a
|
2016-12-31 17:01:30 +01:00
|
|
|
message: @key{a c} `captures' the current message. Next, when you're editing
|
2012-10-14 16:00:25 +02:00
|
|
|
some message, you can include the previously captured message as an
|
|
|
|
attachment, using @code{mu4e-compose-attach-captured-message}. See
|
|
|
|
@file{mu4e-actions.el} in the @t{mu4e} source distribution for more example
|
|
|
|
actions.
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Split view
|
|
|
|
@section Split view
|
2012-04-08 19:28:49 +02:00
|
|
|
|
2012-06-12 09:21:44 +02:00
|
|
|
Using the @emph{Split view}, we can see the @ref{Headers view} and the
|
2012-10-14 16:00:25 +02:00
|
|
|
@ref{Message view} next to each other, with the message selected in the
|
|
|
|
former, visible in the latter. You can influence the way the splitting is done
|
|
|
|
by customizing the variable @code{mu4e-split-view}. Possible values are:
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-04-08 19:28:49 +02:00
|
|
|
@itemize
|
|
|
|
@item @t{horizontal} (this is the default): display the message view below the
|
2012-10-14 16:00:25 +02:00
|
|
|
header view. Use @code{mu4e-headers-visible-lines} the set the number of lines
|
|
|
|
shown (default: 8).
|
2012-04-11 01:11:47 +02:00
|
|
|
@item @t{vertical}: display the message view on the
|
2012-10-14 16:00:25 +02:00
|
|
|
right side of the header view. Use @code{mu4e-headers-visible-columns} to set
|
|
|
|
the number of visible columns (default: 30).
|
2017-05-18 03:42:52 +02:00
|
|
|
@item @t{single-window}: single window mode. Single-window mode tries to
|
|
|
|
minimize mu4e window operations (opening, killing, resizing, etc) and buffer
|
|
|
|
changes, while still retaining the view and headers buffers. In addition, it
|
|
|
|
replaces mu4e main view with a minibuffer prompt containing the same
|
|
|
|
information.
|
2012-04-09 10:52:49 +02:00
|
|
|
@item anything else: don't do any splitting
|
2012-04-08 19:28:49 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
Some useful key bindings in the split view:
|
|
|
|
@itemize
|
|
|
|
@item @key{C-+} and @key{C--}: interactively change the number of columns or
|
|
|
|
headers shown
|
|
|
|
@item You can change the selected window from the
|
|
|
|
headers-view to the message-view and vice-versa with
|
|
|
|
@code{mu4e-select-other-view}, bound to @key{y}
|
|
|
|
@end itemize
|
2012-04-08 19:28:49 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Message view
|
2012-09-30 19:12:07 +02:00
|
|
|
@chapter The message view
|
2011-12-17 10:33:50 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
After selecting a message in the @ref{Headers view}, it appears in a message
|
2013-08-24 10:17:00 +02:00
|
|
|
view window, which shows the message headers, followed by the message
|
|
|
|
body. Its major mode is @code{mu4e-view-mode}.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
Note, the current message view is to be replaced by a new one, based on
|
|
|
|
Gnus' article-mode. It is available now as a 'tech preview', which you
|
|
|
|
can try by setting @code{mu4e-view-use-gnus} to @code{t} before starting
|
|
|
|
@code{mu4e}.
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Overview: MSGV Overview. What is the Message View
|
|
|
|
* Keybindings: MSGV Keybindings. Do things with your keyboard
|
|
|
|
* Attachments:: Opening and saving them
|
|
|
|
* Viewing images inline::Images display inside emacs
|
|
|
|
* Displaying rich-text messages::Dealing with HTML mail
|
|
|
|
* Verifying signatures and decryption: MSGV Crypto. Support for cryptography
|
|
|
|
* Custom headers: MSGV Custom headers. Your own headers
|
|
|
|
* Actions: MSGV Actions. Defining and using actions.
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node MSGV Overview
|
|
|
|
@section Overview
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
An example message view:
|
2012-02-05 09:56:37 +01:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2011-12-19 08:07:03 +01:00
|
|
|
@verbatim
|
2016-01-12 20:38:07 +01:00
|
|
|
From: randy@epiphyte.com
|
|
|
|
To: julia@eruditorum.org
|
|
|
|
Subject: Re: some pics
|
|
|
|
Flags: (seen attach)
|
|
|
|
Date: Mon 19 Jan 2004 09:39:42 AM EET
|
|
|
|
Maildir: /inbox
|
|
|
|
Attachments(2): [1]DSCN4961.JPG(1.3M), [2]DSCN4962.JPG(1.4M)
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Hi Julia,
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Some pics from our trip to Cerin Amroth. Enjoy!
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
All the best,
|
|
|
|
Randy.
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
On Sun 21 Dec 2003 09:06:34 PM EET, Julia wrote:
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
[....]
|
2011-12-19 08:07:03 +01:00
|
|
|
@end verbatim
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2011-12-19 08:07:03 +01:00
|
|
|
|
|
|
|
Some notes:
|
|
|
|
@itemize
|
2013-10-05 19:09:26 +02:00
|
|
|
@item The variable @code{mu4e-view-fields} determines the header fields to be
|
|
|
|
shown; see @code{mu4e-header-info} for a list of built-in fields. Apart from
|
|
|
|
the built-in fields, you can also create custom fields using
|
2013-10-12 15:04:12 +02:00
|
|
|
@code{mu4e-header-info-custom}; see @ref{MSGV Custom headers}.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item You can set the date format with the variable
|
|
|
|
@code{mu4e-date-format-long}.
|
|
|
|
@item By default, only the names of contacts in address fields are visible
|
|
|
|
(see @code{mu4e-view-show-addresses} to change this). You can view the e-mail
|
|
|
|
addresses by clicking on the name, or pressing @key{M-RET}.
|
|
|
|
@item You can compose a message for the contact at point by either clicking
|
|
|
|
@key{[mouse-2]} or pressing @key{C}.
|
2014-12-29 21:54:26 +01:00
|
|
|
@item The body text can be line-wrapped using @t{visual-line-mode}. @t{mu4e}
|
2012-09-16 21:34:11 +02:00
|
|
|
defines @key{w} to toggle between the wrapped and unwrapped state. If you want
|
2014-12-29 21:54:26 +01:00
|
|
|
to do this automatically when viewing a message, invoke @code{visual-line-mode}
|
2012-10-14 16:00:25 +02:00
|
|
|
in your @code{mu4e-view-mode-hook}.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item For messages that support it, you can toggle between html and text versions using
|
|
|
|
@code{mu4e-view-toggle-html}, bound to @key{h};
|
2015-12-27 13:30:02 +01:00
|
|
|
@item You can hide cited parts
|
|
|
|
in messages (the parts starting with ``@t{>}'') using
|
|
|
|
@code{mu4e-view-hide-cited}, bound to @key{#}. If you want to do this
|
2012-09-16 21:34:11 +02:00
|
|
|
automatically for every message, invoke the function in your
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-view-mode-hook}.
|
2012-05-06 15:58:00 +02:00
|
|
|
@item For search-related operations, see @ref{Searching}.
|
2012-10-17 17:35:23 +02:00
|
|
|
@item You can scroll down the message using @key{SPC}; if you do this at the
|
|
|
|
end of a message,it automatically takes you to the next one. If you want to
|
2012-10-17 11:07:57 +02:00
|
|
|
prevent this behavior, set @code{mu4e-view-scroll-to-next} to @code{nil}.
|
2011-12-19 08:07:03 +01:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node MSGV Keybindings
|
|
|
|
@section Keybindings
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2020-03-05 19:50:51 +01:00
|
|
|
You can find most things you can do with this message in the @emph{Mu4e} menu,
|
2012-02-06 18:48:33 +01:00
|
|
|
or by using the keyboard; the default bindings are:
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2011-12-19 21:11:47 +01:00
|
|
|
@verbatim
|
|
|
|
key description
|
2012-06-14 18:10:02 +02:00
|
|
|
==============================================================
|
2014-11-28 07:54:08 +01:00
|
|
|
n,p view the next, previous message
|
|
|
|
],[ move to the next, previous unread message
|
2012-04-09 10:52:49 +02:00
|
|
|
y select the headers view (if it's visible)
|
2012-04-01 23:59:55 +02:00
|
|
|
|
2012-07-03 20:37:30 +02:00
|
|
|
RET scroll down
|
|
|
|
M-RET open URL at point / attachment at point
|
|
|
|
|
2012-10-17 11:07:57 +02:00
|
|
|
SPC scroll down, if at end, move to next message
|
2014-12-04 22:44:27 +01:00
|
|
|
S-SPC scroll up
|
2012-10-17 11:07:57 +02:00
|
|
|
|
2012-06-14 18:10:02 +02:00
|
|
|
searching
|
|
|
|
---------
|
2012-05-06 15:58:00 +02:00
|
|
|
s search
|
2012-05-10 08:56:02 +02:00
|
|
|
e edit last query
|
2012-05-06 15:58:00 +02:00
|
|
|
/ narrow the search
|
|
|
|
b search bookmark
|
2012-05-10 08:56:02 +02:00
|
|
|
B edit bookmark before search
|
2012-04-01 23:59:55 +02:00
|
|
|
j jump to maildir
|
2012-05-06 15:58:00 +02:00
|
|
|
|
2012-05-10 08:56:02 +02:00
|
|
|
M-left previous query
|
2012-05-13 14:02:40 +02:00
|
|
|
M-right next query
|
2012-04-01 23:59:55 +02:00
|
|
|
|
2012-06-14 18:10:02 +02:00
|
|
|
marking
|
|
|
|
-------
|
2011-12-19 21:11:47 +01:00
|
|
|
d mark for moving to the trash folder
|
2014-08-08 13:18:29 +02:00
|
|
|
= mark for removing trash flag ('untrash')
|
2012-09-27 16:21:45 +02:00
|
|
|
DEL,D mark for complete deletion
|
2011-12-19 21:11:47 +01:00
|
|
|
m mark for moving to another maildir folder
|
2012-09-27 16:21:45 +02:00
|
|
|
r mark for refiling
|
2012-05-13 14:02:40 +02:00
|
|
|
+,- mark for flagging/unflagging
|
2012-06-14 18:10:02 +02:00
|
|
|
|
2011-12-19 21:11:47 +01:00
|
|
|
u unmark message at point
|
2012-06-20 19:42:39 +02:00
|
|
|
U unmark *all* messages
|
2012-06-14 18:10:02 +02:00
|
|
|
|
2012-04-24 21:37:50 +02:00
|
|
|
% mark based on a regular expression
|
2012-04-28 08:12:54 +02:00
|
|
|
T,t mark whole thread, subthread
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2014-08-21 04:11:39 +02:00
|
|
|
<insert>,* mark for 'something' (decide later)
|
2012-10-06 19:47:59 +02:00
|
|
|
# resolve deferred 'something' marks
|
2012-06-14 18:10:02 +02:00
|
|
|
|
|
|
|
x execute actions for the marked messages
|
|
|
|
|
|
|
|
composition
|
|
|
|
-----------
|
2011-12-19 21:11:47 +01:00
|
|
|
R,F,C reply/forward/compose
|
|
|
|
E edit (only allowed for draft messages)
|
|
|
|
|
2012-06-14 18:10:02 +02:00
|
|
|
actions
|
|
|
|
-------
|
2011-12-19 21:11:47 +01:00
|
|
|
g go to (visit) numbered URL (using `browse-url')
|
2016-01-10 10:56:58 +01:00
|
|
|
(or: <mouse-1> or M-RET with point on url)
|
|
|
|
C-u g visits multiple URLs
|
2016-01-10 12:06:10 +01:00
|
|
|
f fetch (download )the numbered URL.
|
|
|
|
C-u f fetches multiple URLs
|
2015-03-21 14:22:12 +01:00
|
|
|
k save the numbered URL in the kill-ring.
|
2016-01-10 10:56:58 +01:00
|
|
|
C-u k saves multiple URLs
|
2015-03-21 14:22:12 +01:00
|
|
|
|
2017-10-09 21:11:10 +02:00
|
|
|
e extract (save) one or more attachments (asks for numbers)
|
2016-01-10 10:56:58 +01:00
|
|
|
(or: <mouse-2> or S-RET with point on attachment)
|
2011-12-26 11:18:44 +01:00
|
|
|
o open attachment (asks for number)
|
2016-01-10 10:56:58 +01:00
|
|
|
(or: <mouse-1> or M-RET with point on attachment)
|
2012-06-14 18:10:02 +02:00
|
|
|
|
|
|
|
a execute some custom action on the message
|
|
|
|
A execute some custom action on an attachment
|
|
|
|
|
|
|
|
misc
|
|
|
|
----
|
2017-01-03 01:17:29 +01:00
|
|
|
; switch context
|
2013-04-15 22:41:26 +02:00
|
|
|
c copy address at point (with C-u copy long version)
|
2015-12-27 09:28:11 +01:00
|
|
|
|
|
|
|
h toggle between html/text (if available)
|
2011-12-19 21:11:47 +01:00
|
|
|
w toggle line wrapping
|
2015-12-27 13:30:02 +01:00
|
|
|
# toggle show/hide cited parts
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-07-19 10:42:38 +02:00
|
|
|
v show details about the cryptographic signature
|
|
|
|
|
2012-06-14 18:10:02 +02:00
|
|
|
. show the raw message view. 'q' takes you back.
|
|
|
|
C-+,C-- increase / decrease the number of headers shown
|
2011-12-19 21:11:47 +01:00
|
|
|
H get help
|
2012-10-25 10:59:50 +02:00
|
|
|
C-S-u update mail & reindex
|
2016-02-06 11:48:14 +01:00
|
|
|
q leave the message view
|
2011-12-19 21:11:47 +01:00
|
|
|
@end verbatim
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-04-28 08:12:54 +02:00
|
|
|
For the marking commands, please refer to @ref{Marking messages}.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Attachments
|
|
|
|
@section Attachments
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2012-10-03 11:53:24 +02:00
|
|
|
By default, @t{mu4e} uses the @t{xdg-open}-program
|
2018-03-24 12:20:00 +01:00
|
|
|
@footnote{@url{https://www.freedesktop.org/wiki/Software/xdg-utils/}} or (on
|
|
|
|
OS X) the @t{open} program for opening attachments. If you want to use another
|
|
|
|
program, you do so by setting the @t{MU_PLAY_PROGRAM} environment variable to
|
|
|
|
the program to be used.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2020-04-06 19:47:29 +02:00
|
|
|
The default directory for attaching and extracting (saving)
|
|
|
|
attachmentsis your home directory (@file{~/}); you can change this
|
|
|
|
using the variable @code{mu4e-attachment-dir}, for example:
|
2012-03-28 18:00:26 +02:00
|
|
|
|
|
|
|
@lisp
|
2020-03-05 21:25:28 +01:00
|
|
|
(setq mu4e-attachment-dir "~/Downloads")
|
2012-10-03 11:53:24 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
For more flexibility, @code{mu4e-attachment-dir} can also be a user-provided
|
2012-10-03 11:53:24 +02:00
|
|
|
function. This function receives two parameters: the file-name and the
|
2013-08-24 10:17:00 +02:00
|
|
|
mime-type as found in the e-mail message@footnote{sadly, often
|
|
|
|
@t{application/octet-stream} is used for the mime-type, even if a better type
|
|
|
|
is available} of the attachment, either or both of which can be @t{nil}. For
|
|
|
|
example:
|
2012-10-03 11:53:24 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq mu4e-attachment-dir
|
2016-01-12 20:38:07 +01:00
|
|
|
(lambda (fname mtype)
|
|
|
|
(cond
|
|
|
|
;; docfiles go to ~/Desktop
|
|
|
|
((and fname (string-match "\\.doc$" fname)) "~/Desktop")
|
|
|
|
;; ... other cases ...
|
|
|
|
(t "~/Downloads")))) ;; everything else
|
2012-03-28 18:00:26 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
You can extract multiple attachments at once by prefixing the extracting
|
|
|
|
command by @key{C-u}; so @kbd{C-u e} asks you for a range of attachments to
|
|
|
|
extract (for example, @kbd{1 3-6 8}). The range "@samp{a}" is a shortcut for
|
|
|
|
@emph{all} attachments.
|
2012-06-07 15:24:58 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Viewing images inline
|
|
|
|
@section Viewing images inline
|
2012-05-16 19:47:13 +02:00
|
|
|
|
|
|
|
It is possible to show images inline in the message view buffer if you run
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs in GUI-mode. You can enable this by setting the variable
|
|
|
|
@code{mu4e-view-show-images} to @t{t}. Since Emacs does not always
|
2012-10-14 16:00:25 +02:00
|
|
|
handle images correctly, this is not enabled by default. If you are using
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs 24 with
|
2018-03-24 12:20:00 +01:00
|
|
|
@emph{ImageMagick}@footnote{@url{http://www.imagemagick.org/}} support, make
|
2012-10-14 16:00:25 +02:00
|
|
|
sure you call @code{imagemagick-register-types} in your configuration, so it
|
|
|
|
is used for images.
|
2012-05-16 19:47:13 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
;; enable inline images
|
2012-06-05 14:43:18 +02:00
|
|
|
(setq mu4e-view-show-images t)
|
2012-05-16 19:47:13 +02:00
|
|
|
;; use imagemagick, if available
|
|
|
|
(when (fboundp 'imagemagick-register-types)
|
2016-01-12 20:38:07 +01:00
|
|
|
(imagemagick-register-types))
|
2012-05-16 19:47:13 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Displaying rich-text messages
|
|
|
|
@section Displaying rich-text messages
|
2012-04-02 19:00:42 +02:00
|
|
|
|
2015-12-27 09:28:11 +01:00
|
|
|
@t{mu4e} normally prefers the plain-text version for messages that
|
|
|
|
consist of both a plain-text and html (rich-text) versions of the
|
|
|
|
body-text. You can change this by setting @code{mu4e-view-prefer-html}
|
|
|
|
to @t{t}. And you can toggle this value (globally) using @kbd{h} in the
|
|
|
|
message view; this also refreshes the message with the new setting.
|
2012-04-30 16:48:07 +02:00
|
|
|
|
2016-02-08 20:08:54 +01:00
|
|
|
Note, when using html-based rendering, you don't get the hyperlink
|
|
|
|
shortcuts the text-version provides.
|
|
|
|
|
2014-11-01 11:41:55 +01:00
|
|
|
If there is only an html-version, or if the plain-text version is too
|
2015-12-27 09:28:11 +01:00
|
|
|
short in comparison with the html part@footnote{this is e.g. for the
|
|
|
|
case where the text-part is only a short blurb telling you to use the
|
|
|
|
html-version; see @code{mu4e-view-html-plaintext-ratio-heuristic}},
|
2014-11-01 11:41:55 +01:00
|
|
|
@t{mu4e} tries to convert the html into plain-text for display.
|
|
|
|
|
2016-02-07 13:33:24 +01:00
|
|
|
With emacs 24.4 or newer, this defaults to @code{mu4e-shr2text}, which
|
|
|
|
uses the built-in @t{shr} renderer. For older emacs versions, this
|
|
|
|
defaults to the built-in @code{html2text} function. In practice, the
|
|
|
|
latter gives much better results.
|
|
|
|
|
|
|
|
If you use @code{mu4e-shr2text}, it might be useful to emulate some of
|
|
|
|
the @t{shr} key bindings, with something like:
|
|
|
|
@lisp
|
|
|
|
(add-hook 'mu4e-view-mode-hook
|
|
|
|
(lambda()
|
|
|
|
;; try to emulate some of the eww key-bindings
|
|
|
|
(local-set-key (kbd "<tab>") 'shr-next-link)
|
|
|
|
(local-set-key (kbd "<backtab>") 'shr-previous-link)))
|
|
|
|
@end lisp
|
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
If you're using a dark theme, and the messages are hard to read, it can
|
|
|
|
help to change the luminosity, e.g.:
|
2016-02-07 13:33:24 +01:00
|
|
|
@lisp
|
|
|
|
(setq shr-color-visible-luminance-min 80)
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
If your emacs does not have @t{shr} yet, it can be useful to use a
|
|
|
|
custom method. For that, you can set the variable
|
|
|
|
@code{mu4e-html2text-command} to either a shell command or a function
|
2014-11-01 11:41:55 +01:00
|
|
|
instead.
|
|
|
|
|
|
|
|
@subsection Html2text commands
|
|
|
|
|
|
|
|
If @code{mu4e-html2text-command} is a shell command, it is expected to
|
|
|
|
take html from standard input and write plain text in @t{UTF-8} encoding
|
|
|
|
on standard output.
|
|
|
|
|
|
|
|
An example of such a program is the program that is actually
|
|
|
|
@emph{called}
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{html2text}@footnote{@url{http://www.mbayer.de/html2text/}}. After
|
|
|
|
installation, you can set it up with something like the following:
|
2012-02-14 20:22:02 +01:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq mu4e-html2text-command "html2text -utf8 -width 72")
|
|
|
|
@end lisp
|
|
|
|
|
2012-10-03 11:53:24 +02:00
|
|
|
An alternative to this is the Python @t{python-html2text} package; after
|
|
|
|
installing that, you can tell @t{mu4e} to use it with something like:
|
2012-04-30 16:48:07 +02:00
|
|
|
|
|
|
|
@lisp
|
2012-09-29 12:30:49 +02:00
|
|
|
(setq mu4e-html2text-command
|
2016-01-12 20:38:07 +01:00
|
|
|
"html2markdown | grep -v ' _place_holder;'")
|
2012-04-30 16:48:07 +02:00
|
|
|
@end lisp
|
|
|
|
|
2015-12-27 13:30:02 +01:00
|
|
|
On OS X, there is a program called @t{textutil} as yet another
|
|
|
|
alternative:
|
2013-07-06 17:57:32 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq mu4e-html2text-command
|
2016-01-12 20:38:07 +01:00
|
|
|
"textutil -stdin -format html -convert txt -stdout")
|
2013-07-06 17:57:32 +02:00
|
|
|
@end lisp
|
|
|
|
|
2014-11-01 11:41:55 +01:00
|
|
|
@subsection Html2text functions
|
|
|
|
@anchor{Html2text functions}
|
|
|
|
|
2017-01-24 07:27:21 +01:00
|
|
|
If @code{mu4e-html2text-command} refers to an elisp function, the
|
|
|
|
function is expected to take a message plist as its input, and returns
|
|
|
|
the transformed data.
|
|
|
|
|
|
|
|
|
|
|
|
You can easily create your own function, for instance:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my-mu4e-html2text (msg)
|
|
|
|
"My html2text function; shows short message inline, show
|
2017-01-24 22:58:32 +01:00
|
|
|
long messages in some external browser (see `browse-url-generic-program')."
|
2017-01-24 07:27:21 +01:00
|
|
|
(let ((html (or (mu4e-message-field msg :body-html) "")))
|
2017-01-24 22:58:32 +01:00
|
|
|
(if (> (length html) 20000)
|
2017-01-24 07:27:21 +01:00
|
|
|
(progn
|
|
|
|
(mu4e-action-view-in-browser msg)
|
|
|
|
"[Viewing message in external browser]")
|
|
|
|
(mu4e-shr2text msg))))
|
|
|
|
|
|
|
|
(setq mu4e-html2text-command 'my-mu4e-html2text)
|
|
|
|
@end lisp
|
2014-11-01 11:41:55 +01:00
|
|
|
|
2016-03-15 05:40:21 +01:00
|
|
|
@subsection Privacy aspects
|
|
|
|
@anchor{Privacy aspects}
|
|
|
|
|
|
|
|
When opening your messages in a graphical browser, it may expose you
|
|
|
|
doing so to the sender, due to the presence of specially crafted image
|
|
|
|
URLs, or Javascript.
|
|
|
|
|
|
|
|
If that is an issue, it is recommended to use a browser (or browser
|
|
|
|
profile) that does not load images. The same applies to Javascript.
|
|
|
|
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node MSGV Crypto
|
|
|
|
@section Crypto
|
|
|
|
|
2020-07-25 10:32:15 +02:00
|
|
|
The @t{mu4e} message view supports decryption of encrypted messages,
|
|
|
|
as well as verification of signatures. For signing/encrypting messages
|
|
|
|
your outgoing messages, see @ref{Signing and encrypting}.
|
2012-09-30 19:12:07 +02:00
|
|
|
|
2014-10-19 11:04:11 +02:00
|
|
|
For all of this to work, @command{gpg-agent} must be running, and it
|
|
|
|
must set the environment variable @t{GPG_AGENT_INFO}. You can check from
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs with @key{M-x getenv GPG_AGENT_INFO}.
|
2012-10-29 15:03:52 +01:00
|
|
|
|
|
|
|
In many mainstream Linux/Unix desktop environments, everything works
|
|
|
|
out-of-the-box, but if your environment does not automatically start
|
|
|
|
@command{gpg-agent}, you can do so by hand:
|
|
|
|
@verbatim
|
2012-12-25 18:42:07 +01:00
|
|
|
$ eval $(gpg-agent --daemon)
|
2012-10-29 15:03:52 +01:00
|
|
|
@end verbatim
|
|
|
|
|
|
|
|
@noindent
|
|
|
|
This starts the daemon, and sets the environment variable.
|
2012-09-30 19:12:07 +02:00
|
|
|
|
2020-05-06 12:30:06 +02:00
|
|
|
Some users have reported problems with certain S/MIME-signed messages
|
|
|
|
where mu checks if the certificate has been revoked. This can be
|
|
|
|
avoided by adding @t{disable-crl-checks} to @t{~/.gnupg/gpgsm.conf};
|
|
|
|
alternatively, you could use the gnus-based viewer.
|
|
|
|
|
2012-09-13 20:12:38 +02:00
|
|
|
@subsection Decryption
|
|
|
|
@anchor{Decryption}
|
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
If you receive messages that are encrypted (using PGP/MIME), @t{mu4e}
|
|
|
|
can try to decrypt them, base on the setting of
|
|
|
|
@code{mu4e-decryption-policy}. If you set it to @t{t}, @t{mu4e} attempts
|
|
|
|
to decrypt messages automatically; this is the default. If you set it to
|
|
|
|
@t{nil}, @t{mu4e} @emph{won't} attempt to decrypt anything. Finally, if
|
|
|
|
you set it to @t{'ask}, it asks you what to do, each time an encrypted
|
|
|
|
message is encountered.
|
2012-09-13 20:12:38 +02:00
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
When opening an encrypted message, @t{mu} consults @t{gpg-agent} to see
|
|
|
|
if it already has unlocked the key needed to decrypt the message; if
|
|
|
|
not, it prompts you for a password (typically with a separate top-level
|
|
|
|
window). This is only needed once per session.
|
2012-09-13 20:12:38 +02:00
|
|
|
|
2012-07-19 10:42:38 +02:00
|
|
|
@subsection Verifying signatures
|
2012-09-13 20:12:38 +02:00
|
|
|
@anchor{Verifying signatures}
|
2012-07-19 10:42:38 +02:00
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
Some e-mail messages are cryptographically signed, and @t{mu4e} can
|
|
|
|
check the validity of these signatures. If a message has one or more
|
|
|
|
signatures, the message view shows an extra header @t{Signature:}
|
|
|
|
(assuming it is part of your @code{mu4e-view-fields}), and one or more
|
|
|
|
`verdicts' of the signatures found; either @t{verified}, @t{unverified}
|
|
|
|
or @t{error}. For instance:
|
2012-07-19 10:42:38 +02:00
|
|
|
|
|
|
|
@verbatim
|
2012-09-13 20:12:38 +02:00
|
|
|
Signature: unverified (Details)
|
2012-07-19 10:42:38 +02:00
|
|
|
@end verbatim
|
2017-08-27 19:23:33 +02:00
|
|
|
or
|
|
|
|
@verbatim
|
|
|
|
Signature: verified Darrow Andromedus <darrow@rising.com> (Details)
|
|
|
|
@end verbatim
|
2012-07-19 10:42:38 +02:00
|
|
|
|
|
|
|
You can see the details of the signature verification by activating the
|
2012-09-30 19:12:07 +02:00
|
|
|
@t{Details} or pressing @key{v}. This pops up a little window with the
|
2017-08-27 19:23:33 +02:00
|
|
|
details of the signatures found and whether they could be verified or
|
|
|
|
not.
|
|
|
|
|
|
|
|
Note that @t{mu4e} does not check whether the signer is the same as the
|
|
|
|
sender of the message, since this would cause too many false negatives
|
|
|
|
for senders that use an address that is not part of their certificate.
|
|
|
|
Also, the From: address can easily be forged.
|
2012-07-19 10:42:38 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
For more information, see the @command{mu-verify} manual page.
|
2012-07-19 10:42:38 +02:00
|
|
|
|
2013-10-12 15:04:12 +02:00
|
|
|
@node MSGV Custom headers
|
|
|
|
@section Custom headers
|
|
|
|
|
|
|
|
Sometimes the normal headers that @t{mu4e} offers (Date, From, To, Subject
|
|
|
|
etc.) may not be enough. For these cases, @t{mu4e} offers @emph{custom
|
2013-10-13 20:44:47 +02:00
|
|
|
headers} in both the headers-view and the message-view.
|
2013-10-12 15:04:12 +02:00
|
|
|
|
|
|
|
See @ref{HV Custom headers} for an example of this; the difference for the
|
|
|
|
message-view is that you should add your custom header to
|
|
|
|
@code{mu4e-view-fields} rather than @code{mu4e-headers-fields}.
|
2013-10-13 20:44:47 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node MSGV Actions
|
|
|
|
@section Actions
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
You can perform custom functions (``actions'') on messages and their
|
2016-12-31 17:01:30 +01:00
|
|
|
attachments. For a general discussion on how to define your own, see
|
2013-06-12 09:09:19 +02:00
|
|
|
@ref{Actions}.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
|
|
|
@subsection Message actions
|
2012-09-29 12:30:49 +02:00
|
|
|
@code{mu4e-view-action} (@key{a}) lets you pick some custom action to perform
|
|
|
|
on the current message. You can specify these actions using the variable
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-view-actions}; @t{mu4e} defines a number of example actions.
|
2012-09-29 12:30:49 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@subsection Attachment actions
|
2012-09-29 12:30:49 +02:00
|
|
|
Similarly, there is @code{mu4e-view-attachment-action} (@key{A}) for actions
|
|
|
|
on attachments, which you can specify with
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-view-attachment-actions}.
|
2012-09-29 12:30:49 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu4e} predefines a number of attachment-actions:
|
2012-09-29 12:30:49 +02:00
|
|
|
@itemize
|
|
|
|
@item @t{open-with} (@key{w}): open the attachment with some arbitrary
|
|
|
|
program. For example, suppose you have received a message with a picture
|
2012-10-11 16:50:32 +02:00
|
|
|
attachment; then, @kbd{A w 1 RET gimp RET} opens that attachment in @emph{The
|
|
|
|
Gimp}
|
2012-09-29 12:30:49 +02:00
|
|
|
@item @t{pipe} (@key{|}: process the attachment with some Unix shell-pipe and
|
|
|
|
see the results. Suppose you receive a patch file, and would like to get an
|
|
|
|
overview of the changes, using the @t{diffstat} program. You can use something
|
2012-10-11 16:50:32 +02:00
|
|
|
like: @kbd{A | 1 RET diffstat -b RET}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@item Emacs (@key{e}): open the attachment in your running Emacs. For
|
|
|
|
example, if you receive some text file you'd like to open in Emacs:
|
2012-10-11 16:50:32 +02:00
|
|
|
@kbd{A e 1 RET}.
|
2012-09-29 12:30:49 +02:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
These actions all work on a @emph{temporary copy} of the attachment.
|
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Editor view
|
2012-09-30 19:12:07 +02:00
|
|
|
@chapter The editor view
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
Writing e-mail messages takes place in the Editor View. @t{mu4e}'s editor view
|
2016-12-31 17:01:30 +01:00
|
|
|
builds on top of Gnus' @t{message-mode}. Most of the @t{message-mode}
|
2012-10-14 16:00:25 +02:00
|
|
|
functionality is available, as well some @t{mu4e}-specifics. Its major mode is
|
|
|
|
@code{mu4e-compose-mode}.
|
2012-09-29 12:30:49 +02:00
|
|
|
|
|
|
|
@menu
|
2016-04-19 09:48:15 +02:00
|
|
|
* Overview: EV Overview. What is the Editor view
|
2016-01-10 10:56:58 +01:00
|
|
|
* Keybindings: EV Keybindings. Doing things with your keyboard
|
|
|
|
* Address autocompletion:: Quickly entering known addresses
|
|
|
|
* Compose hooks::Calling functions when composing
|
|
|
|
* Signing and encrypting:: Support for cryptography
|
|
|
|
* Queuing mail:: Sending mail when the time is ripe
|
|
|
|
* Message signatures:: Adding your personal footer to messages
|
|
|
|
* Other settings::Miscellanea
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node EV Overview
|
|
|
|
@section Overview
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2012-01-19 20:40:26 +01:00
|
|
|
@verbatim
|
2016-01-12 20:38:07 +01:00
|
|
|
From: Rupert the Monkey <rupert@example.com>
|
|
|
|
To: Wally the Walrus <wally@example.com>
|
|
|
|
Subject: Re: Eau-qui d'eau qui?
|
|
|
|
--text follows this line--
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
On Mon 16 Jan 2012 10:18:47 AM EET, Wally the Walrus wrote:
|
2019-05-11 12:27:39 +02:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
> Hi Rupert,
|
|
|
|
>
|
|
|
|
> Dude - how are things?
|
|
|
|
>
|
|
|
|
> Later -- wally.
|
2012-01-19 20:40:26 +01:00
|
|
|
@end verbatim
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2011-12-21 23:45:06 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node EV Keybindings
|
|
|
|
@section Keybindings
|
2012-09-29 12:30:49 +02:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@t{mu4e}'s editor view derives from Gnus' message editor and shares most of
|
2012-10-14 16:00:25 +02:00
|
|
|
its keybindings. Here are some of the more useful ones (you can use the menu
|
|
|
|
to find more):
|
2012-01-19 20:40:26 +01:00
|
|
|
|
|
|
|
@verbatim
|
|
|
|
key description
|
|
|
|
--- -----------
|
|
|
|
C-c C-c send message
|
|
|
|
C-c C-d save to drafts and leave
|
2016-05-15 12:20:57 +02:00
|
|
|
C-c C-k kill the message buffer (the message remains in the draft folder)
|
2012-01-19 20:40:26 +01:00
|
|
|
C-c C-a attach a file (pro-tip: drag & drop works as well)
|
2012-10-25 10:59:50 +02:00
|
|
|
|
|
|
|
(mu4e-specific)
|
|
|
|
C-S-u update mail & reindex
|
2012-01-19 20:40:26 +01:00
|
|
|
@end verbatim
|
2011-12-21 23:45:06 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Address autocompletion
|
|
|
|
@section Address autocompletion
|
2012-06-20 10:29:57 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@t{mu4e} supports@footnote{GNU Emacs 24.4 or higher is required}
|
2012-10-14 16:00:25 +02:00
|
|
|
autocompleting addresses when composing e-mail messages. @t{mu4e} uses the
|
|
|
|
e-mail addresses from the messages you sent or received as the source for
|
|
|
|
this. Address auto-completion is enabled by default; if you want to disable it
|
|
|
|
for some reason, set @t{mu4e-compose-complete-addresses} to @t{nil}.
|
2012-07-09 09:54:38 +02:00
|
|
|
|
|
|
|
Emacs 24 also supports cycling through the alternatives. When there are more
|
|
|
|
than @emph{5} matching addresses, they are shown in a @t{*Completions*}
|
2012-10-14 16:00:25 +02:00
|
|
|
buffer. Once the number of matches gets below this number, one is inserted in
|
|
|
|
the address field and you can cycle through the alternatives using @key{TAB}.
|
2012-06-26 21:47:25 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@subsection Limiting the number of addresses
|
2012-06-20 10:29:57 +02:00
|
|
|
|
|
|
|
If you have a lot of mail, especially from mailing lists and the like, there
|
2012-10-14 16:00:25 +02:00
|
|
|
can be a @emph{lot} of e-mail addresses, many of which may not be very useful
|
|
|
|
when auto-completing. For this reason, @t{mu4e} attempts to limit the number
|
|
|
|
of e-mail addresses in the completion pool by filtering out the ones that are
|
|
|
|
not likely to be relevant. The following variables are available for tuning
|
|
|
|
this:
|
2012-06-20 10:29:57 +02:00
|
|
|
|
|
|
|
@itemize
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{mu4e-compose-complete-only-personal} --- when set to @t{t},
|
2020-04-09 21:07:58 +02:00
|
|
|
only consider addresses that were seen in @emph{personal} messages ---
|
|
|
|
that is, messages in which one of my e-mail addresses was seen in one
|
|
|
|
of the address fields. This is to exclude mailing list posts. You can
|
|
|
|
define what is considered `my e-mail address' using the
|
|
|
|
@t{--my-address} parameter to @t{mu init}.
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{mu4e-compose-complete-only-after} --- only consider e-mail
|
2012-10-11 16:50:32 +02:00
|
|
|
addresses last seen after some date. Parameter is a string, parseable by
|
|
|
|
@code{org-parse-time-string}. This excludes old e-mail addresses. The default
|
2012-10-14 16:00:25 +02:00
|
|
|
is @t{"2010-01-01"}, i.e., only consider e-mail addresses seen since the start
|
2012-10-11 16:50:32 +02:00
|
|
|
of 2010.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{mu4e-compose-complete-ignore-address-regexp} --- a regular expression to
|
|
|
|
filter out other `junk' e-mail addresses; defaults to ``@t{no-?reply}''.
|
2012-06-20 10:29:57 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Compose hooks
|
|
|
|
@section Compose hooks
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
If you want to change some setting, or execute some custom action before
|
|
|
|
message composition starts, you can define a @emph{hook function}. @t{mu4e}
|
|
|
|
offers two hooks:
|
2012-08-29 17:00:23 +02:00
|
|
|
@itemize
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @code{mu4e-compose-pre-hook}: this hook is run @emph{before} composition
|
2012-08-29 17:00:23 +02:00
|
|
|
starts; if you are composing a @emph{reply}, @emph{forward} a message, or
|
|
|
|
@emph{edit} an existing message, the variable
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-compose-parent-message} points to the message being replied to,
|
|
|
|
forwarded or edited, and you can use @code{mu4e-message-field} to get the
|
|
|
|
value of various properties (and see @ref{Message functions}).
|
|
|
|
@item @code{mu4e-compose-mode-hook}: this hook is run just before composition
|
2012-08-29 17:00:23 +02:00
|
|
|
starts, when the whole buffer has already been set up. This is a good place
|
2012-10-14 16:00:25 +02:00
|
|
|
for editing-related settings. @code{mu4e-compose-parent-message} (see above)
|
2012-08-29 17:00:23 +02:00
|
|
|
is also at your disposal.
|
|
|
|
@end itemize
|
|
|
|
|
2012-10-17 17:35:23 +02:00
|
|
|
@noindent
|
2012-10-22 19:27:49 +02:00
|
|
|
Let's look at some examples. First, suppose we want to set the
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{From:}-address for a reply message based on the receiver of the original:
|
2012-08-29 17:00:23 +02:00
|
|
|
@lisp
|
2015-12-15 11:57:25 +01:00
|
|
|
;; 1) messages to me@@foo.example.com should be replied with From:me@@foo.example.com
|
|
|
|
;; 2) messages to me@@bar.example.com should be replied with From:me@@bar.example.com
|
|
|
|
;; 3) all other mail should use From:me@@cuux.example.com
|
2012-08-29 17:00:23 +02:00
|
|
|
(add-hook 'mu4e-compose-pre-hook
|
2016-01-12 20:38:07 +01:00
|
|
|
(defun my-set-from-address ()
|
|
|
|
"Set the From address based on the To address of the original."
|
|
|
|
(let ((msg mu4e-compose-parent-message)) ;; msg is shorter...
|
|
|
|
(when msg
|
|
|
|
(setq user-mail-address
|
|
|
|
(cond
|
|
|
|
((mu4e-message-contact-field-matches msg :to "me@@foo.example.com")
|
|
|
|
"me@@foo.example.com")
|
|
|
|
((mu4e-message-contact-field-matches msg :to "me@@bar.example.com")
|
|
|
|
"me@@bar.example.com")
|
|
|
|
(t "me@@cuux.example.com")))))))
|
2012-08-29 17:00:23 +02:00
|
|
|
@end lisp
|
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
Secondly, as mentioned, @code{mu4e-compose-mode-hook} is especially
|
|
|
|
useful for editing-related settings. For example:
|
2012-08-29 17:00:23 +02:00
|
|
|
@lisp
|
|
|
|
(add-hook 'mu4e-compose-mode-hook
|
2016-01-12 20:38:07 +01:00
|
|
|
(defun my-do-compose-stuff ()
|
|
|
|
"My settings for message composition."
|
|
|
|
(set-fill-column 72)
|
|
|
|
(flyspell-mode)))
|
2012-08-29 17:00:23 +02:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
This hook is also useful for adding headers or changing headers, since the
|
|
|
|
message is fully formed when this hook runs. For example, to add a
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{Bcc:}-header, you could add something like the following, using
|
|
|
|
@code{message-add-header} from @code{message-mode}.
|
2012-08-29 17:00:23 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-hook 'mu4e-compose-mode-hook
|
2016-01-12 20:38:07 +01:00
|
|
|
(defun my-add-bcc ()
|
|
|
|
"Add a Bcc: header."
|
|
|
|
(save-excursion (message-add-header "Bcc: me@@example.com\n"))))
|
2012-08-29 17:00:23 +02:00
|
|
|
@end lisp
|
|
|
|
|
2018-01-06 13:48:28 +01:00
|
|
|
Or to something context-specific:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-hook 'mu4e-compose-mode-hook
|
|
|
|
(lambda()
|
|
|
|
(let* ((ctx (mu4e-context-current))
|
|
|
|
(name (if ctx (mu4e-context-name ctx))))
|
|
|
|
(when name
|
|
|
|
(cond
|
|
|
|
((string= name "account1")
|
|
|
|
(save-excursion (message-add-header "Bcc: account1@@example.com\n")))
|
|
|
|
((string= name "account2")
|
|
|
|
(save-excursion (message-add-header "Bcc: account2@@example.com\n"))))))))
|
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
For a more general discussion about extending @t{mu4e}, see @ref{Extending
|
|
|
|
mu4e}.
|
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Signing and encrypting
|
|
|
|
@section Signing and encrypting
|
2012-09-13 20:12:38 +02:00
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
Signing and encrypting of messages is possible using @t{emacs-mime}
|
2012-10-11 16:50:32 +02:00
|
|
|
(@inforef{Composing,,emacs-mime}), most easily accessed through the
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{Attachments}-menu while composing a message, or with @kbd{M-x
|
|
|
|
mml-secure-message-encrypt-pgp}, @kbd{M-x mml-secure-message-sign-pgp}.
|
2012-09-13 20:12:38 +02:00
|
|
|
|
|
|
|
The support for encryption and signing is @emph{independent} of the support
|
2012-09-30 19:12:07 +02:00
|
|
|
for their counterparts, decrypting and signature verification (as discussed in
|
2013-08-24 10:17:00 +02:00
|
|
|
@ref{MSGV Crypto}). Even if your @t{mu4e} does not have support for the latter
|
2012-09-30 19:12:07 +02:00
|
|
|
two, you can still sign/encrypt messages.
|
2012-09-13 20:12:38 +02:00
|
|
|
|
2014-10-19 11:04:11 +02:00
|
|
|
Important note: the messages are encrypted when they are @emph{sent}:
|
|
|
|
this means that draft messages are @emph{not} encrypted. So if you are
|
2014-11-27 00:08:54 +01:00
|
|
|
using e.g. @t{offlineimap} or @t{mbsync} to synchronize with some remote
|
|
|
|
IMAP-service, make sure the drafts folder is @emph{not} in the set of
|
|
|
|
synchronized folders, for obvious reasons.
|
2014-10-19 11:04:11 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Queuing mail
|
|
|
|
@section Queuing mail
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
If you cannot send mail right now, for example because you are currently
|
2012-04-24 21:37:50 +02:00
|
|
|
offline, you can @emph{queue} the mail, and send it when you have restored
|
2012-10-14 16:00:25 +02:00
|
|
|
your internet connection. You can control this from the @ref{Main view}.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
To allow for queuing, you need to tell @t{smtpmail} where you want to store
|
|
|
|
the queued messages. For example:
|
2012-04-24 21:37:50 +02:00
|
|
|
|
|
|
|
@lisp
|
2014-02-28 20:10:46 +01:00
|
|
|
(setq smtpmail-queue-mail t ;; start in queuing mode
|
2016-01-12 20:38:07 +01:00
|
|
|
smtpmail-queue-dir "~/Maildir/queue/cur")
|
2012-04-24 21:37:50 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-09-29 13:24:58 +02:00
|
|
|
For convenience, we put the queue directory somewhere in our normal
|
2012-04-24 21:37:50 +02:00
|
|
|
maildir. If you want to use queued mail, you should create this directory
|
|
|
|
before starting @t{mu4e}. The @command{mu mkdir} command may be useful here,
|
|
|
|
so for example:
|
|
|
|
|
|
|
|
@verbatim
|
2016-01-12 20:38:07 +01:00
|
|
|
$ mu mkdir ~/Maildir/queue
|
|
|
|
$ touch ~/Maildir/queue/.noindex
|
2012-04-24 21:37:50 +02:00
|
|
|
@end verbatim
|
|
|
|
|
|
|
|
The file created by the @command{touch} command tells @t{mu} to ignore this
|
|
|
|
directory for indexing, which makes sense since it contains @t{smtpmail}
|
2013-08-24 10:17:00 +02:00
|
|
|
meta-data rather than normal messages; see the @t{mu-mkdir} and @t{mu-index}
|
|
|
|
man-pages for details.
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@emph{Warning}: when you switch on queued-mode, your messages @emph{won't}
|
|
|
|
reach their destination until you switch it off again; so, be careful not to
|
|
|
|
do this accidentally!
|
|
|
|
|
2013-12-21 19:58:55 +01:00
|
|
|
@node Message signatures
|
|
|
|
@section Message signatures
|
|
|
|
|
|
|
|
Message signatures are the standard footer blobs in e-mail messages where you
|
|
|
|
can put in information you want to include in every message. The text to
|
|
|
|
include is set with @code{mu4e-compose-signature}.
|
|
|
|
|
|
|
|
If you don't want to include this automatically with each message,
|
|
|
|
you can set @code{mu4e-compose-signature-auto-include} to @code{nil}; you can
|
|
|
|
then still include the signature manually, using the function
|
|
|
|
@code{message-insert-signature}, typically bound to @kbd{C-c C-w}.
|
2015-12-21 21:15:47 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@node Other settings
|
|
|
|
@section Other settings
|
|
|
|
|
|
|
|
@itemize
|
2020-02-24 20:58:45 +01:00
|
|
|
@item If you want use @t{mu4e} as Emacs' default program for sending mail,
|
2016-01-10 10:56:58 +01:00
|
|
|
see @ref{Emacs default}.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item Normally, @t{mu4e} @emph{buries} the message buffer after sending; if you want
|
|
|
|
to kill the buffer instead, add something like the following to your
|
|
|
|
configuration:
|
2014-12-29 21:04:49 +01:00
|
|
|
@lisp
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
|
|
|
@end lisp
|
2014-11-22 18:01:05 +01:00
|
|
|
@item If you want to exclude your own e-mail address when ``replying to
|
2020-04-09 21:07:58 +02:00
|
|
|
all'', set @code{mu4e-compose-dont-reply-to-self} to @code{t}. In
|
|
|
|
order for this to work properly you need to pass your address to
|
|
|
|
@command{mu init --my-address=} at database initialization time.
|
2012-10-14 16:00:25 +02:00
|
|
|
@end itemize
|
2012-04-24 21:37:50 +02:00
|
|
|
|
2012-04-21 11:48:00 +02:00
|
|
|
@node Searching
|
|
|
|
@chapter Searching
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@t{mu4e} is fully search-based: even if you `jump to a folder', you are
|
2012-10-14 16:00:25 +02:00
|
|
|
executing a query for messages that happen to have the property of being in a
|
2013-06-16 10:54:08 +02:00
|
|
|
certain folder (maildir).
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-12-25 18:42:07 +01:00
|
|
|
Normally, queries return up to @code{mu4e-headers-results-limit} (default:
|
2012-10-14 16:00:25 +02:00
|
|
|
500) results. That is usually more than enough, and makes things significantly
|
|
|
|
faster. Sometimes, however, you may want to show @emph{all} results; you can
|
|
|
|
enable this with @kbd{M-x mu4e-headers-toggle-full-search}, or by customizing
|
|
|
|
the variable @code{mu4e-headers-full-search}. This applies to all search
|
|
|
|
commands.
|
2012-06-20 19:42:39 +02:00
|
|
|
|
2012-06-10 15:14:35 +02:00
|
|
|
You can also influence the sort order and whether threads are shown or not;
|
2016-07-31 10:23:38 +02:00
|
|
|
see @ref{Sorting and threading}.
|
2012-06-10 10:44:31 +02:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@menu
|
2013-09-24 21:20:25 +02:00
|
|
|
* Queries:: Searching for messages.
|
|
|
|
* Bookmarks:: Remembering queries.
|
|
|
|
* Maildir searches:: Queries for maildirs.
|
|
|
|
* Other search functionality:: Some more tricks.
|
2011-12-19 08:07:03 +01:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Queries
|
|
|
|
@section Queries
|
|
|
|
|
2012-10-07 15:54:24 +02:00
|
|
|
@t{mu4e} queries are the same as the ones that @t{mu find}
|
2017-10-25 22:47:22 +02:00
|
|
|
understands@footnote{with the caveat that command-line queries are
|
|
|
|
subject to the shell's interpretation before @t{mu} sees them}. Let's
|
|
|
|
look at some examples here; you can consult the @code{mu-query} man page
|
|
|
|
for the details.
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@itemize
|
|
|
|
|
|
|
|
@item Get all messages regarding @emph{bananas}:
|
2011-12-19 21:11:47 +01:00
|
|
|
@verbatim
|
|
|
|
bananas
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages regarding @emph{bananas} from @emph{John} with an attachment:
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
from:john and flag:attach and bananas
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2017-10-25 22:47:22 +02:00
|
|
|
@item Get all messages with subject @emph{wombat} in June 2017
|
2013-06-16 10:54:08 +02:00
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
subject:wombat and date:20170601..20170630
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages with PDF attachments in the @t{/projects} folder
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
maildir:/projects and mime:application/pdf
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages about @emph{Rupert} in the @t{/Sent Items} folder. Note that
|
|
|
|
maildirs with spaces must be quoted.
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
"maildir:/Sent Items" and rupert
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-07-09 10:17:28 +02:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all important messages which are signed:
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
flag:signed and prio:high
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages from @emph{Jim} without an attachment:
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
from:jim and not flag:attach
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages with Alice in one of the contacts-fields (@t{to}, @t{from},
|
|
|
|
@t{cc}, @t{bcc}):
|
|
|
|
@verbatim
|
2012-10-17 17:35:23 +02:00
|
|
|
contact:alice
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all unread messages where the subject mentions Ångström: (search is
|
|
|
|
case-insensitive and accent-insensitive, so this matches Ångström, angstrom,
|
|
|
|
aNGstrøM, ...)
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
subject:Ångström and flag:unread
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2017-10-25 22:47:22 +02:00
|
|
|
@item Get all unread messages between Mar-2012 and Aug-2013 about some bird:
|
2013-06-16 10:54:08 +02:00
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
date:20120301..20130831 and nightingale and flag:unread
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get today's messages:
|
|
|
|
@verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
date:today..now
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages we got in the last two weeks regarding @emph{emacs}:
|
|
|
|
@verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
date:2w.. and emacs
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-07-06 09:47:15 +02:00
|
|
|
@item Get messages from the @emph{Mu} mailing list:
|
2013-06-16 10:54:08 +02:00
|
|
|
@verbatim
|
|
|
|
list:mu-discuss.googlegroups.com
|
|
|
|
@end verbatim
|
2017-10-25 22:47:22 +02:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
Note --- in the @ref{Headers view} you may see the `friendly name' for a
|
2014-09-01 00:26:31 +02:00
|
|
|
list; however, when searching you need the real name. You can see the
|
|
|
|
real name for a mailing list from the friendly name's tool-tip.
|
2013-03-17 18:43:12 +01:00
|
|
|
|
2015-12-21 21:15:47 +01:00
|
|
|
@item Get messages with a subject soccer, Socrates, society, ...; note that
|
2016-12-31 17:01:30 +01:00
|
|
|
the `*'-wildcard can only appear as a term's rightmost character:
|
2013-06-16 10:54:08 +02:00
|
|
|
@verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
subject:soc*
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-10-07 15:54:24 +02:00
|
|
|
|
2013-07-03 22:09:27 +02:00
|
|
|
@item Get all messages @emph{not} sent to a mailing-list:
|
|
|
|
@verbatim
|
|
|
|
NOT flag:list
|
|
|
|
@end verbatim
|
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all mails with attachments with filenames starting with @emph{pic}; note
|
2016-12-31 17:01:30 +01:00
|
|
|
that the `*' wildcard can only appear as the term's rightmost character:
|
2013-06-16 10:54:08 +02:00
|
|
|
@verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
file:pic*
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@item Get all messages with PDF-attachments:
|
|
|
|
@verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
mime:application/pdf
|
2013-06-16 10:54:08 +02:00
|
|
|
@end verbatim
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
Get all messages with image attachments, and note that the `*' wildcard can
|
2013-06-16 10:54:08 +02:00
|
|
|
only appear as the term's rightmost character:
|
|
|
|
@verbatim
|
2012-02-05 09:56:37 +01:00
|
|
|
mime:image/*
|
2011-12-19 21:11:47 +01:00
|
|
|
@end verbatim
|
|
|
|
|
2020-04-27 10:56:35 +02:00
|
|
|
Get all messages with files that end in @t{.ppt}; this uses the
|
|
|
|
regular-expression support, which is powerful but relatively slow:
|
|
|
|
@verbatim
|
|
|
|
file:/\.ppt$/
|
|
|
|
@end verbatim
|
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
@end itemize
|
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Bookmarks
|
|
|
|
@section Bookmarks
|
|
|
|
|
2011-12-19 21:11:47 +01:00
|
|
|
If you have queries that you use often, you may want to store them as
|
2016-07-31 10:23:38 +02:00
|
|
|
@emph{bookmarks}. Bookmark searches are available in the main view
|
|
|
|
(@pxref{Main view}), header view (@pxref{Headers view}), and message
|
|
|
|
view (@pxref{Message view}), using (by default) the key @key{b}
|
|
|
|
(@kbd{M-x mu4e-search-bookmark}), or @key{B} (@kbd{M-x
|
|
|
|
mu4e-search-bookmark-edit}) which lets you edit the bookmark first.
|
2012-03-25 19:33:17 +02:00
|
|
|
|
2012-04-02 19:00:42 +02:00
|
|
|
@subsection Setting up bookmarks
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2020-01-13 09:34:08 +01:00
|
|
|
@t{mu4e} provides a number of default bookmarks. Their definition may
|
|
|
|
be instructive:
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-02-05 09:56:37 +01:00
|
|
|
@lisp
|
2020-01-21 19:53:09 +01:00
|
|
|
(defcustom mu4e-bookmarks
|
|
|
|
'(( :name "Unread messages"
|
|
|
|
:query "flag:unread AND NOT flag:trashed"
|
|
|
|
:key ?u)
|
|
|
|
( :name "Today's messages"
|
|
|
|
:query "date:today..now"
|
|
|
|
:key ?t)
|
|
|
|
( :name "Last 7 days"
|
|
|
|
:query "date:7d..now"
|
2020-05-04 19:52:40 +02:00
|
|
|
:hide-unread t
|
2020-01-21 19:53:09 +01:00
|
|
|
:key ?w)
|
|
|
|
( :name "Messages with images"
|
|
|
|
:query "mime:image/*"
|
|
|
|
:key ?p))
|
|
|
|
"List of pre-defined queries that are shown on the main screen.
|
|
|
|
|
|
|
|
Each of the list elements is a plist with at least:
|
2020-05-01 12:29:51 +02:00
|
|
|
:name - the name of the query
|
2020-01-21 19:53:09 +01:00
|
|
|
:query - the query expression
|
|
|
|
:key - the shortcut key.
|
|
|
|
|
|
|
|
Optionally, you add the following:
|
|
|
|
:hide - if t, bookmark is hdden from the main-view and speedbar.
|
|
|
|
:hide-unread - do not show the counts of unread/total number
|
|
|
|
of matches for the query. This can be useful if a bookmark uses
|
|
|
|
a very slow query. :hide-unread is implied from :hide.
|
|
|
|
"
|
|
|
|
:type '(repeat (plist))
|
|
|
|
:group 'mu4e)
|
2012-02-05 09:56:37 +01:00
|
|
|
@end lisp
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
You can replace these or add your own items, by putting in your
|
2011-12-19 21:11:47 +01:00
|
|
|
configuration (@file{~/.emacs}) something like:
|
2012-02-05 09:56:37 +01:00
|
|
|
@lisp
|
2011-12-19 21:11:47 +01:00
|
|
|
(add-to-list 'mu4e-bookmarks
|
2020-01-13 09:34:08 +01:00
|
|
|
'( :name "Big messages"
|
|
|
|
:query "size:5M..500M"
|
|
|
|
:key ?b))
|
2016-07-31 10:23:38 +02:00
|
|
|
@end lisp
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-03-25 19:33:17 +02:00
|
|
|
This prepends your bookmark to the list, and assigns the key @key{b} to it. If
|
2011-12-19 21:11:47 +01:00
|
|
|
you want to @emph{append} your bookmark, you can use @code{t} as the third
|
|
|
|
argument to @code{add-to-list}.
|
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
In the various @t{mu4e} views, pressing @key{b} lists all the bookmarks
|
2012-02-05 09:56:37 +01:00
|
|
|
defined in the echo area, with the shortcut key highlighted. So, to invoke the
|
|
|
|
bookmark we just defined (to get the list of "Big Messages"), all you need to
|
2012-10-11 16:50:32 +02:00
|
|
|
type is @kbd{bb}.
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2018-11-11 07:30:25 +01:00
|
|
|
@subsection Lisp expressions or functions as bookmarks
|
2014-12-01 22:29:40 +01:00
|
|
|
|
|
|
|
Instead of using strings, it is also possible to use Lisp expressions as
|
2018-11-11 07:30:25 +01:00
|
|
|
bookmarks. Either the expression evaluates to a query string or the expression
|
|
|
|
is a function taking no argument that returns a query string.
|
2014-12-01 22:29:40 +01:00
|
|
|
|
2015-12-24 15:03:21 +01:00
|
|
|
For example, to get all the messages that are at most a week old in your
|
|
|
|
inbox:
|
2014-12-01 22:29:40 +01:00
|
|
|
|
|
|
|
@lisp
|
2015-12-24 15:03:21 +01:00
|
|
|
(add-to-list 'mu4e-bookmarks
|
2020-01-13 09:34:08 +01:00
|
|
|
'( :name "Inbox messages in the last 7 days"
|
|
|
|
:query (lambda () (concat "maildir:/inbox AND date:"
|
|
|
|
(format-time-string "%Y%m%d"
|
2018-11-11 07:30:25 +01:00
|
|
|
(subtract-time (current-time) (days-to-time 7)))))
|
2020-01-13 09:34:08 +01:00
|
|
|
:key ?w) t)
|
2014-12-01 22:29:40 +01:00
|
|
|
@end lisp
|
|
|
|
|
2018-11-11 07:30:25 +01:00
|
|
|
Another example where the user is prompted how many days old messages should be
|
|
|
|
shown:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my/mu4e-bookmark-num-days-old-query (days-old)
|
|
|
|
(interactive (list (read-number "Show days old messages: " 7)))
|
|
|
|
(let ((start-date (subtract-time (current-time) (days-to-time days-old))))
|
|
|
|
(concat "maildir:/inbox AND date:"
|
|
|
|
(format-time-string "%Y%m%d" start-date))))
|
|
|
|
|
|
|
|
(add-to-list 'mu4e-bookmarks
|
2020-01-13 09:34:08 +01:00
|
|
|
`(:name "Inbox messages in the last 7 days"
|
|
|
|
:query ,(lambda () (call-interactively 'my/mu4e-bookmark-num-days-old-query))
|
|
|
|
:key ?o) t)
|
2018-11-11 07:30:25 +01:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
It is defining a function to make the code more readable.
|
|
|
|
|
2012-04-02 19:00:42 +02:00
|
|
|
@subsection Editing bookmarks before searching
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
There is also @kbd{M-x mu4e-headers-search-bookmark-edit} (key @key{B}), which
|
|
|
|
lets you edit the bookmarked query before invoking it. This can be useful if
|
|
|
|
you have many similar queries, but need to change some parameter. For example,
|
|
|
|
you could have a bookmark @samp{"date:today..now AND "}@footnote{Not a valid
|
|
|
|
search query by itself}, which limits any result to today's messages.
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2011-12-19 08:07:03 +01:00
|
|
|
@node Maildir searches
|
|
|
|
@section Maildir searches
|
|
|
|
|
2011-12-19 21:11:47 +01:00
|
|
|
Maildir searches are quite similar to bookmark searches (see @ref{Bookmarks}),
|
2016-12-31 17:01:30 +01:00
|
|
|
with the difference being that the target is always a maildir --- maildir
|
|
|
|
queries provide a `traditional' folder-like interface to a search-based e-mail
|
2012-02-06 18:48:33 +01:00
|
|
|
client. By default, maildir searches are available in the @ref{Main view},
|
|
|
|
@ref{Headers view}, and @ref{Message view}, with the key @key{j}
|
|
|
|
(@code{mu4e-jump-to-maildir}).
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-04-02 19:00:42 +02:00
|
|
|
@subsection Setting up maildir shortcuts
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
You can search for maildirs like any other message property
|
2012-10-14 16:00:25 +02:00
|
|
|
(e.g. with a query like @t{maildir:/myfolder}), but since it is so common,
|
|
|
|
@t{mu4e} offers a shortcut for this.
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2020-02-25 20:22:24 +01:00
|
|
|
For this to work, you need to set the variable
|
|
|
|
@code{mu4e-maildir-shortcuts} to the list of maildirs you want to have
|
|
|
|
quick access to, for example:
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2012-02-06 18:48:33 +01:00
|
|
|
@lisp
|
2016-01-10 10:56:58 +01:00
|
|
|
(setq mu4e-maildir-shortcuts
|
2020-02-25 20:22:24 +01:00
|
|
|
'( (:maildir "/inbox" :key ?i)
|
|
|
|
(:maildir "/archive" :key ?a)
|
|
|
|
(:maildir "/lists" :key ?l)
|
|
|
|
(:maildir "/work" :key ?w)
|
|
|
|
(:maildir "/sent" :key ?s)))
|
2012-02-06 18:48:33 +01:00
|
|
|
@end lisp
|
2011-12-19 21:11:47 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
This sets @key{i} as a shortcut for the @t{/inbox} folder --- effectively a
|
2012-10-14 16:00:25 +02:00
|
|
|
query @t{maildir:/inbox}. There is a special shortcut @key{o} or @key{/} for
|
|
|
|
@emph{other} (so don't use those for your own shortcuts!), which allows you to
|
|
|
|
choose from @emph{all} maildirs that you have. There is support for
|
|
|
|
autocompletion; note that the list of maildirs is determined when @t{mu4e}
|
|
|
|
starts; if there are changes in the maildirs while @t{mu4e} is running, you
|
|
|
|
need to restart @t{mu4e}.
|
|
|
|
|
|
|
|
Each of the folder names is relative to your top-level maildir directory; so
|
|
|
|
if you keep your mail in @file{~/Maildir}, @file{/inbox} would refer to
|
|
|
|
@file{~/Maildir/inbox}. With these shortcuts, you can jump around your
|
2016-12-31 17:01:30 +01:00
|
|
|
maildirs (folders) very quickly --- for example, getting to the @t{/lists}
|
2012-10-14 16:00:25 +02:00
|
|
|
folder only requires you to type @kbd{jl}, then change to @t{/work} with
|
|
|
|
@kbd{jw}.
|
|
|
|
|
2013-06-16 10:54:08 +02:00
|
|
|
While in queries you need to quote folder names (maildirs) with spaces in
|
|
|
|
them, you should @emph{not} quote them when used in
|
|
|
|
@code{mu4e-maildir-shortcuts}, since @t{mu4e} does that automatically for you.
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
The very same shortcuts are used by @kbd{M-x mu4e-mark-for-move} (default
|
2015-05-27 20:49:18 +02:00
|
|
|
shortcut @key{m}); so, for example, if you want to move a message to the
|
2012-10-11 16:50:32 +02:00
|
|
|
@t{/archive} folder, you can do so by typing @kbd{ma}.
|
2011-12-19 08:07:03 +01:00
|
|
|
|
2012-05-10 08:56:02 +02:00
|
|
|
@node Other search functionality
|
|
|
|
@section Other search functionality
|
|
|
|
|
|
|
|
@subsection Navigating through search queries
|
|
|
|
You can navigate through previous/next queries using
|
|
|
|
@code{mu4e-headers-query-prev} and @code{mu4e-headers-query-next}, which are
|
2012-10-14 16:00:25 +02:00
|
|
|
bound to @key{M-left} and @key{M-right}, similar to what some web browsers do.
|
2012-05-10 08:56:02 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu4e} tries to be smart and not record duplicate queries. Also, the number
|
|
|
|
of queries remembered has a fixed limit, so @t{mu4e} won't use too much
|
|
|
|
memory, even if used for a long time. However, if you want to forget
|
|
|
|
previous/next queries, you can use @kbd{M-x mu4e-headers-forget-queries}.
|
2012-05-10 08:56:02 +02:00
|
|
|
|
|
|
|
@subsection Narrowing search results
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
It can be useful to narrow existing search results, that is, to add some
|
2012-05-10 08:56:02 +02:00
|
|
|
clauses to the current query to match fewer messages.
|
|
|
|
|
2014-08-08 13:18:29 +02:00
|
|
|
For example, suppose you're looking at some mailing list, perhaps by
|
2012-10-14 16:00:25 +02:00
|
|
|
jumping to a maildir (@kbd{M-x mu4e-headers-jump-to-maildir}, @key{j}) or
|
|
|
|
because you followed some bookmark (@kbd{M-x mu4e-headers-search-bookmark},
|
|
|
|
@key{b}). Now, you want to narrow things down to only those messages that have
|
2012-05-10 08:56:02 +02:00
|
|
|
attachments.
|
2014-08-08 13:18:29 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
This is when @kbd{M-x mu4e-headers-search-narrow} (@key{/}) comes in handy. It
|
2012-09-30 19:12:07 +02:00
|
|
|
asks for an additional search pattern, which is appended to the current search
|
|
|
|
query, in effect getting you the subset of the currently shown headers that
|
|
|
|
also match this extra search pattern. @key{\} takes you back to the previous
|
2016-12-31 17:01:30 +01:00
|
|
|
query, so, effectively `widens' the search. Technically, narrowing the results
|
2016-05-09 22:14:36 +02:00
|
|
|
of query @t{x} with expression @t{y} implies doing a search @t{(x) AND (y)}.
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2015-12-23 21:01:51 +01:00
|
|
|
Note that messages that were not in your original search results because
|
|
|
|
of @code{mu4e-headers-results-limit} may show up in the narrowed query.
|
2012-12-25 18:42:07 +01:00
|
|
|
|
|
|
|
@subsection Including related messages
|
|
|
|
@anchor{Including related messages}
|
|
|
|
|
2012-12-27 15:27:53 +01:00
|
|
|
It can be useful to not only show the messages that directly match a certain
|
|
|
|
query, but also include messages that are related to these messages. That is,
|
2013-10-12 15:04:12 +02:00
|
|
|
messages that belong to the same discussion threads are included in the
|
2012-12-27 15:27:53 +01:00
|
|
|
results, just like e.g. Gmail does it. You can enable this behavior by setting
|
|
|
|
@code{mu4e-headers-include-related} to @code{t}, and you can toggle between
|
|
|
|
including/not-including with @key{W}.
|
2012-12-25 18:42:07 +01:00
|
|
|
|
2016-01-12 20:38:07 +01:00
|
|
|
Be careful though when e.g. deleting ranges of messages from a certain
|
2016-12-31 17:01:30 +01:00
|
|
|
folder --- the list may now also include messages from @emph{other}
|
2016-01-12 20:38:07 +01:00
|
|
|
folders.
|
2013-10-12 15:04:12 +02:00
|
|
|
|
2012-12-25 18:42:07 +01:00
|
|
|
@subsection Skipping duplicates
|
|
|
|
@anchor{Skipping duplicates}
|
|
|
|
|
2013-05-13 22:02:03 +02:00
|
|
|
Another useful feature is skipping of @emph{duplicate messages}. When you have
|
|
|
|
copies of messages, there's usually little value in including more than one in
|
|
|
|
search results. A common reason for having multiple copies of messages is the
|
2012-12-27 15:27:53 +01:00
|
|
|
combination of Gmail and @t{offlineimap}, since that is the way the labels /
|
|
|
|
virtual folders in Gmail are represented. You can enable skipping duplicates
|
|
|
|
by setting @code{mu4e-headers-skip-duplicates} to @code{t}, and you can toggle
|
|
|
|
between the skipping/not skipping with @key{V}.
|
2012-12-25 18:42:07 +01:00
|
|
|
|
2012-12-27 15:27:53 +01:00
|
|
|
Note, messages are considered duplicates when they have the same
|
|
|
|
@t{Message-Id}.
|
2012-05-13 14:02:40 +02:00
|
|
|
|
|
|
|
@node Marking
|
|
|
|
@chapter Marking
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
In @t{mu4e}, the common way to do things with messages is a two-step process -
|
2012-05-13 14:02:40 +02:00
|
|
|
first you @emph{mark} them for a certain action, then you @emph{execute}
|
2012-10-14 16:00:25 +02:00
|
|
|
(@key{x}) those marks. This is similar to the way @t{dired} operates. Marking
|
|
|
|
can happen in both the @ref{Headers view} and the @ref{Message view}.
|
2012-05-13 14:02:40 +02:00
|
|
|
|
|
|
|
@menu
|
2016-12-31 17:01:30 +01:00
|
|
|
* Marking messages::Selecting message do something with them
|
2016-01-10 10:56:58 +01:00
|
|
|
* What to mark for::What can we do with them
|
|
|
|
* Executing the marks::Do it
|
2019-01-14 10:39:05 +01:00
|
|
|
* Trashing messages::Exceptions for mailboxes like Gmail
|
2016-01-10 10:56:58 +01:00
|
|
|
* Leaving the headers buffer::Handling marks automatically when leaving
|
|
|
|
* Built-in marking functions::Helper functions for dealing with them
|
|
|
|
* Custom mark functions::Define your own mark function
|
|
|
|
* Adding a new kind of mark::Adding your own marks
|
2012-05-13 14:02:40 +02:00
|
|
|
@end menu
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Marking messages
|
|
|
|
@section Marking messages
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
There are multiple ways to mark messages:
|
2012-05-13 14:02:40 +02:00
|
|
|
@itemize
|
|
|
|
@item @emph{message at point}: you can put a mark on the message-at-point in
|
|
|
|
either the @ref{Headers view} or @ref{Message view}
|
|
|
|
@item @emph{region}: you can put a mark on all messages in the current region
|
|
|
|
(selection) in the @ref{Headers view}
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @emph{pattern}: you can put a mark on all messages in the @ref{Headers
|
|
|
|
view} matching a certain pattern with @kbd{M-x mu4e-headers-mark-pattern}
|
2012-05-13 14:02:40 +02:00
|
|
|
(@key{%})
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @emph{thread/subthread}: You can put a mark on all the messages in the
|
|
|
|
thread/subthread at point with @kbd{M-x mu4e-headers-mark-thread} and @kbd{M-x
|
|
|
|
mu4e-headers-mark-subthread}, respectively
|
2012-05-13 14:02:40 +02:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@node What to mark for
|
|
|
|
@section What to mark for
|
|
|
|
|
2013-06-16 22:04:54 +02:00
|
|
|
@t{mu4e} supports a number of marks:
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2012-06-14 10:13:00 +02:00
|
|
|
@verbatim
|
2016-01-10 10:56:58 +01:00
|
|
|
mark for/as | keybinding | description
|
2016-03-23 06:11:48 +01:00
|
|
|
-------------+-------------+------------------------------
|
2016-01-10 10:56:58 +01:00
|
|
|
'something' | *, <insert> | mark now, decide later
|
|
|
|
delete | D, <delete> | delete
|
|
|
|
flag | + | mark as 'flagged' ('starred')
|
|
|
|
move | m | move to some maildir
|
|
|
|
read | ! | mark as read
|
|
|
|
refile | r | mark for refiling
|
|
|
|
trash | d | move to the trash folder
|
|
|
|
untrash | = | remove 'trash' flag
|
|
|
|
unflag | - | remove 'flagged' mark
|
|
|
|
unmark | u | remove mark at point
|
|
|
|
unmark all | U | remove all marks
|
|
|
|
unread | ? | marks as unread
|
|
|
|
action | a | apply some action
|
2012-06-14 10:13:00 +02:00
|
|
|
@end verbatim
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2012-06-20 19:42:39 +02:00
|
|
|
|
2013-06-16 22:04:54 +02:00
|
|
|
After marking a message, the left-most columns in the headers view indicate
|
|
|
|
the kind of mark. This is informative, but if you mark many (say, thousands)
|
|
|
|
messages, this slows things down significantly@footnote{this uses an
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs feature called @emph{overlays}, which are slow when used a lot
|
2013-06-16 22:04:54 +02:00
|
|
|
in a buffer}. For this reason, you can disable this by setting
|
|
|
|
@code{mu4e-headers-show-target} to @code{nil}.
|
2012-06-14 18:10:02 +02:00
|
|
|
|
2015-04-26 16:09:06 +02:00
|
|
|
@t{something} is a special kind of mark; you can use it to mark messages
|
2016-12-31 17:01:30 +01:00
|
|
|
for `something', and then decide later what the `something' should
|
|
|
|
be@footnote{This kind of `deferred marking' is similar to the facility
|
2015-04-26 16:09:06 +02:00
|
|
|
in @t{dired}, @t{midnight commander}
|
2018-03-24 12:20:00 +01:00
|
|
|
(@url{https://www.midnight-commander.org/}) and the like, and uses the
|
2015-04-26 16:09:06 +02:00
|
|
|
same key binding (@key{insert}).} Later, you can set the actual mark
|
|
|
|
using @kbd{M-x mu4e-mark-resolve-deferred-marks}
|
|
|
|
(@key{#}). Alternatively, @t{mu4e} will ask you when you try to execute
|
|
|
|
the marks (@key{x}).
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2012-06-14 10:13:00 +02:00
|
|
|
@node Executing the marks
|
|
|
|
@section Executing the marks
|
|
|
|
|
|
|
|
After you have marked some messages, you can execute them with @key{x}
|
2012-10-14 16:00:25 +02:00
|
|
|
(@kbd{M-x mu4e-mark-execute-all}).
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2016-01-30 13:10:23 +01:00
|
|
|
A hook, @code{mu4e-mark-execute-pre-hook}, is available which is run
|
|
|
|
right before execution of each mark. The hook is called with two
|
|
|
|
arguments, the mark and the message itself.
|
|
|
|
|
2019-01-14 10:39:05 +01:00
|
|
|
@node Trashing messages
|
|
|
|
@section Trashing messages
|
|
|
|
|
|
|
|
For regular mailboxes, trashing works like other marks: when executed,
|
|
|
|
the message is flagged as trashed. Depending on your mailbox provider,
|
|
|
|
the trash flag is used to automatically move the message to the trash
|
|
|
|
folder (@code{mu4e-trash-folder}) for instance.
|
|
|
|
|
|
|
|
Some mailboxes behave differently however and they don't interpret the
|
|
|
|
trash flag. In cases like Gmail, the message must be @emph{moved} to
|
|
|
|
the trash folder and the trash flag must not be used.
|
|
|
|
|
2012-05-13 14:02:40 +02:00
|
|
|
@node Leaving the headers buffer
|
|
|
|
@section Leaving the headers buffer
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
When you quit or update a headers buffer that has marked messages (for
|
|
|
|
example, by doing a new search), @t{mu4e} asks you what to do with them,
|
2016-12-31 17:01:30 +01:00
|
|
|
depending on the value of the variable @code{mu4e-headers-leave-behavior} ---
|
2012-10-14 16:00:25 +02:00
|
|
|
see its documentation.
|
2012-09-30 19:12:07 +02:00
|
|
|
|
|
|
|
@node Built-in marking functions
|
|
|
|
@section Built-in marking functions
|
|
|
|
|
|
|
|
Some examples of @t{mu4e}'s built-in marking functions.
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item @emph{Mark the message at point for trashing}: press @key{d}
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @emph{Mark all messages in the buffer as unread}: press @kbd{C-x h o}
|
|
|
|
@item @emph{Delete the messages in the current thread}: press @kbd{T D}
|
2012-09-30 19:12:07 +02:00
|
|
|
@item @emph{Mark messages with a subject matching ``hello'' for flagging}:
|
2012-10-14 16:00:25 +02:00
|
|
|
press @kbd{% s hello RET}.
|
2012-09-30 19:12:07 +02:00
|
|
|
@end itemize
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2012-06-14 20:54:24 +02:00
|
|
|
@node Custom mark functions
|
|
|
|
@section Custom mark functions
|
|
|
|
|
|
|
|
Sometimes, the built-in functions to mark messages may not be sufficient for
|
|
|
|
your needs. For this, @t{mu4e} offers an easy way to define your own custom
|
2012-10-14 16:00:25 +02:00
|
|
|
mark functions. You can choose one of the custom marker functions by pressing
|
|
|
|
@key{&} in the @ref{Headers view} and @ref{Message view}.
|
2012-06-14 20:54:24 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Custom mark functions are to be appended to the list
|
|
|
|
@code{mu4e-headers-custom-markers}. Each of the elements of this list
|
2012-10-11 16:50:32 +02:00
|
|
|
('markers') is a list with two or three elements:
|
2012-10-14 16:00:25 +02:00
|
|
|
@enumerate
|
2016-12-31 17:01:30 +01:00
|
|
|
@item The name of the marker --- a short string describing this marker. The
|
2012-09-30 19:12:07 +02:00
|
|
|
first character of this string determines its shortcut, so these should be
|
|
|
|
unique. If necessary, simply prefix the name with a unique character.
|
2012-10-17 17:35:23 +02:00
|
|
|
@item a predicate function, taking two arguments @var{msg} and @var{param}.
|
2014-11-30 23:11:57 +01:00
|
|
|
@var{msg} is the message plist (see @ref{Message functions}) and @var{param} is
|
2012-10-16 20:43:49 +02:00
|
|
|
a parameter provided by the third of the marker elements (see the next
|
|
|
|
item). The predicate function should return non-@t{nil} if the message
|
|
|
|
matches.
|
2012-09-30 19:12:07 +02:00
|
|
|
@item (optionally) a function that is evaluated once, and the result is passed as a
|
|
|
|
parameter to the predicate function. This is useful when user-input is needed.
|
2012-10-14 16:00:25 +02:00
|
|
|
@end enumerate
|
2012-06-14 20:54:24 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Let's look at an example: suppose we want to match all messages that have more
|
2016-12-31 17:01:30 +01:00
|
|
|
than @emph{n} recipients --- we could do this with the following recipe:
|
2012-06-14 20:54:24 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-headers-custom-markers
|
2016-01-12 20:38:07 +01:00
|
|
|
'("More than n recipients"
|
|
|
|
(lambda (msg n)
|
|
|
|
(> (+ (length (mu4e-message-field msg :to))
|
|
|
|
(length (mu4e-message-field msg :cc))) n))
|
|
|
|
(lambda ()
|
|
|
|
(read-number "Match messages with more recipients than: "))) t)
|
2012-06-14 20:54:24 +02:00
|
|
|
@end lisp
|
|
|
|
|
2014-11-22 12:23:01 +01:00
|
|
|
After evaluating this expression, you can use it by pressing @key{&} in
|
|
|
|
the headers buffer to select a custom marker function, and then @key{M}
|
|
|
|
to choose this particular one (@t{M} because it is the first character
|
|
|
|
of the description).
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2012-06-14 20:54:24 +02:00
|
|
|
As you can see, it's not very hard to define simple functions to match
|
2012-10-07 15:54:24 +02:00
|
|
|
messages. There are more examples in the defaults for
|
2012-10-14 16:00:25 +02:00
|
|
|
@code{mu4e-headers-custom-markers}; see @file{mu4e-headers.el} and see
|
2012-10-07 15:54:24 +02:00
|
|
|
@ref{Extending mu4e} for general information about writing your own functions.
|
2012-05-10 08:56:02 +02:00
|
|
|
|
2014-12-01 22:21:10 +01:00
|
|
|
|
|
|
|
@node Adding a new kind of mark
|
|
|
|
@section Adding a new kind of mark
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
It is possible to configure new marks. To do so, one can add entries
|
2014-12-01 22:21:10 +01:00
|
|
|
in the list @code{mu4e-marks}. Such an element must have the following form:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(SYMBOL
|
2016-01-12 20:38:07 +01:00
|
|
|
:char STRING
|
|
|
|
:prompt STRING
|
|
|
|
:ask-target (lambda () TARGET)
|
|
|
|
:dyn-target (lambda (TARGET MSG) DYN-TARGET)
|
|
|
|
:show-target (lambda (DYN-TARGET) STRING)
|
|
|
|
:action (lambda (DOCID MSG DYN-TARGET) nil))
|
2014-12-01 22:21:10 +01:00
|
|
|
@end lisp
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
The symbol can be any symbol, except for @code{'unmark} and
|
|
|
|
@code{'something}, which are reserved. The rest is a plist with the
|
|
|
|
following elements:
|
2014-12-01 22:21:10 +01:00
|
|
|
|
|
|
|
@itemize
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{:char} --- the character to display in the headers view.
|
|
|
|
@item @code{:prompt} --- the prompt to use when asking for marks
|
2016-01-03 12:29:19 +01:00
|
|
|
(used for example when marking a whole thread).
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{:ask-target} --- a function run once per bulk-operation, and thus suitable for
|
|
|
|
querying the user about a target for move-like marks. If @t{nil}, the
|
|
|
|
@t{TARGET} passed to @code{:dyn-target} is @t{nil}.
|
|
|
|
@item @code{:dyn-target} --- a function run once per message
|
|
|
|
(The message is passed as @t{MSG} to the function). This function allows
|
|
|
|
to compute a per-message target, for refile-like marks. If @t{nil}, the
|
|
|
|
@t{DYN-TARGET} passed to the @code{:action} is the @t{TARGET} obtained as above.
|
|
|
|
@item @code{:show-target} --- how to display the target in the headers view.
|
|
|
|
If @code{:show-target} is @t{nil} the @t{DYN-TARGET} is shown (and
|
|
|
|
@t{DYN-TARGET} must be a string).
|
|
|
|
@item @code{:action} --- the action to apply on the message when the mark is executed.
|
2014-12-01 22:21:10 +01:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
As an example, suppose we would like to add a mark for tagging
|
2016-12-31 17:01:30 +01:00
|
|
|
messages (GMail-style), then we can run the following code (after
|
|
|
|
loading @t{mu4e}):
|
2014-12-01 22:21:10 +01:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-marks
|
2016-01-12 20:38:07 +01:00
|
|
|
'(tag
|
|
|
|
:char "g"
|
|
|
|
:prompt "gtag"
|
|
|
|
:ask-target (lambda () (read-string "What tag do you want to add?"))
|
|
|
|
:action (lambda (docid msg target)
|
|
|
|
(mu4e-action-retag-message msg (concat "+" target)))))
|
2014-12-01 22:21:10 +01:00
|
|
|
@end lisp
|
|
|
|
|
2014-12-04 23:36:23 +01:00
|
|
|
As another example, suppose we would like to ``archive and mark read''
|
2016-12-31 17:01:30 +01:00
|
|
|
a message (GMail-style), then we can run the following code (after
|
|
|
|
loading @t{mu4e}):
|
2014-12-04 23:36:23 +01:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-marks
|
2016-01-12 20:38:07 +01:00
|
|
|
'(archive
|
|
|
|
:char "A"
|
|
|
|
:prompt "Archive"
|
|
|
|
:show-target (lambda (target) "archive")
|
|
|
|
:action (lambda (docid msg target)
|
|
|
|
;; must come before proc-move since retag runs
|
|
|
|
;; 'sed' on the file
|
|
|
|
(mu4e-action-retag-message msg "-\\Inbox")
|
|
|
|
(mu4e~proc-move docid nil "+S-u-N"))))
|
2014-12-04 23:36:23 +01:00
|
|
|
@end lisp
|
|
|
|
|
2014-12-01 22:21:10 +01:00
|
|
|
Adding to @code{mu4e-marks} list allows to use the mark in bulk operations
|
|
|
|
(for example when tagging a whole thread), but does not bind the mark
|
|
|
|
to a key to use at the top-level. This must be done separately. In our
|
|
|
|
example:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(mu4e~headers-defun-mark-for tag)
|
2014-12-04 23:36:23 +01:00
|
|
|
(mu4e~headers-defun-mark-for archive)
|
2014-12-01 22:21:10 +01:00
|
|
|
(define-key mu4e-headers-mode-map (kbd "g") 'mu4e-headers-mark-for-tag)
|
2014-12-04 23:36:23 +01:00
|
|
|
(define-key mu4e-headers-mode-map (kbd "A") 'mu4e-headers-mark-for-archive)
|
2014-12-01 22:21:10 +01:00
|
|
|
@end lisp
|
|
|
|
|
2015-12-13 16:44:47 +01:00
|
|
|
@node Contexts
|
|
|
|
@chapter Contexts
|
|
|
|
|
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* What are contexts::Defining the concept
|
|
|
|
* Context policies::How to determine the current context
|
|
|
|
* Contexts and special folders::Using context variables to determine them
|
|
|
|
* Contexts example::How to define contexts
|
2015-12-13 16:44:47 +01:00
|
|
|
@end menu
|
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
It can be useful to switch between different sets of settings in
|
|
|
|
@t{mu4e}; a typical example is the case where you have different e-mail
|
|
|
|
accounts for private and work email, each with their own values for
|
|
|
|
folders, e-mail addresses, mailservers and so on.
|
2015-12-13 16:44:47 +01:00
|
|
|
|
2015-12-13 17:14:24 +01:00
|
|
|
The @code{mu4e-context} system is a @t{mu4e}-specific mechanism to allow
|
2017-01-24 22:58:32 +01:00
|
|
|
for that; users can define different @i{contexts} corresponding with
|
2016-01-03 12:29:19 +01:00
|
|
|
groups of setting and either manually switch between them, or let
|
2017-01-24 22:58:32 +01:00
|
|
|
@t{mu4e} determine the right context based on some user-provided
|
|
|
|
function.
|
2015-12-13 16:44:47 +01:00
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
Note that there are a number of existing ways to switch accounts in
|
2015-12-13 17:14:24 +01:00
|
|
|
@t{mu4e}, for example using the method described in the @ref{Tips and
|
2016-12-31 17:01:30 +01:00
|
|
|
Tricks} section of this manual. Those still work --- but the new mechanism
|
2015-12-13 17:14:24 +01:00
|
|
|
has the benefit of being a core part of @code{mu4e}, thus allowing for
|
|
|
|
deeper integration.
|
2015-12-13 16:44:47 +01:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node What are contexts
|
|
|
|
@section What are contexts
|
2016-01-03 12:29:19 +01:00
|
|
|
|
|
|
|
Let's see what's contained in a context. Most of it is optional.
|
2015-12-13 16:44:47 +01:00
|
|
|
|
|
|
|
A @code{mu4e-context} is Lisp object with the following members:
|
|
|
|
@itemize
|
|
|
|
@item @t{name}: the name of the context, e.g. @t{work} or @t{private}
|
2016-01-03 12:29:19 +01:00
|
|
|
@item @t{vars}:
|
|
|
|
an association-list (alist) of variable settings for this account.
|
2015-12-21 21:15:47 +01:00
|
|
|
@item @t{enter-func}:
|
2016-01-03 12:29:19 +01:00
|
|
|
an (optional) function that takes no parameter and is invoked when entering
|
|
|
|
the context. You can use this for extra setup etc.
|
2015-12-13 16:44:47 +01:00
|
|
|
@item @t{leave-func}:
|
2016-01-03 12:29:19 +01:00
|
|
|
an (optional) function that takes no parameter and is invoked when leaving
|
|
|
|
the context. You can use this for clearing things up.
|
2015-12-13 16:44:47 +01:00
|
|
|
@item @t{match-func}:
|
2016-01-03 12:29:19 +01:00
|
|
|
an (optional) function that takes an @t{MSG} message plist as argument,
|
|
|
|
and returns non-@t{nil} if this context matches the situation. @t{mu4e}
|
|
|
|
uses the first context that matches, in a couple of situations:
|
|
|
|
@itemize
|
|
|
|
@item when starting @t{mu4e} to determine the
|
|
|
|
starting context; in this case, @t{MSG} is nil. You can use e.g. the
|
|
|
|
host you're running or the time of day to determine which context
|
|
|
|
matches.
|
|
|
|
@item before replying to or forwarding a
|
2015-12-13 16:44:47 +01:00
|
|
|
message with the given message plist as parameter, or @t{nil} when
|
|
|
|
composing a brand new message. The function should return @t{t} when
|
|
|
|
this context is the right one for this message, or @t{nil} otherwise.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item when determining the target folders for deleting, refiling etc;
|
2016-01-03 12:29:19 +01:00
|
|
|
see @ref{Contexts and special folders}.
|
|
|
|
@end itemize
|
2015-12-13 16:44:47 +01:00
|
|
|
@end itemize
|
|
|
|
|
2015-12-13 17:14:24 +01:00
|
|
|
@t{mu4e} uses a variable @code{mu4e-contexts}, which is a list of such
|
2015-12-13 16:44:47 +01:00
|
|
|
objects.
|
|
|
|
|
2015-12-23 21:01:51 +01:00
|
|
|
@node Context policies
|
|
|
|
@section Context policies
|
2015-12-15 17:20:31 +01:00
|
|
|
|
2015-12-23 21:01:51 +01:00
|
|
|
When you have defined contexts and you start @t{mu4e} it decides which
|
|
|
|
context to use based on the variable @code{mu4e-context-policy};
|
|
|
|
similarly, when you compose a new message, the context is determined
|
|
|
|
using @code{mu4e-compose-context-policy}.
|
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
For both of these, you can choose one of the following policies:
|
2015-12-23 21:01:51 +01:00
|
|
|
@itemize
|
2016-01-03 12:29:19 +01:00
|
|
|
@item a symbol @code{always-ask}: unconditionally ask the user what context to pick.
|
2015-12-23 21:01:51 +01:00
|
|
|
@end itemize
|
|
|
|
|
2016-01-03 12:29:19 +01:00
|
|
|
The other choices @b{only apply if none of the contexts match} (i.e.,
|
|
|
|
none of the contexts' match-functions returns @code{t}). We have the
|
|
|
|
following options:
|
2015-12-23 21:01:51 +01:00
|
|
|
|
|
|
|
@itemize
|
2016-01-03 12:29:19 +01:00
|
|
|
@item a symbol @code{ask}: ask the user if @t{mu4e} can't figure
|
|
|
|
things out the context by itself (through the match-function). This is a
|
|
|
|
good policy if there are no match functions, or if the match functions
|
|
|
|
don't cover all cases.
|
|
|
|
@item a symbol @code{ask-if-none}: if there's already a context, don't change it; otherwise,
|
|
|
|
ask the user.
|
|
|
|
@item a symbol @code{pick-first}: pick the first (default) context. This is a good choice if
|
|
|
|
you want to specify context for special case, and fall back to the first
|
|
|
|
one if none match.
|
2016-12-31 17:01:30 +01:00
|
|
|
@item @code{nil}: don't change the context; this is useful if you don't change
|
2016-01-03 12:29:19 +01:00
|
|
|
contexts very often, and e.g. manually changes contexts with @kbd{M-x
|
|
|
|
mu4e-context-switch}.
|
2015-12-23 21:01:51 +01:00
|
|
|
@end itemize
|
2015-12-15 17:20:31 +01:00
|
|
|
|
2015-12-29 17:47:12 +01:00
|
|
|
@node Contexts and special folders
|
|
|
|
@section Contexts and special folders
|
|
|
|
|
|
|
|
As we discussed in @ref{Folders} and @ref{Dynamic folders}, @t{mu4e}
|
|
|
|
recognizes a number of special folders: @code{mu4e-sent-folder},
|
|
|
|
@code{mu4e-drafts-folder}, @code{mu4e-trash-folder} and
|
|
|
|
@code{mu4e-refile-folder}.
|
|
|
|
|
|
|
|
When you have a headers-buffer with messages that belong to different
|
|
|
|
contexts (say, a few different accounts), it is desirable for each of
|
2016-12-31 17:01:30 +01:00
|
|
|
them to use the specific folders for their own context --- so, for
|
2015-12-29 17:47:12 +01:00
|
|
|
instance, if you trash a message, it needs to go to the trash-folder for
|
|
|
|
the account it belongs to, which is not necessarily the current context.
|
|
|
|
|
|
|
|
To make this easy to do, whenever @t{mu4e} needs to know the value for
|
|
|
|
such a special folder for a given message, it tries to determine the
|
2016-01-03 12:29:19 +01:00
|
|
|
appropriate context using @code{mu4e-context-determine} (and policy
|
|
|
|
@t{nil}; see @ref{Context policies}). If it finds a matching context, it
|
|
|
|
let-binds the @code{vars} for that account, and then determines the
|
|
|
|
value for the folder. It does not, however, call the @code{enter-func}
|
2017-01-24 22:58:32 +01:00
|
|
|
or @code{leave-func}, since we are not really switching contexts.
|
2015-12-29 17:47:12 +01:00
|
|
|
|
2016-11-05 11:03:02 +01:00
|
|
|
In practice, this means that as long as each of the accounts has a good
|
|
|
|
@t{match-func}, all message operations automatically find the
|
2015-12-29 17:47:12 +01:00
|
|
|
appropriate folders.
|
|
|
|
|
2015-12-13 16:44:47 +01:00
|
|
|
@node Contexts example
|
|
|
|
@section Example
|
|
|
|
|
2015-12-23 21:01:51 +01:00
|
|
|
Let's explain how contexts work by looking at an example. We define two
|
2016-12-31 17:01:30 +01:00
|
|
|
contexts, `Private' and `Work' for a fictional user @emph{Alice
|
2015-12-23 21:01:51 +01:00
|
|
|
Derleth}.
|
2015-12-13 16:44:47 +01:00
|
|
|
|
2015-12-15 17:20:31 +01:00
|
|
|
Note that in this case, we automatically switch to the first context
|
|
|
|
when starting; see the discussion in the previous section.
|
|
|
|
|
2015-12-13 16:44:47 +01:00
|
|
|
@lisp
|
2016-12-31 17:01:30 +01:00
|
|
|
|
2016-03-16 00:13:03 +01:00
|
|
|
(setq mu4e-contexts
|
2016-01-12 20:38:07 +01:00
|
|
|
`( ,(make-mu4e-context
|
|
|
|
:name "Private"
|
2016-03-16 00:13:03 +01:00
|
|
|
:enter-func (lambda () (mu4e-message "Entering Private context"))
|
|
|
|
:leave-func (lambda () (mu4e-message "Leaving Private context"))
|
|
|
|
;; we match based on the contact-fields of the message
|
2016-01-12 20:38:07 +01:00
|
|
|
:match-func (lambda (msg)
|
2019-05-11 12:27:39 +02:00
|
|
|
(when msg
|
|
|
|
(mu4e-message-contact-field-matches msg
|
2016-01-12 20:38:07 +01:00
|
|
|
:to "aliced@@home.example.com")))
|
2016-03-16 00:13:03 +01:00
|
|
|
:vars '( ( user-mail-address . "aliced@@home.example.com" )
|
2016-01-12 20:38:07 +01:00
|
|
|
( user-full-name . "Alice Derleth" )
|
|
|
|
( mu4e-compose-signature .
|
|
|
|
(concat
|
|
|
|
"Alice Derleth\n"
|
|
|
|
"Lauttasaari, Finland\n"))))
|
|
|
|
,(make-mu4e-context
|
|
|
|
:name "Work"
|
|
|
|
:enter-func (lambda () (mu4e-message "Switch to the Work context"))
|
2016-03-16 00:13:03 +01:00
|
|
|
;; no leave-func
|
2017-02-17 23:52:06 +01:00
|
|
|
;; we match based on the maildir of the message
|
|
|
|
;; this matches maildir /Arkham and its sub-directories
|
2016-01-12 20:38:07 +01:00
|
|
|
:match-func (lambda (msg)
|
2017-02-17 23:52:06 +01:00
|
|
|
(when msg
|
|
|
|
(string-match-p "^/Arkham" (mu4e-message-field msg :maildir))))
|
2016-03-16 00:13:03 +01:00
|
|
|
:vars '( ( user-mail-address . "aderleth@@miskatonic.example.com" )
|
|
|
|
( user-full-name . "Alice Derleth" )
|
|
|
|
( mu4e-compose-signature .
|
2016-01-12 20:38:07 +01:00
|
|
|
(concat
|
|
|
|
"Prof. Alice Derleth\n"
|
2016-03-16 00:13:03 +01:00
|
|
|
"Miskatonic University, Dept. of Occult Sciences\n"))))
|
|
|
|
|
|
|
|
,(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 '( ( user-mail-address . "aderleth@@example.com" )
|
|
|
|
( user-full-name . "AliceD" )
|
|
|
|
( mu4e-compose-signature . nil)))))
|
2016-01-12 20:38:07 +01:00
|
|
|
|
|
|
|
;; set `mu4e-context-policy` and `mu4e-compose-policy` to tweak when mu4e should
|
|
|
|
;; guess or ask the correct context, e.g.
|
|
|
|
|
2019-05-11 12:27:39 +02:00
|
|
|
;; start with the first (default) context;
|
2016-01-12 20:38:07 +01:00
|
|
|
;; default is to ask-if-none (ask when there's no context yet, and none match)
|
|
|
|
;; (setq mu4e-context-policy 'pick-first)
|
|
|
|
|
|
|
|
;; compose with the current context is no context matches;
|
2019-05-11 12:27:39 +02:00
|
|
|
;; default is to ask
|
2016-03-16 00:13:03 +01:00
|
|
|
;; (setq mu4e-compose-context-policy nil)
|
2015-12-13 16:44:47 +01:00
|
|
|
@end lisp
|
|
|
|
|
2015-12-23 21:01:51 +01:00
|
|
|
A couple of notes about this example:
|
2015-12-13 16:44:47 +01:00
|
|
|
@itemize
|
2017-01-03 01:17:29 +01:00
|
|
|
@item You can manually switch the context use @code{M-x mu4e-context-switch},
|
2016-01-03 12:29:19 +01:00
|
|
|
by default bound to @kbd{;} in headers, view and main mode.
|
2017-01-03 01:17:29 +01:00
|
|
|
The current context appears in the mode-line.
|
2019-05-11 12:27:39 +02:00
|
|
|
@item Normally, @code{M-x mu4e-context-switch} does not call the enter or
|
2016-01-03 12:29:19 +01:00
|
|
|
leave functions if the 'new' context is the same as the old one.
|
2015-12-23 21:01:51 +01:00
|
|
|
However, with a prefix-argument (@kbd{C-u}), you can force @t{mu4e} to
|
|
|
|
invoke those function even in that case.
|
2019-05-11 12:27:39 +02:00
|
|
|
@item The function @code{mu4e-context-current} returns the current-context;
|
2016-01-03 12:29:19 +01:00
|
|
|
the current context is also visible in the mode-line when in
|
2015-12-21 21:15:47 +01:00
|
|
|
headers, view or main mode.
|
2019-05-11 12:27:39 +02:00
|
|
|
@item You can set any kind of variable; including settings for mail servers etc.
|
2020-02-06 19:28:24 +01:00
|
|
|
However, settings such as @code{mu4e-mu-home} are not changeable after
|
|
|
|
they have been set without quitting @t{mu4e} first.
|
2019-05-11 12:27:39 +02:00
|
|
|
@item @code{leave-func} (if defined) for the context we are leaving, is invoked
|
2016-01-03 12:29:19 +01:00
|
|
|
before the @code{enter-func} (if defined) of the
|
2015-12-21 21:15:47 +01:00
|
|
|
context we are entering.
|
2015-12-13 16:44:47 +01:00
|
|
|
@item @code{enter-func} (if defined) is invoked before setting the variables.
|
2015-12-21 21:15:47 +01:00
|
|
|
@item @code{match-func} (if defined) is invoked just before @code{mu4e-compose-pre-hook}.
|
2016-01-03 12:29:19 +01:00
|
|
|
@item See the variables @code{mu4e-context-policy} and
|
2019-05-11 12:27:39 +02:00
|
|
|
@code{mu4e-compose-context-policy} to tweak what @t{mu4e} should do when
|
2016-01-03 12:29:19 +01:00
|
|
|
no context matches (or if you always want to be asked).
|
2019-05-11 12:27:39 +02:00
|
|
|
@item Finally, be careful to get the quotations right --- backticks, single quotes
|
2016-01-03 12:29:19 +01:00
|
|
|
and commas and note the '.' between variable name and its value.
|
2015-12-13 16:44:47 +01:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-27 16:21:45 +02:00
|
|
|
@node Dynamic folders
|
|
|
|
@chapter Dynamic folders
|
|
|
|
|
2015-12-13 16:44:47 +01:00
|
|
|
In @ref{Folders}, we explained how you can set up @t{mu4e}'s special
|
|
|
|
folders:
|
2012-09-27 16:21:45 +02:00
|
|
|
@lisp
|
2012-10-07 15:54:24 +02:00
|
|
|
(setq
|
2020-02-24 20:58:45 +01:00
|
|
|
mu4e-sent-folder "/sent" ;; sent messages
|
|
|
|
mu4e-drafts-folder "/drafts" ;; unfinished messages
|
|
|
|
mu4e-trash-folder "/trash" ;; trashed messages
|
|
|
|
mu4e-refile-folder "/archive") ;; saved messages
|
2012-09-27 16:21:45 +02:00
|
|
|
@end lisp
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
In some cases, having such static folders may not suffice --- perhaps you want
|
2012-10-14 16:00:25 +02:00
|
|
|
to change the folders depending on the context. For example, the folder for
|
2012-10-17 17:35:23 +02:00
|
|
|
refiling could vary, based on the sender of the message.
|
2012-09-30 19:12:07 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
To make this possible, instead of setting the standard folders to a string,
|
|
|
|
you can set them to be a @emph{function} that takes a message as its
|
|
|
|
parameter, and returns the desired folder name. This chapter shows you how to
|
|
|
|
do that. For a more general discussion of how to extend @t{mu4e} and writing
|
|
|
|
your own functions, see @ref{Extending mu4e}.
|
2012-09-27 16:21:45 +02:00
|
|
|
|
2015-12-29 17:47:12 +01:00
|
|
|
If you use @t{mu4e-context}, see @ref{Contexts and special folders} for
|
|
|
|
what that means for these special folders.
|
|
|
|
|
2012-09-28 16:12:09 +02:00
|
|
|
@menu
|
2012-10-07 15:54:24 +02:00
|
|
|
* Smart refiling:: Automatically choose the target folder
|
2012-10-11 16:50:32 +02:00
|
|
|
* Other dynamic folders:: Flexible folders for sent, trash, drafts
|
2012-09-28 16:12:09 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
|
|
|
|
@node Smart refiling
|
|
|
|
@section Smart refiling
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
When refiling messages, perhaps to archive them, it can be useful to have
|
|
|
|
different target folders for different messages, based on some property of
|
2016-12-31 17:01:30 +01:00
|
|
|
those message --- smart refiling.
|
2012-09-28 16:12:09 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
To accomplish this, we can set the refiling folder (@code{mu4e-refile-folder})
|
|
|
|
to a function that returns the actual refiling folder for the particular
|
|
|
|
message. An example should clarify this:
|
2012-09-28 16:12:09 +02:00
|
|
|
|
2012-09-27 16:21:45 +02:00
|
|
|
@lisp
|
|
|
|
(setq mu4e-refile-folder
|
2016-01-12 20:38:07 +01:00
|
|
|
(lambda (msg)
|
|
|
|
(cond
|
|
|
|
;; messages to the mu mailing list go to the /mu folder
|
|
|
|
((mu4e-message-contact-field-matches msg :to
|
|
|
|
"mu-discuss@@googlegroups.com")
|
|
|
|
"/mu")
|
|
|
|
;; messages sent directly to me go to /archive
|
|
|
|
;; also `mu4e-user-mail-address-p' can be used
|
|
|
|
((mu4e-message-contact-field-matches msg :to "me@@example.com")
|
|
|
|
"/private")
|
|
|
|
;; messages with football or soccer in the subject go to /football
|
|
|
|
((string-match "football\\|soccer"
|
|
|
|
(mu4e-message-field msg :subject))
|
|
|
|
"/football")
|
|
|
|
;; messages sent by me go to the sent folder
|
|
|
|
((find-if
|
|
|
|
(lambda (addr)
|
|
|
|
(mu4e-message-contact-field-matches msg :from addr))
|
2020-04-09 21:07:58 +02:00
|
|
|
(mu4e-personal-addresses))
|
2016-01-12 20:38:07 +01:00
|
|
|
mu4e-sent-folder)
|
|
|
|
;; everything else goes to /archive
|
|
|
|
;; important to have a catch-all at the end!
|
|
|
|
(t "/archive"))))
|
2012-09-27 16:21:45 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
This can be very powerful; you can select some messages in the headers view,
|
|
|
|
then press @key{r}, and have them all marked for refiling to their particular
|
|
|
|
folders.
|
2012-10-01 15:42:37 +02:00
|
|
|
|
2012-09-28 16:12:09 +02:00
|
|
|
Some notes:
|
2012-09-27 16:21:45 +02:00
|
|
|
@itemize
|
2012-10-14 16:00:25 +02:00
|
|
|
@item We set @code{mu4e-refile-folder} to an anonymous (@t{lambda}) function. This
|
|
|
|
function takes one argument, a message plist@footnote{a property list
|
|
|
|
describing a message}. The plist corresponds to the message at point. See
|
|
|
|
@ref{Message functions} for a discussion on how to deal with them.
|
|
|
|
@item In our function, we use a @t{cond} control structure; the function
|
|
|
|
returns the first of the clauses that matches. It's important to make the last
|
|
|
|
clause a catch-all, so we always return @emph{some} folder.
|
|
|
|
@item We use
|
2016-01-03 12:29:19 +01:00
|
|
|
the convenience function @code{mu4e-message-contact-field-matches},
|
|
|
|
which evaluates to @code{t} if any of the names or e-mail addresses in a
|
|
|
|
contact field (in this case, the @t{To:}-field) matches the regular
|
|
|
|
expression. With @t{mu4e} version 0.9.16 or newer, the contact field can
|
2016-12-31 17:01:30 +01:00
|
|
|
in fact be a list instead of a single value, such as @code{'(:to :cc)'}.
|
2012-09-27 16:21:45 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-28 16:12:09 +02:00
|
|
|
@node Other dynamic folders
|
|
|
|
@section Other dynamic folders
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Using the same mechanism, you can create dynamic sent-, trash-, and
|
|
|
|
drafts-folders. The message-parameter you receive for the sent and drafts
|
|
|
|
folder is the @emph{original} message, that is, the message you reply to, or
|
|
|
|
forward, or edit. If there is no such message (for example when composing a
|
2012-10-07 15:54:24 +02:00
|
|
|
brand new message) the message parameter is @t{nil}.
|
2012-09-30 19:12:07 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Let's look at an example. Suppose you want a different trash folder for
|
|
|
|
work-email. You can achieve this with something like:
|
2012-09-30 19:12:07 +02:00
|
|
|
|
|
|
|
@lisp
|
2016-01-10 10:56:58 +01:00
|
|
|
(setq mu4e-trash-folder
|
|
|
|
(lambda (msg)
|
|
|
|
;; the 'and msg' is to handle the case where msg is nil
|
|
|
|
(if (and msg
|
|
|
|
(mu4e-message-contact-field-matches msg :to "me@@work.example.com"))
|
|
|
|
"/trash-work"
|
|
|
|
"/trash")))
|
2012-09-30 19:12:07 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
2012-10-01 15:42:37 +02:00
|
|
|
Good to remember:
|
|
|
|
@itemize
|
2012-10-11 16:50:32 +02:00
|
|
|
@item The @var{msg} parameter you receive in the function refers to the
|
2012-10-01 15:42:37 +02:00
|
|
|
@emph{original message}, that is, the message being replied to or
|
|
|
|
forwarded. When re-editing a message, it refers to the message being
|
2012-10-11 16:50:32 +02:00
|
|
|
edited. When you compose a totally new message, the @var{msg} parameter is
|
2012-10-01 15:42:37 +02:00
|
|
|
@code{nil}.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item When re-editing messages, the value of @code{mu4e-drafts-folder} is ignored.
|
2012-10-01 15:42:37 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-09-27 16:21:45 +02:00
|
|
|
|
2012-04-21 11:48:00 +02:00
|
|
|
@node Actions
|
|
|
|
@chapter Actions
|
|
|
|
|
2020-02-17 11:46:31 +01:00
|
|
|
@t{mu4e} lets you define custom actions for messages in @ref{Headers view}
|
|
|
|
and for both messages and attachments in @ref{Message view}. Custom
|
2016-12-31 17:01:30 +01:00
|
|
|
actions allow you to easily extend @t{mu4e} for specific needs --- for example,
|
2012-04-21 11:48:00 +02:00
|
|
|
marking messages as spam in a spam filter or applying an attachment with a
|
|
|
|
source code patch.
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
You can invoke the actions with key @key{a} for actions on messages, and key
|
|
|
|
@key{A} for actions on attachments.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
For general information extending @t{mu4e} and writing your own functions, see
|
|
|
|
@ref{Extending mu4e}.
|
2012-10-07 15:54:24 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Defining actions::How to create an action
|
|
|
|
* Headers view actions::Doing things with message headers
|
|
|
|
* Message view actions::Doing things with messages
|
|
|
|
* Attachment actions::Doing things with attachments
|
|
|
|
* Example actions::Some more examples
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
2012-06-11 15:40:23 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Defining actions
|
|
|
|
@section Defining actions
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Defining a new custom action comes down to writing an elisp-function to do the
|
|
|
|
work. Functions that operate on messages receive a @var{msg} parameter, which
|
|
|
|
corresponds to the message at point. Something like:
|
2012-04-21 11:48:00 +02:00
|
|
|
@lisp
|
2020-02-12 16:32:12 +01:00
|
|
|
(defun my-action-func (msg)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Describe my message function."
|
|
|
|
;; do stuff
|
|
|
|
)
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
2017-06-24 12:39:12 +02:00
|
|
|
Functions that operate on attachments receive a @var{msg} parameter, which
|
2012-10-14 16:00:25 +02:00
|
|
|
corresponds to the message at point, and an @var{attachment-num}, which is the
|
|
|
|
number of the attachment as seen in the message view. An attachment function
|
|
|
|
looks like:
|
2012-04-21 11:48:00 +02:00
|
|
|
@lisp
|
2020-02-12 16:32:12 +01:00
|
|
|
(defun my-attachment-action-func (msg attachment-num)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Describe my attachment function."
|
|
|
|
;; do stuff
|
|
|
|
)
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
After you have defined your function, you can add it to the list of
|
|
|
|
actions@footnote{Instead of defining the functions separately, you can
|
|
|
|
obviously also add a @code{lambda}-function directly to the list; however,
|
|
|
|
separate functions are easier to change}, either @code{mu4e-headers-actions},
|
|
|
|
@code{mu4e-view-actions} or @code{mu4e-view-attachment-actions}. The
|
|
|
|
format@footnote{Note, the format of the actions has changed since version
|
|
|
|
0.9.8.4, and you must change your configuration to use the new format;
|
|
|
|
@t{mu4e} warns you when you are using the old format.} of each action is a
|
|
|
|
cons-cell, @code{(DESCRIPTION . VALUE)}; see below for some examples. If your
|
|
|
|
shortcut is not also the first character of the description, simply prefix the
|
|
|
|
description with that character.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Let's look at some examples.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Headers view actions
|
|
|
|
@section Headers view actions
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Suppose we want to inspect the number of recipients for a message in the
|
|
|
|
@ref{Headers view}. We add the following to our configuration:
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun show-number-of-recipients (msg)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Display the number of recipients for the message at point."
|
|
|
|
(message "Number of recipients: %d"
|
|
|
|
(+ (length (mu4e-message-field msg :to))
|
|
|
|
(length (mu4e-message-field msg :cc)))))
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-06-11 15:40:23 +02:00
|
|
|
;; define 'N' (the first letter of the description) as the shortcut
|
2012-10-14 16:00:25 +02:00
|
|
|
;; the 't' argument to add-to-list puts it at the end of the list
|
2012-04-21 11:48:00 +02:00
|
|
|
(add-to-list 'mu4e-headers-actions
|
2016-01-12 20:38:07 +01:00
|
|
|
'("Number of recipients" . show-number-of-recipients) t)
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
After evaluating this, @kbd{a N} in the headers view shows the number of
|
2012-06-20 19:42:39 +02:00
|
|
|
recipients for the message at point.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Message view actions
|
|
|
|
@section Message view actions
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
As another example, suppose we would like to search for messages by the sender
|
2012-10-14 16:00:25 +02:00
|
|
|
of the message at point:
|
2012-06-11 15:40:23 +02:00
|
|
|
|
2012-04-21 11:48:00 +02:00
|
|
|
@lisp
|
|
|
|
(defun search-for-sender (msg)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Search for messages sent by the sender of the message at point."
|
|
|
|
(mu4e-headers-search
|
|
|
|
(concat "from:" (cdar (mu4e-message-field msg :from)))))
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-06-11 15:40:23 +02:00
|
|
|
;; define 'x' as the shortcut
|
2012-04-21 11:48:00 +02:00
|
|
|
(add-to-list 'mu4e-view-actions
|
2016-01-12 20:38:07 +01:00
|
|
|
'("xsearch for sender" . search-for-sender) t)
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@indent
|
|
|
|
If you wonder why we use @code{cdar}, remember that the @t{From:}-field is a
|
|
|
|
list of @code{(NAME . EMAIL)} cells; thus, @code{cdar} gets us the e-mail
|
|
|
|
address of the first in the list. @t{From:}-fields rarely contain multiple
|
|
|
|
cells.
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Attachment actions
|
|
|
|
@section Attachment actions
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Finally, let's define an attachment action. As mentioned, attachment-action
|
|
|
|
functions receive @emph{2} arguments, the message and the attachment number to
|
|
|
|
use.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
The following example action counts the number of lines in an attachment, and
|
|
|
|
defines @key{n} as its shortcut key (the @key{n} is prefixed to the
|
|
|
|
description).
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun count-lines-in-attachment (msg attachnum)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Count the number of lines in an attachment."
|
|
|
|
(mu4e-view-pipe-attachment msg attachnum "wc -l"))
|
2012-10-14 16:00:25 +02:00
|
|
|
|
|
|
|
;; defining 'n' as the shortcut
|
2012-04-21 11:48:00 +02:00
|
|
|
(add-to-list 'mu4e-view-attachment-actions
|
2016-01-12 20:38:07 +01:00
|
|
|
'("ncount lines" . count-lines-in-attachment) t)
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Example actions
|
|
|
|
@section Example actions
|
2012-05-13 14:02:40 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu4e} includes a number of example actions in the file
|
|
|
|
@file{mu4e-actions.el} in the source distribution (see @kbd{C-h f
|
|
|
|
mu4e-action-TAB}). For example, for viewing messages in an external web
|
|
|
|
browser, or listening to a message's body-text using text-to-speech.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
|
|
|
@node Extending mu4e
|
|
|
|
@chapter Extending mu4e
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@t{mu4e} is designed to be easily extendible --- that is, write your own
|
2012-10-11 16:50:32 +02:00
|
|
|
emacs-lisp to make @t{mu4e} behave exactly as you want. Here, we provide some
|
|
|
|
guidelines for doing so.
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@menu
|
2016-12-31 17:01:30 +01:00
|
|
|
* Extension points::Where to hook into @t{mu4e}
|
2016-01-10 10:56:58 +01:00
|
|
|
* Available functions::General helper functions
|
|
|
|
* Message functions::Working with messages
|
|
|
|
* Contact functions::Working with contacts
|
|
|
|
* Utility functions::Miscellaneous helpers
|
2012-10-11 16:50:32 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Extension points
|
|
|
|
@section Extension points
|
|
|
|
|
|
|
|
There are a number of places where @t{mu4e} lets you plug in your own
|
|
|
|
functions:
|
|
|
|
@itemize
|
2014-09-02 05:13:00 +02:00
|
|
|
@item Custom functions for message headers in the message-view and
|
2016-12-31 17:01:30 +01:00
|
|
|
headers-view --- see @ref{HV Custom headers}, @ref{MSGV Custom headers}
|
2012-10-11 16:50:32 +02:00
|
|
|
@item Using message-specific folders for drafts, trash, sent messages and
|
2016-12-31 17:01:30 +01:00
|
|
|
refiling, based on a function --- see @ref{Dynamic folders}
|
|
|
|
@item Using an attachment-specific download-directory --- see the
|
2012-10-14 16:00:25 +02:00
|
|
|
variable @code{mu4e-attachment-dir}.
|
|
|
|
@item Apply a function to a message in the headers view -
|
2016-01-10 10:56:58 +01:00
|
|
|
see @ref{Headers view actions}
|
2016-12-31 17:01:30 +01:00
|
|
|
@item Apply a function to a message in the message view --- see @ref{Message view actions}
|
2014-11-30 23:11:57 +01:00
|
|
|
@item Add a new kind of mark for use in the headers view
|
|
|
|
- see @ref{Adding a new kind of mark}
|
2016-12-31 17:01:30 +01:00
|
|
|
@item Apply a function to an attachment --- see @ref{Attachment actions}
|
|
|
|
@item Custom function to mark certain messages --- see @ref{Custom mark functions}
|
2012-10-14 16:00:25 +02:00
|
|
|
@item Using various @emph{mode}-hooks, @code{mu4e-compose-pre-hook} (see
|
|
|
|
@ref{Compose hooks}), @code{mu4e-index-updated-hook} (see @ref{FAQ})
|
2012-10-11 16:50:32 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
2014-11-22 16:27:15 +01:00
|
|
|
You can also write your own functions without using the above. If you
|
|
|
|
want to do so, key useful functions are @code{mu4e-message-at-point}
|
2015-03-21 14:22:12 +01:00
|
|
|
(see below), @code{mu4e-headers-for-each} (to iterate over all
|
|
|
|
headers, see its docstring) and @code{mu4e-view-for-each-part} (to
|
|
|
|
iterate over all parts/attachments, see its docstring). There is also
|
|
|
|
@code{mu4e-view-for-each-uri} to iterate of all the URIs in the
|
|
|
|
current message.
|
|
|
|
|
|
|
|
Another useful function is
|
2014-11-27 00:08:54 +01:00
|
|
|
@code{mu4e-headers-find-if} which searches for a message matching a
|
2014-11-22 16:27:15 +01:00
|
|
|
certain pattern; again, see its docstring.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2015-03-21 15:11:11 +01:00
|
|
|
@node Available functions
|
2015-03-21 17:28:20 +01:00
|
|
|
@section Available functions
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
The whole of @t{mu4e} consists of hundreds of elisp functions. However, the
|
|
|
|
majority of those are for @emph{internal} use only; you can recognize them
|
2016-12-31 17:01:30 +01:00
|
|
|
easily, because they all start with @code{mu4e~}. These functions make all
|
2012-10-14 16:00:25 +02:00
|
|
|
kinds of assumptions, and they are subject to change, and should therefore
|
|
|
|
@emph{not} be used. The same is true for @emph{variables} that start with
|
|
|
|
@code{mu4e~}; don't touch them. Let me repeat that:
|
2012-10-11 16:50:32 +02:00
|
|
|
@verbatim
|
2016-01-10 10:56:58 +01:00
|
|
|
Do not use mu4e~... functions or variables!
|
2012-10-11 16:50:32 +02:00
|
|
|
@end verbatim
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
2014-09-02 14:15:25 +02:00
|
|
|
In addition, you should use functions in the right context; functions
|
|
|
|
that start with @t{mu4e-view-} are only applicable to the message view,
|
|
|
|
while functions starting with @t{mu4e-headers-} are only applicable to
|
|
|
|
the headers view. Functions without such prefixes are applicable
|
|
|
|
everywhere.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
|
|
|
@node Message functions
|
|
|
|
@section Message functions
|
|
|
|
|
2016-11-26 11:34:46 +01:00
|
|
|
Many functions in @t{mu4e} deal with message plists (property
|
2014-09-02 14:15:25 +02:00
|
|
|
lists). They contain information about messages, such as sender and
|
|
|
|
recipient, subject, date and so on. To deal with these plists, there are
|
|
|
|
a number of @code{mu4e-message-} functions (in @file{mu4e-message.el}),
|
|
|
|
such as @code{mu4e-message-field} and @code{mu4e-message-at-point}, and
|
|
|
|
a shortcut to combine the two, @code{mu4e-message-field-at-point}.
|
2012-10-11 16:50:32 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
For example, to get the subject of the message at point, in either the headers
|
|
|
|
view or the message view, you could write:
|
2012-10-11 16:50:32 +02:00
|
|
|
@lisp
|
|
|
|
(mu4e-message-field (mu4e-message-at-point) :subject)
|
|
|
|
@end lisp
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
Note that:
|
2012-10-11 16:50:32 +02:00
|
|
|
@itemize
|
|
|
|
@item The contact fields (To, From, Cc, Bcc) are lists of cons-pairs
|
|
|
|
@code{(name . email)}; @code{name} may be @code{nil}. So, for example:
|
|
|
|
@lisp
|
2016-01-12 20:38:07 +01:00
|
|
|
(mu4e-message-field some-msg :to)
|
|
|
|
;; => (("Jack" . "jack@@example.com") (nil . "foo@@example.com"))
|
2012-10-11 16:50:32 +02:00
|
|
|
@end lisp
|
2017-01-29 12:21:53 +01:00
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
If you are only looking for a match in this list (e.g., ``Is Jack one of the
|
|
|
|
recipients of the message?''), there is a convenience function
|
|
|
|
@code{mu4e-message-contact-field-matches} to make this easy.
|
|
|
|
@item The message body is only available in the message view, not in the
|
|
|
|
headers view.
|
|
|
|
@end itemize
|
|
|
|
|
2016-11-26 11:34:46 +01:00
|
|
|
Note that in headers-mode, you only have access to a reduced message
|
|
|
|
plist, without the information about the message-body or mime-parts;
|
2016-11-26 15:56:12 +01:00
|
|
|
@t{mu4e} does this for performance reasons. And even in view-mode, you
|
2016-11-26 11:34:46 +01:00
|
|
|
do not have access to arbitrary message-headers.
|
|
|
|
|
|
|
|
However, it is possible to get the information indirectly, using the
|
|
|
|
raw-message and some third-party tool like @t{procmail}'s @t{formail}:
|
2014-09-02 14:15:25 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my-mu4e-any-message-field-at-point (hdr)
|
2016-01-12 20:38:07 +01:00
|
|
|
"Quick & dirty way to get an arbitrary header HDR at
|
2014-09-02 14:15:25 +02:00
|
|
|
point. Requires the 'formail' tool from procmail."
|
2016-01-12 20:38:07 +01:00
|
|
|
(replace-regexp-in-string "\n$" ""
|
|
|
|
(shell-command-to-string
|
|
|
|
(concat "formail -x " hdr " -c < "
|
|
|
|
(shell-quote-argument (mu4e-message-field-at-point :path))))))
|
2014-09-02 14:15:25 +02:00
|
|
|
@end lisp
|
|
|
|
|
2017-01-29 12:21:53 +01:00
|
|
|
@subsection Rewriting the message body
|
|
|
|
|
|
|
|
Message body rewriting allows you to modify the message text that is
|
|
|
|
presented in the message view. This can be useful if the message needs
|
|
|
|
special processing, for instance for special filling or cleaning up
|
|
|
|
encoding artifacts (this is what @t{mu4e} uses this for internally).
|
|
|
|
|
|
|
|
To enable this, you can append your rewrite-function to
|
|
|
|
@code{mu4e-message-body-rewrite-functions}; your function is expected to
|
|
|
|
take two parameters @code{MSG} and @code{TXT}, which are the
|
|
|
|
message-plist and the body-text, which could be the result of earlier
|
|
|
|
transformations, including html->text conversion as per
|
|
|
|
@code{mu4e-html2-text-command}. The function is expected to return the
|
|
|
|
transformed text.
|
|
|
|
|
|
|
|
As a fairly useless example, suppose we insist on reading @t{mu4e} as
|
|
|
|
@t{MU4E}:
|
|
|
|
@lisp
|
|
|
|
(defun mu4e-to-MU4E-rewrite (msg txt)
|
|
|
|
(replace-regexp-in-string "mu4e" "MU4E" txt))
|
|
|
|
|
|
|
|
(add-to-list 'mu4e-message-body-rewrite-functions 'mu4e-to-MU4E-rewrite t)
|
|
|
|
@end lisp
|
|
|
|
|
2014-09-02 14:15:25 +02:00
|
|
|
|
2015-03-15 12:45:28 +01:00
|
|
|
@node Contact functions
|
|
|
|
@section Contact functions
|
|
|
|
|
2019-05-11 12:27:39 +02:00
|
|
|
It can sometimes be useful to discard or rewrite the contact
|
|
|
|
information that @t{mu4e} provides, for example to fix spelling
|
|
|
|
errors, or omit unwanted contacts.
|
2015-03-15 12:45:28 +01:00
|
|
|
|
2019-05-11 12:27:39 +02:00
|
|
|
To handle this, @t{mu4e} provides
|
|
|
|
@code{mu4e-contact-process-function}, which, if defined, is applied to
|
|
|
|
each contact. If the result is @t{nil}, the contact is discarded,
|
|
|
|
otherwise the (modified or not) contact information is used.
|
2015-12-26 12:26:26 +01:00
|
|
|
|
2019-05-11 12:27:39 +02:00
|
|
|
Each contact is a full e-mail address as you would see in a
|
|
|
|
contact-field of an e-mail message, e.g.,
|
|
|
|
@verbatim
|
|
|
|
"Foo Bar" <foo.bar@example.com>
|
|
|
|
@end verbatim
|
|
|
|
or
|
|
|
|
@verbatim
|
|
|
|
cuux@example.com
|
|
|
|
@end verbatim
|
2016-01-09 19:02:49 +01:00
|
|
|
|
2019-05-11 12:27:39 +02:00
|
|
|
An example @code{mu4e-contact-process-function} might look like:
|
2015-03-15 12:45:28 +01:00
|
|
|
|
|
|
|
@lisp
|
2019-05-11 12:27:39 +02:00
|
|
|
(defun my-contact-processor (contact)
|
|
|
|
(cond
|
|
|
|
;; remove unwanted
|
|
|
|
((string-match-p "evilspammer@@example.com" contact) nil)
|
|
|
|
((string-match-p "noreply" contact) nil)
|
|
|
|
;;
|
|
|
|
;; jonh smiht --> John Smith
|
|
|
|
((string-match "jonh smiht" contact)
|
|
|
|
(replace-regexp-in-string "jonh smiht" "John Smith" contact))
|
|
|
|
(t contact)))
|
|
|
|
|
|
|
|
(setq mu4e-contact-process-function 'my-contact-processor)
|
2015-03-15 12:45:28 +01:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@node Utility functions
|
|
|
|
@section Utility functions
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@file{mu4e-utils} contains a number of utility functions; we list a few here.
|
|
|
|
See their docstrings for details:
|
2012-10-11 16:50:32 +02:00
|
|
|
@itemize
|
|
|
|
@item @code{mu4e-read-option}: read one option from a list. For example:
|
|
|
|
@lisp
|
2016-01-10 10:56:58 +01:00
|
|
|
(mu4e-read-option "Choose an animal: "
|
|
|
|
'(("Monkey" . monkey) ("Gnu" . gnu) ("xMoose" . moose)))
|
2012-10-11 16:50:32 +02:00
|
|
|
@end lisp
|
2012-10-14 16:00:25 +02:00
|
|
|
The user is presented with:
|
2012-10-11 16:50:32 +02:00
|
|
|
@example
|
2016-01-10 10:56:58 +01:00
|
|
|
Choose an animal: [M]onkey, [G]nu, [x]Moose
|
2012-10-11 16:50:32 +02:00
|
|
|
@end example
|
|
|
|
@item @code{mu4e-ask-maildir}: ask for a maildir; try one of the
|
2012-10-14 16:00:25 +02:00
|
|
|
shortcuts (@code{mu4e-maildir-shortcuts}), or the full set of available
|
2012-10-11 16:50:32 +02:00
|
|
|
maildirs.
|
|
|
|
@item @code{mu4e-running-p}: return @code{t} if the @t{mu4e} process is
|
|
|
|
running, @code{nil} otherwise.
|
2012-10-19 15:01:55 +02:00
|
|
|
@item @code{(mu4e-user-mail-address-p addr)}: return @code{t} if @var{addr} is
|
2020-04-09 21:07:58 +02:00
|
|
|
one of the user's e-mail addresses (as per @code{(mu4e-personal-addresses)}).
|
2012-10-17 17:35:23 +02:00
|
|
|
@item @code{mu4e-log} logs to the @t{mu4e} debugging log if it is enabled;
|
2016-01-10 10:56:58 +01:00
|
|
|
see @code{mu4e-toggle-logging}.
|
2012-10-11 16:50:32 +02:00
|
|
|
@item @code{mu4e-message}, @code{mu4e-warning}, @code{mu4e-error} are the
|
2013-06-16 22:04:54 +02:00
|
|
|
@t{mu4e} equivalents of the normal elisp @code{message},
|
2020-02-24 20:58:45 +01:00
|
|
|
@code{user-error}@footnote{@code{user-error} only appears in Emacs
|
2012-10-14 16:00:25 +02:00
|
|
|
24.2 and later; in older versions it falls back to @code{error}} and
|
|
|
|
@code{error} functions.
|
2012-10-11 16:50:32 +02:00
|
|
|
@end itemize
|
|
|
|
|
2012-10-17 17:35:23 +02:00
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
@node Other tools
|
|
|
|
@appendix Other tools
|
2012-01-19 20:40:26 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
In this chapter, we discuss some ways in which @t{mu4e} can cooperate
|
2012-02-28 21:34:22 +01:00
|
|
|
with other tools.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Emacs default::Making mu4e the default emacs e-mail program
|
|
|
|
* Org-mode links::Adding mu4e to your organized life
|
|
|
|
* Org-contacts::Hooking up with org-contacts
|
|
|
|
* BBDB::Hooking up with the Insidious Big Brother Database
|
|
|
|
* Sauron::Getting new mail notifications with Sauron
|
|
|
|
* Speedbar::A special frame with your folders
|
|
|
|
* Dired:: Attaching files using @t{dired}
|
2018-11-04 11:49:35 +01:00
|
|
|
* Hydra:: Custom shortcut menus
|
2012-01-06 13:04:08 +01:00
|
|
|
@end menu
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Emacs default
|
|
|
|
@section Emacs default
|
2012-04-19 07:31:48 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs allows you to select an e-mail program as the default
|
2015-12-22 17:02:50 +01:00
|
|
|
program it uses when you press @key{C-x m} (@code{compose-mail}), call
|
|
|
|
@code{report-emacs-bug} and so on. If you want to use @t{mu4e} for this,
|
|
|
|
you can do so by adding the following to your configuration:
|
2012-04-19 07:31:48 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
@end lisp
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Org-mode links
|
|
|
|
@section Org-mode links
|
|
|
|
|
2015-12-22 17:02:50 +01:00
|
|
|
It can be useful to include links to e-mail messages or even search
|
2019-12-01 13:24:03 +01:00
|
|
|
queries in your org-mode files. @t{mu4e} supports this by default,
|
|
|
|
unless you set @t{mu4e-support-org} to @code{nil}.
|
2016-11-26 11:34:46 +01:00
|
|
|
|
2019-12-01 13:24:03 +01:00
|
|
|
You can use the normal @t{org-mode} mechanisms to store links:
|
|
|
|
@kbd{M-x org-store-link} stores a link to a particular message when
|
|
|
|
you are in @ref{Message view}. When you are in @ref{Headers view},
|
2014-12-11 07:57:54 +01:00
|
|
|
@kbd{M-x org-store-link} links to the @emph{query} if
|
2019-12-01 13:24:03 +01:00
|
|
|
@code{mu4e-org-link-query-in-headers-mode} is non-@code{nil}, and to
|
|
|
|
the particular message otherwise (which is the default).
|
2012-04-24 17:47:32 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
You can insert this link later with @kbd{M-x org-insert-link}. From
|
|
|
|
@t{org-mode}, you can go to the query or message the link points to with
|
|
|
|
either @kbd{M-x org-agenda-open-link} in agenda buffers, or @kbd{M-x
|
2016-12-31 17:01:30 +01:00
|
|
|
org-open-at-point} elsewhere --- both typically bound to @kbd{C-c C-o}.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2019-12-01 13:24:03 +01:00
|
|
|
You can also directly @emph{capture} such links --- for example, to
|
|
|
|
add e-mail messages to your todo-list. For that, @t{org-mu4e} has a
|
|
|
|
function @code{mu4e-org-store-and-capture}. This captures the
|
|
|
|
message-at-point (or header --- see the discussion on
|
|
|
|
@code{mu4e-org-link-query-in-headers-mode} above), then calls
|
|
|
|
@t{org-mode}'s capture functionality.
|
2012-05-25 15:51:23 +02:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
You can add some specific capture-template for this: for example, to add
|
2015-12-22 17:02:50 +01:00
|
|
|
a message to your todo-list, and set a deadline for processing it within
|
|
|
|
two days, you could add this to @code{org-capture-templates}:
|
2015-11-12 11:42:51 +01:00
|
|
|
|
2015-12-22 17:02:50 +01:00
|
|
|
@lisp
|
2016-01-12 20:38:07 +01:00
|
|
|
("P" "process-soon" entry (file+headline "todo.org" "Todo")
|
|
|
|
"* TODO %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))")
|
2015-12-22 17:02:50 +01:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
If you use the functionality a lot, you may want to define key-bindings
|
|
|
|
for that in headers and view mode:
|
2015-12-23 21:01:51 +01:00
|
|
|
|
2015-12-22 17:02:50 +01:00
|
|
|
@lisp
|
2016-01-12 20:38:07 +01:00
|
|
|
(define-key mu4e-headers-mode-map (kbd "C-c c") 'org-mu4e-store-and-capture)
|
|
|
|
(define-key mu4e-view-mode-map (kbd "C-c c") 'org-mu4e-store-and-capture)
|
2015-12-22 17:02:50 +01:00
|
|
|
@end lisp
|
2013-07-03 22:09:27 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Org-contacts
|
|
|
|
@section Org-contacts
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2012-06-20 10:29:57 +02:00
|
|
|
Note, @t{mu4e} supports built-in address autocompletion; @ref{Address
|
2016-01-10 10:56:58 +01:00
|
|
|
autocompletion}, and that is the recommended way to do this. However, it
|
|
|
|
is also possible to manage your addresses with @t{org-mode}, using
|
2017-03-06 10:55:35 +01:00
|
|
|
@t{org-contacts}@footnote{@url{https://julien.danjou.info/projects/emacs-packages#org-contacts}}.
|
2012-02-05 09:56:37 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu4e-actions} defines a useful action (@ref{Actions}) for adding a contact
|
|
|
|
based on the @t{From:}-address in the message at point. To enable this, add to
|
|
|
|
your configuration something like:
|
2012-02-28 21:34:22 +01:00
|
|
|
|
2012-04-24 17:47:32 +02:00
|
|
|
@lisp
|
2016-01-12 20:38:07 +01:00
|
|
|
(setq mu4e-org-contacts-file <full-path-to-your-org-contacts-file>)
|
|
|
|
(add-to-list 'mu4e-headers-actions
|
|
|
|
'("org-contact-add" . mu4e-action-add-org-contact) t)
|
|
|
|
(add-to-list 'mu4e-view-actions
|
|
|
|
'("org-contact-add" . mu4e-action-add-org-contact) t)
|
2012-04-28 08:12:54 +02:00
|
|
|
@end lisp
|
2012-02-28 21:34:22 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
2012-04-24 17:47:32 +02:00
|
|
|
After this, you should be able to add contacts using @key{a o} in the headers
|
2012-06-19 07:07:30 +02:00
|
|
|
view and the message view, using the @t{org-capture} mechanism. Note, the
|
2012-10-14 16:00:25 +02:00
|
|
|
shortcut character @key{o} is due to the first character of
|
|
|
|
@t{org-contact-add}.
|
2012-04-28 08:12:54 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node BBDB
|
|
|
|
@section BBDB
|
2015-06-23 12:08:07 +02:00
|
|
|
|
|
|
|
Note, @t{mu4e} supports built-in address autocompletion; @ref{Address
|
|
|
|
autocompletion}, and that is the recommended way to do this. However, it
|
|
|
|
is also possible to manage your addresses with the current (2015-06-23)
|
|
|
|
development release of @t{BBDB}, or releases of @t{BBDB} after
|
2018-03-24 12:20:00 +01:00
|
|
|
3.1.2.@footnote{@url{https://savannah.nongnu.org/projects/bbdb/}}.
|
2015-06-23 12:08:07 +02:00
|
|
|
|
2015-08-12 18:06:18 +02:00
|
|
|
To enable BBDB, add to your @file{~/.emacs} (or its moral equivalent,
|
|
|
|
such as @file{~/.emacs.d/init.el}) the following @emph{after} the
|
|
|
|
@code{(require 'mu4e)} line:
|
2015-06-23 12:08:07 +02:00
|
|
|
|
|
|
|
@lisp
|
2016-01-12 20:38:07 +01:00
|
|
|
;; Load BBDB (Method 1)
|
|
|
|
(require 'bbdb-loaddefs)
|
|
|
|
;; OR (Method 2)
|
|
|
|
;; (require 'bbdb-loaddefs "/path/to/bbdb/lisp/bbdb-loaddefs.el")
|
|
|
|
;; OR (Method 3)
|
|
|
|
;; (autoload 'bbdb-insinuate-mu4e "bbdb-mu4e")
|
|
|
|
;; (bbdb-initialize 'message 'mu4e)
|
2016-08-09 08:26:56 +02:00
|
|
|
|
2016-09-30 08:16:07 +02:00
|
|
|
(setq bbdb-mail-user-agent 'mu4e-user-agent)
|
2018-06-29 17:08:43 +02:00
|
|
|
(setq mu4e-view-mode-hook 'bbdb-mua-auto-update)
|
2016-01-12 20:38:07 +01:00
|
|
|
(setq mu4e-compose-complete-addresses nil)
|
|
|
|
(setq bbdb-mua-pop-up t)
|
|
|
|
(setq bbdb-mua-pop-up-window-size 5)
|
2019-05-11 12:27:39 +02:00
|
|
|
(setq mu4e-view-show-addresses t)
|
2015-06-23 12:08:07 +02:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@noindent
|
|
|
|
After this, you should be able to:
|
|
|
|
@itemize
|
|
|
|
@item In mu4e-view mode, add the sender of the email to BBDB with @key{C-u :}
|
|
|
|
@item Tab-complete addresses from BBDB when composing emails
|
|
|
|
@item View the BBDB contact while viewing a message
|
|
|
|
@end itemize
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Sauron
|
|
|
|
@section Sauron
|
2012-02-28 21:34:22 +01:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
The Emacs package @t{sauron}@footnote{Sauron can be found at
|
2016-12-31 17:01:30 +01:00
|
|
|
@url{https://github.com/djcb/sauron}, or in the Marmalade package repository
|
2018-03-24 12:20:00 +01:00
|
|
|
at @url{https://marmalade-repo.org/}} (by the same author) can be used
|
2013-06-10 10:12:58 +02:00
|
|
|
to get notifications about new mails. If you run something like the below
|
|
|
|
script from your @t{crontab} (or have some other way of having it execute
|
|
|
|
every @emph{n} minutes), you receive notifications in the @t{sauron}-buffer
|
|
|
|
when new messages arrive.
|
2012-02-28 21:34:22 +01:00
|
|
|
|
|
|
|
@verbatim
|
|
|
|
#!/bin/sh
|
|
|
|
|
2015-01-01 14:45:11 +01:00
|
|
|
# the mu binary
|
|
|
|
MU=mu
|
|
|
|
|
2013-06-10 10:12:58 +02:00
|
|
|
# put the path to your Inbox folder here
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
CHECKDIR="/home/$LOGNAME/Maildir/Inbox"
|
2013-06-10 10:12:58 +02:00
|
|
|
|
2014-10-30 07:16:13 +01:00
|
|
|
sauron_msg () {
|
2016-01-10 10:56:58 +01:00
|
|
|
DBUS_COOKIE="/home/$LOGNAME/.sauron-dbus"
|
|
|
|
if test "x$DBUS_SESSION_BUS_ADDRESS" = "x"; then
|
|
|
|
if test -e $DBUS_COOKIE; then
|
|
|
|
export DBUS_SESSION_BUS_ADDRESS="`cat $DBUS_COOKIE`"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -n "x$DBUS_SESSION_BUS_ADDRESS"; then
|
|
|
|
dbus-send --session \
|
|
|
|
--dest="org.gnu.Emacs" \
|
|
|
|
--type=method_call \
|
|
|
|
"/org/gnu/Emacs/Sauron" \
|
|
|
|
"org.gnu.Emacs.Sauron.AddMsgEvent" \
|
|
|
|
string:shell uint32:3 string:"$1"
|
|
|
|
fi
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
}
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
#
|
|
|
|
# -mmin -5: consider only messages that were created / changed in the
|
|
|
|
# the last 5 minutes
|
|
|
|
#
|
|
|
|
for f in `find $CHECKDIR -mmin -5 -a -type f`; do
|
2016-01-10 10:56:58 +01:00
|
|
|
subject=`$MU view $f | grep '^Subject:' | sed 's/^Subject://'`
|
|
|
|
sauron_msg "mail: $subject"
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
done
|
2012-02-28 21:34:22 +01:00
|
|
|
@end verbatim
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
You might want to put:
|
2012-02-28 21:34:22 +01:00
|
|
|
@lisp
|
|
|
|
(setq sauron-dbus-cookie t)
|
|
|
|
@end lisp
|
2012-10-14 16:00:25 +02:00
|
|
|
@noindent
|
|
|
|
in your setup, to allow the script to find the D-Bus session bus, even when
|
|
|
|
running outside its session.
|
2012-02-28 21:34:22 +01:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Speedbar
|
|
|
|
@section Speedbar
|
2012-03-19 20:45:26 +01:00
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
@code{speedbar} is an Emacs-extension that shows navigational
|
|
|
|
information for an Emacs buffer in a separate frame. Using
|
|
|
|
@code{mu4e-speedbar}, @t{mu4e} lists your bookmarks and maildir
|
|
|
|
folders and allows for one-click access to them.
|
2012-03-19 20:45:26 +01:00
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
To enable this, add @t{(require 'mu4e-speedbar)} to your
|
|
|
|
configuration; then, all you need to do to activate it is @kbd{M-x
|
|
|
|
speedbar}. Then, when then switching to the @ref{Main view}, the
|
|
|
|
speedbar-frame is updated with your bookmarks and maildirs.
|
2012-03-19 20:45:26 +01:00
|
|
|
|
2020-03-05 21:25:28 +01:00
|
|
|
For speed reasons, the list of maildirs is determined when @t{mu4e}
|
|
|
|
starts; if the list of maildirs changes while @t{mu4e} is running, you
|
|
|
|
need to restart @t{mu4e} to have those changes reflected in the
|
|
|
|
speedbar and in other places that use this list, such as
|
|
|
|
auto-completion when jumping to a maildir.
|
2012-03-19 20:45:26 +01:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Dired
|
|
|
|
@section Dired
|
2012-06-04 10:32:33 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
It is possible to attach files to @t{mu4e} messages using @t{dired}
|
2012-09-30 19:12:07 +02:00
|
|
|
(@inforef{Dired,,emacs}), using the following steps (based on a post on the
|
2012-10-14 16:00:25 +02:00
|
|
|
@t{mu-discuss} mailing list by @emph{Stephen Eglen}).
|
2012-06-04 10:32:33 +02:00
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
To prepare for this, you need a special version of the
|
|
|
|
@code{gnus-dired-mail-buffers} function so it understands @t{mu4e} buffers as
|
|
|
|
well; so put in your configuration:
|
2012-06-04 10:32:33 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(require 'gnus-dired)
|
2012-10-17 17:35:23 +02:00
|
|
|
;; make the `gnus-dired-mail-buffers' function also work on
|
2012-10-14 16:00:25 +02:00
|
|
|
;; message-mode derived modes, such as mu4e-compose-mode
|
2012-06-04 10:32:33 +02:00
|
|
|
(defun gnus-dired-mail-buffers ()
|
|
|
|
"Return a list of active message buffers."
|
|
|
|
(let (buffers)
|
|
|
|
(save-current-buffer
|
|
|
|
(dolist (buffer (buffer-list t))
|
|
|
|
(set-buffer buffer)
|
|
|
|
(when (and (derived-mode-p 'message-mode)
|
|
|
|
(null message-sent-message-via))
|
|
|
|
(push (buffer-name buffer) buffers))))
|
|
|
|
(nreverse buffers)))
|
|
|
|
|
|
|
|
(setq gnus-dired-mail-mode 'mu4e-user-agent)
|
|
|
|
(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
|
|
|
|
@end lisp
|
2012-06-10 10:19:51 +02:00
|
|
|
|
2012-06-04 10:32:33 +02:00
|
|
|
Then, mark the file(s) in @t{dired} you would like to attach and press @t{C-c
|
|
|
|
RET C-a}, and you'll be asked whether to attach them to an existing message,
|
|
|
|
or create a new one.
|
|
|
|
|
2018-11-04 11:49:35 +01:00
|
|
|
@node Hydra
|
|
|
|
@section Hydra
|
|
|
|
|
|
|
|
People sometimes ask about having multi-character shortcuts for
|
|
|
|
bookmarks; and easy way to achieve this, is by using anm emacs package
|
|
|
|
called Hydra@footnote{@url{https://github.com/abo-abo/hydra}}.
|
|
|
|
|
|
|
|
With Hydra installed, we can add multi-character shortcuts, for instance:
|
|
|
|
@lisp
|
|
|
|
(defhydra my-mu4e-bookmarks-work (:color blue)
|
|
|
|
"work bookmarks"
|
|
|
|
("b" (mu4e-headers-search "banana AND maildir:/work") "banana")
|
|
|
|
("u" (mu4e-headers-search "flag:unread AND maildir:/work") "unread"))
|
|
|
|
|
|
|
|
(defhydra my-mu4e-bookmarks-personal (:color blue)
|
|
|
|
"personal bookmarks"
|
|
|
|
("c" (mu4e-headers-search "capybara AND maildir:/personal") "capybara")
|
|
|
|
("u" (mu4e-headers-search "flag:unread AND maildir:/personal") "unread"))
|
|
|
|
|
|
|
|
(defhydra my-mu4e-bookmarks (:color blue)
|
|
|
|
"mu4e bookmarks"
|
|
|
|
("p" (my-mu4e-bookmarks-personal/body) "Personal")
|
|
|
|
("w" (my-mu4e-bookmarks-work/body) "Work"))
|
|
|
|
|
|
|
|
Now, you can bind a convenient key to my-mu4e-bookmarks/body.
|
|
|
|
@end lisp
|
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
@node Example configs
|
|
|
|
@appendix Example configs
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
In this chapter, we show some example configurations. While it is very useful
|
|
|
|
to see some working settings, we'd like to warn against blindly copying such
|
|
|
|
things.
|
2012-01-07 13:28:00 +01:00
|
|
|
|
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Minimal configuration::Simplest configuration to get you going
|
|
|
|
* Longer configuration::A more extensive setup
|
|
|
|
* Gmail configuration::GMail-specific setup
|
|
|
|
* Other settings:CONF Other settings. Some other useful configuration
|
2012-09-29 11:13:02 +02:00
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Minimal configuration
|
|
|
|
@section Minimal configuration
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
An (almost) minimal configuration for @t{mu4e} might look like this --- as you
|
|
|
|
see, most of it is commented-out.
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2012-02-05 09:56:37 +01:00
|
|
|
@lisp
|
2012-10-14 16:00:25 +02:00
|
|
|
;; example configuration for mu4e
|
2012-09-29 11:13:02 +02:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
;; make sure mu4e is in your load-path
|
2012-01-07 13:28:00 +01:00
|
|
|
(require 'mu4e)
|
|
|
|
|
2017-04-08 14:21:06 +02:00
|
|
|
;; use mu4e for e-mail in emacs
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
;; these must start with a "/", and must exist
|
|
|
|
;; (i.e.. /home/user/Maildir/sent must exist)
|
|
|
|
;; you use e.g. 'mu mkdir' to make the Maildirs if they don't
|
|
|
|
;; already exist
|
|
|
|
|
2012-09-30 19:12:07 +02:00
|
|
|
;; below are the defaults; if they do not exist yet, mu4e offers to
|
2012-10-03 20:54:34 +02:00
|
|
|
;; create them. they can also functions; see their docstrings.
|
2012-01-07 13:28:00 +01:00
|
|
|
;; (setq mu4e-sent-folder "/sent")
|
|
|
|
;; (setq mu4e-drafts-folder "/drafts")
|
|
|
|
;; (setq mu4e-trash-folder "/trash")
|
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
;; smtp mail setting; these are the same that `gnus' uses.
|
2012-09-29 11:13:02 +02:00
|
|
|
(setq
|
2012-10-03 20:54:34 +02:00
|
|
|
message-send-mail-function 'smtpmail-send-it
|
2012-09-29 11:13:02 +02:00
|
|
|
smtpmail-default-smtp-server "smtp.example.com"
|
2012-10-03 20:54:34 +02:00
|
|
|
smtpmail-smtp-server "smtp.example.com"
|
|
|
|
smtpmail-local-domain "example.com")
|
2012-02-05 09:56:37 +01:00
|
|
|
@end lisp
|
2012-01-07 13:28:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
@node Longer configuration
|
|
|
|
@section Longer configuration
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
A somewhat longer configuration, showing some more things that you can
|
|
|
|
customize.
|
|
|
|
|
2012-04-06 10:00:39 +02:00
|
|
|
@lisp
|
2012-10-14 16:00:25 +02:00
|
|
|
;; example configuration for mu4e
|
2011-12-14 08:11:40 +01:00
|
|
|
(require 'mu4e)
|
|
|
|
|
2017-04-08 14:21:06 +02:00
|
|
|
;; use mu4e for e-mail in emacs
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
2020-02-06 19:28:24 +01:00
|
|
|
;; the next are relative to the root maildir
|
|
|
|
;; (see `mu info`).
|
2012-10-03 20:54:34 +02:00
|
|
|
;; instead of strings, they can be functions too, see
|
|
|
|
;; their docstring or the chapter 'Dynamic folders'
|
|
|
|
(setq mu4e-sent-folder "/sent"
|
|
|
|
mu4e-drafts-folder "/drafts"
|
|
|
|
mu4e-trash-folder "/trash")
|
|
|
|
|
|
|
|
;; the maildirs you use frequently; access them with 'j' ('jump')
|
|
|
|
(setq mu4e-maildir-shortcuts
|
2020-02-25 20:22:24 +01:00
|
|
|
'((:maildir "/archive" :key ?a)
|
|
|
|
(:maildir "/inbox" :key ?i)
|
|
|
|
(:maildir "/work" :key ?w)
|
|
|
|
(:maildir "/sent" :key ?s)))
|
2012-10-03 20:54:34 +02:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
;; the headers to show in the headers list -- a pair of a field
|
2012-10-03 20:54:34 +02:00
|
|
|
;; and its width, with `nil' meaning 'unlimited'
|
|
|
|
;; (better only use that for the last field.
|
|
|
|
;; These are the defaults:
|
|
|
|
(setq mu4e-headers-fields
|
2015-03-22 10:49:57 +01:00
|
|
|
'( (:date . 25) ;; alternatively, use :human-date
|
2011-12-29 00:26:43 +01:00
|
|
|
(:flags . 6)
|
|
|
|
(:from . 22)
|
2015-03-22 10:49:57 +01:00
|
|
|
(:subject . nil))) ;; alternatively, use :thread-subject
|
2011-12-29 00:26:43 +01:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
;; program to get mail; alternatives are 'fetchmail', 'getmail'
|
|
|
|
;; isync or your own shellscript. called when 'U' is pressed in
|
2012-10-17 17:35:23 +02:00
|
|
|
;; main view.
|
2012-10-14 16:00:25 +02:00
|
|
|
|
|
|
|
;; If you get your mail without an explicit command,
|
|
|
|
;; use "true" for the command (this is the default)
|
2012-10-03 20:54:34 +02:00
|
|
|
(setq mu4e-get-mail-command "offlineimap")
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
;; general emacs mail settings; used when composing e-mail
|
|
|
|
;; the non-mu4e-* stuff is inherited from emacs/message-mode
|
2019-03-12 18:48:46 +01:00
|
|
|
(setq mu4e-compose-reply-to-address "foo@@bar.example.com"
|
2015-12-15 11:57:25 +01:00
|
|
|
user-mail-address "foo@@bar.example.com"
|
2012-10-03 20:54:34 +02:00
|
|
|
user-full-name "Foo X. Bar")
|
2013-10-20 14:41:47 +02:00
|
|
|
(setq mu4e-compose-signature
|
2012-10-03 20:54:34 +02:00
|
|
|
"Foo X. Bar\nhttp://www.example.com\n")
|
2011-12-14 08:11:40 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
;; smtp mail setting
|
2012-10-03 20:54:34 +02:00
|
|
|
(setq
|
2011-12-29 00:26:43 +01:00
|
|
|
message-send-mail-function 'smtpmail-send-it
|
|
|
|
smtpmail-default-smtp-server "smtp.example.com"
|
2014-10-18 18:53:53 +02:00
|
|
|
smtpmail-smtp-server "smtp.example.com"
|
2011-12-29 00:26:43 +01:00
|
|
|
smtpmail-local-domain "example.com"
|
|
|
|
|
|
|
|
;; if you need offline mode, set these -- and create the queue dir
|
|
|
|
;; with 'mu mkdir', i.e.. mu mkdir /home/user/Maildir/queue
|
|
|
|
smtpmail-queue-mail nil
|
2012-05-02 16:28:43 +02:00
|
|
|
smtpmail-queue-dir "/home/user/Maildir/queue/cur")
|
2012-06-14 10:13:00 +02:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
;; don't keep message buffers around
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
2012-04-06 10:00:39 +02:00
|
|
|
@end lisp
|
2012-01-06 13:04:08 +01:00
|
|
|
|
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
@node Gmail configuration
|
|
|
|
@section Gmail configuration
|
|
|
|
|
|
|
|
@emph{Gmail} is a popular e-mail provider; let's see how we can make it work
|
2012-10-03 20:54:34 +02:00
|
|
|
with @t{mu4e}. Since we are using @abbr{IMAP}, you must enable that in the
|
|
|
|
Gmail web interface (in the settings, under the ``Forwarding and
|
|
|
|
POP/IMAP''-tab).
|
|
|
|
|
2019-03-12 19:01:26 +01:00
|
|
|
Gmail users may also be interested in @ref{Including related messages},
|
|
|
|
and in @ref{Skipping duplicates}.
|
2012-12-27 15:27:53 +01:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
@subsection Setting up offlineimap
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2012-04-30 07:16:44 +02:00
|
|
|
First of all, we need a program to get the e-mail from Gmail to our local
|
2012-01-07 13:28:00 +01:00
|
|
|
machine; for this we use @t{offlineimap}; on Debian (and derivatives like
|
|
|
|
Ubuntu), this is as easy as:
|
2012-10-03 20:54:34 +02:00
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
@verbatim
|
2012-10-03 20:54:34 +02:00
|
|
|
$ sudo apt-get install offlineimap
|
2012-01-07 13:28:00 +01:00
|
|
|
@end verbatim
|
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
while on Fedora (and similar) you need:
|
|
|
|
@verbatim
|
|
|
|
$ sudo yum install offlineimap
|
|
|
|
@end verbatim
|
|
|
|
|
|
|
|
Then, we can configure @t{offlineimap} by editing @file{~/.offlineimaprc}:
|
2012-01-07 13:28:00 +01:00
|
|
|
|
|
|
|
@verbatim
|
|
|
|
[general]
|
|
|
|
accounts = Gmail
|
|
|
|
maxsyncaccounts = 3
|
|
|
|
|
|
|
|
[Account Gmail]
|
|
|
|
localrepository = Local
|
|
|
|
remoterepository = Remote
|
|
|
|
|
|
|
|
[Repository Local]
|
|
|
|
type = Maildir
|
|
|
|
localfolders = ~/Maildir
|
|
|
|
|
|
|
|
[Repository Remote]
|
|
|
|
type = IMAP
|
|
|
|
remotehost = imap.gmail.com
|
|
|
|
remoteuser = USERNAME@gmail.com
|
|
|
|
remotepass = PASSWORD
|
|
|
|
ssl = yes
|
|
|
|
maxconnections = 1
|
|
|
|
@end verbatim
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Obviously, you need to replace @t{USERNAME} and @t{PASSWORD} with your actual
|
|
|
|
Gmail username and password. After this, you should be able to download your
|
|
|
|
mail:
|
2012-10-03 20:54:34 +02:00
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
@verbatim
|
|
|
|
$ offlineimap
|
|
|
|
OfflineIMAP 6.3.4
|
|
|
|
Copyright 2002-2011 John Goerzen & contributors.
|
|
|
|
Licensed under the GNU GPL v2+ (v2 or any later version).
|
|
|
|
|
|
|
|
Account sync Gmail:
|
|
|
|
***** Processing account Gmail
|
|
|
|
Copying folder structure from IMAP to Maildir
|
|
|
|
Establishing connection to imap.gmail.com:993.
|
|
|
|
Folder sync [Gmail]:
|
|
|
|
Syncing INBOX: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/All Mail: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/Drafts: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/Sent Mail: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/Spam: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/Starred: IMAP -> Maildir
|
|
|
|
Syncing [Gmail]/Trash: IMAP -> Maildir
|
|
|
|
Account sync Gmail:
|
|
|
|
***** Finished processing account Gmail
|
|
|
|
@end verbatim
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
We can now run @command{mu} to make sure things work:
|
2012-01-07 13:28:00 +01:00
|
|
|
|
|
|
|
@verbatim
|
|
|
|
$ mu index
|
2020-04-19 13:02:48 +02:00
|
|
|
mu: indexing messages under /home/foo/Maildir [/home/foo/.cache/mu/xapian]
|
2012-01-07 13:28:00 +01:00
|
|
|
| processing mail; processed: 520; updated/new: 520, cleaned-up: 0
|
|
|
|
mu: elapsed: 3 second(s), ~ 173 msg/s
|
2020-04-19 13:02:48 +02:00
|
|
|
mu: cleaning up messages [/home/foo/.cache/mu/xapian]
|
2012-01-07 13:28:00 +01:00
|
|
|
/ processing mail; processed: 520; updated/new: 0, cleaned-up: 0
|
|
|
|
mu: elapsed: 0 second(s)
|
|
|
|
@end verbatim
|
|
|
|
|
2014-10-19 11:04:11 +02:00
|
|
|
We can run both the @t{offlineimap} and the @t{mu index} from within
|
|
|
|
@t{mu4e}, but running it from the command line makes it a bit easier to
|
|
|
|
troubleshoot as we are setting things up.
|
|
|
|
|
2015-03-21 17:28:20 +01:00
|
|
|
Note: when using encryption, you probably do @emph{not} want to
|
2014-10-19 11:04:11 +02:00
|
|
|
synchronize your Drafts-folder, since it contains the unencrypted
|
|
|
|
messages. You can use OfflineIMAP's @t{folderfilter} for that.
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2012-10-03 20:54:34 +02:00
|
|
|
@subsection Settings
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
Next step: let's make a @t{mu4e} configuration for this:
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2012-04-06 10:00:39 +02:00
|
|
|
@lisp
|
2012-01-07 13:28:00 +01:00
|
|
|
(require 'mu4e)
|
|
|
|
|
2017-04-08 14:21:06 +02:00
|
|
|
;; use mu4e for e-mail in emacs
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
(setq mu4e-drafts-folder "/[Gmail].Drafts")
|
|
|
|
(setq mu4e-sent-folder "/[Gmail].Sent Mail")
|
|
|
|
(setq mu4e-trash-folder "/[Gmail].Trash")
|
|
|
|
|
2012-09-29 11:13:02 +02:00
|
|
|
;; don't save message to Sent Messages, Gmail/IMAP takes care of this
|
* make it configurable what to do with sent messages (part 2), and document it:
By default, @t{mu4e} puts a copy of any messages you sent in the folder you
set for @code{mu4e-sent-folder}. In some case, this may not be what you want -
for example, when using GMail+@abbr{IMAP} (but @emph{not} with
GMail+@abbr{POP3}), this interferes with GMail's handling of the sent messages
folder, and you may end up with duplicate messages. For this, since @t{mu4e}
0.9.8.3, there is the variable @code{mu4e-sent-messages-behavior}, which takes
a symbol. The default is @code{'sent} which, as stated causes the message to
be copied to your sent-messages folder. Other possible values are
@code{'trash} (so the sent message is copied to the trash-folder
(@code{mu4e-trash-folder}), and @code{'delete} to simply discard the message
altogether.
2012-03-13 19:13:30 +01:00
|
|
|
(setq mu4e-sent-messages-behavior 'delete)
|
|
|
|
|
2014-09-23 01:40:35 +02:00
|
|
|
;; (See the documentation for `mu4e-sent-messages-behavior' if you have
|
|
|
|
;; additional non-Gmail addresses and want assign them different
|
|
|
|
;; behavior.)
|
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
;; setup some handy shortcuts
|
2012-09-29 11:13:02 +02:00
|
|
|
;; you can quickly switch to your Inbox -- press ``ji''
|
|
|
|
;; then, when you want archive some messages, move them to
|
|
|
|
;; the 'All Mail' folder by pressing ``ma''.
|
|
|
|
|
2012-01-07 13:28:00 +01:00
|
|
|
(setq mu4e-maildir-shortcuts
|
2020-02-25 20:22:24 +01:00
|
|
|
'( (:maildir "/INBOX" :key ?i)
|
|
|
|
(:maildir "/[Gmail].Sent Mail" :key ?s)
|
|
|
|
(:maildir "/[Gmail].Trash" :key ?t)
|
|
|
|
(:maildir "/[Gmail].All Mail" :key ?a)))
|
2012-01-07 13:28:00 +01:00
|
|
|
|
|
|
|
;; allow for updating mail using 'U' in the main view:
|
|
|
|
(setq mu4e-get-mail-command "offlineimap")
|
|
|
|
|
|
|
|
;; something about ourselves
|
|
|
|
(setq
|
2012-04-06 10:00:39 +02:00
|
|
|
user-mail-address "USERNAME@@gmail.com"
|
2012-01-07 13:28:00 +01:00
|
|
|
user-full-name "Foo X. Bar"
|
2013-10-20 14:41:47 +02:00
|
|
|
mu4e-compose-signature
|
2012-01-07 13:28:00 +01:00
|
|
|
(concat
|
|
|
|
"Foo X. Bar\n"
|
|
|
|
"http://www.example.com\n"))
|
|
|
|
|
|
|
|
;; sending mail -- replace USERNAME with your gmail username
|
|
|
|
;; also, make sure the gnutls command line utils are installed
|
|
|
|
;; package 'gnutls-bin' in Debian/Ubuntu
|
|
|
|
|
|
|
|
(require 'smtpmail)
|
|
|
|
(setq message-send-mail-function 'smtpmail-send-it
|
2012-07-19 10:42:38 +02:00
|
|
|
starttls-use-gnutls t
|
2012-07-02 08:51:13 +02:00
|
|
|
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
|
2012-09-29 11:13:02 +02:00
|
|
|
smtpmail-auth-credentials
|
|
|
|
'(("smtp.gmail.com" 587 "USERNAME@@gmail.com" nil))
|
2012-07-02 08:51:13 +02:00
|
|
|
smtpmail-default-smtp-server "smtp.gmail.com"
|
|
|
|
smtpmail-smtp-server "smtp.gmail.com"
|
|
|
|
smtpmail-smtp-service 587)
|
|
|
|
|
|
|
|
;; alternatively, for emacs-24 you can use:
|
|
|
|
;;(setq message-send-mail-function 'smtpmail-send-it
|
|
|
|
;; smtpmail-stream-type 'starttls
|
2012-07-19 10:42:38 +02:00
|
|
|
;; smtpmail-default-smtp-server "smtp.gmail.com"
|
2012-07-02 08:51:13 +02:00
|
|
|
;; smtpmail-smtp-server "smtp.gmail.com"
|
|
|
|
;; smtpmail-smtp-service 587)
|
2012-06-14 10:13:00 +02:00
|
|
|
|
|
|
|
;; don't keep message buffers around
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
2012-04-06 10:00:39 +02:00
|
|
|
@end lisp
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
And that's it --- put the above in your @file{~/.emacs}, change @t{USERNAME}
|
2020-02-24 20:58:45 +01:00
|
|
|
etc. to your own, and restart Emacs, and run @kbd{M-x mu4e}.
|
2012-09-29 11:13:02 +02:00
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node CONF Other settings
|
|
|
|
@section Other settings
|
2012-09-29 11:13:02 +02:00
|
|
|
|
|
|
|
Finally, here are some more settings that are useful, but not enabled by
|
|
|
|
default for various reasons.
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
;; use 'fancy' non-ascii characters in various places in mu4e
|
|
|
|
(setq mu4e-use-fancy-chars t)
|
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
;; save attachment to my desktop (this can also be a function)
|
2012-09-29 11:13:02 +02:00
|
|
|
(setq mu4e-attachment-dir "~/Desktop")
|
|
|
|
|
|
|
|
;; attempt to show images when viewing messages
|
2013-07-06 10:51:33 +02:00
|
|
|
(setq mu4e-view-show-images t)
|
2012-09-29 11:13:02 +02:00
|
|
|
@end lisp
|
2012-01-07 13:28:00 +01:00
|
|
|
|
2012-10-14 16:00:25 +02:00
|
|
|
@node FAQ
|
2016-12-31 17:01:30 +01:00
|
|
|
@appendix FAQ --- Frequently Asked Questions
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2012-04-02 19:00:42 +02:00
|
|
|
In this chapter we list a number of actual and anticipated questions and their
|
|
|
|
answers.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@menu
|
2016-12-31 17:01:30 +01:00
|
|
|
* General::General questions and answers about @t{mu4e}
|
2016-07-31 10:23:38 +02:00
|
|
|
* Retrieving mail::Getting mail and indexing
|
2016-01-10 10:56:58 +01:00
|
|
|
* Reading messages::Dealing with incoming messages
|
|
|
|
* Writing messages::Dealing with outgoing messages
|
|
|
|
* Known issues::Limitations we know about
|
2012-09-29 12:30:49 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node General
|
|
|
|
@section General
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection Results from @command{mu} and @t{mu4e} differ - why?
|
2020-03-16 22:02:59 +01:00
|
|
|
@anchor{mu-mu4e-differ}
|
2020-02-24 20:58:45 +01:00
|
|
|
In general, the same queries for @command{mu} and @t{mu4e} should
|
2020-03-14 13:27:51 +01:00
|
|
|
yield the same results. If they differ, this is usually because one of
|
|
|
|
the following reasons:
|
2020-02-24 20:58:45 +01:00
|
|
|
@itemize
|
2020-04-08 10:25:51 +02:00
|
|
|
@item different options:
|
|
|
|
@t{mu4e} defaults to having @t{mu4e-headers-include-related}, and
|
2020-02-24 20:58:45 +01:00
|
|
|
@t{mu4e-headers-results-limit} set to 500. However, the command-line
|
2020-03-14 13:27:51 +01:00
|
|
|
@command{mu find}'s corresponding @t{--include-related} is false, and
|
|
|
|
there's no limit (@t{--maxnum}).
|
2020-02-24 20:58:45 +01:00
|
|
|
@item reverse sorting:
|
2020-04-08 10:25:51 +02:00
|
|
|
The results may be different when @t{mu4e} and @command{mu find} do
|
|
|
|
not both sort their results in the same direction.
|
2020-02-24 20:58:45 +01:00
|
|
|
@item shell quoting issues:
|
|
|
|
Depending on the shell, various shell metacharacters in search query
|
|
|
|
(such as @t{*}) may be expanded by the shell before @command{mu} ever
|
|
|
|
sees them, and the query may not be what you think it is. Quoting is
|
|
|
|
necessary.
|
|
|
|
@end itemize
|
|
|
|
|
2020-03-14 13:27:51 +01:00
|
|
|
@subsection The unread/all counts in the main-screen differ from the 'real' numbers - what's going on?
|
|
|
|
For speed reasons, the counts do not exclude messages that no longer
|
2020-03-16 22:02:59 +01:00
|
|
|
exist in the file-system, nor does it exclude duplicate messages; @xref{mu-mu4e-differ}.
|
2020-03-14 13:27:51 +01:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I quickly delete/move/trash a lot of messages?
|
2020-03-14 13:27:51 +01:00
|
|
|
You can select ('mark' in Emacs-speak) the messages like you would
|
|
|
|
select text in a buffer; the actions you then take (e.g., @key{DEL}
|
|
|
|
for delete, @key{m} for move and @key{t} for trash) apply to all
|
|
|
|
selected messages. You can also use functions like
|
2020-02-24 20:58:45 +01:00
|
|
|
@code{mu4e-headers-mark-thread} (@key{T}),
|
|
|
|
@code{mu4e-headers-mark-subthread} (@key{t}) to mark whole threads at
|
|
|
|
the same time, and @code{mu4e-headers-mark-pattern} (@key{%}) to mark
|
|
|
|
all messages matching a certain regular expression.
|
|
|
|
|
|
|
|
@subsection Can I automatically apply the marks on messages when leaving the headers buffer?
|
|
|
|
Yes you can --- see the documentation for the variable
|
|
|
|
@t{mu4e-headers-leave-behavior}.
|
|
|
|
|
|
|
|
@subsection How can I set @t{mu4e} as the default e-mail client in Emacs?
|
2016-07-31 10:23:38 +02:00
|
|
|
See @ref{Emacs default}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection Can @t{mu4e} use some fancy Unicode instead of these boring plain-ASCII ones?
|
|
|
|
Glad you asked! Yes, if you set @code{mu4e-use-fancy-chars} to @t{t},
|
|
|
|
@t{mu4e} uses such fancy characters in a number of places. Since not
|
|
|
|
all fonts include all characters, you may want to install the
|
|
|
|
@t{unifont} and/or @t{symbola} fonts on your system.
|
|
|
|
|
|
|
|
@subsection Can I start @t{mu4e} in the background?
|
|
|
|
Yes --- if you provide a prefix-argument (@key{C-u}), @t{mu4e} starts,
|
|
|
|
but does not show the main-window.
|
|
|
|
|
|
|
|
@subsection Does @t{mu4e} support searching for CJK (Chinese-Japanese-Korean) characters?
|
2016-07-31 10:23:38 +02:00
|
|
|
Yes, if you have @t{Xapian} 1.2.8 or newer, and set the environment
|
|
|
|
variable @t{XAPIAN_CJK_NGRAM} to non-empty before indexing, both when
|
|
|
|
using @t{mu} from the command-line and from @t{mu4e}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can I customize the function to select a folder?
|
|
|
|
The @t{mu4e-completing-read-function} variable can be customized to
|
|
|
|
select a folder in any way. The variable can be set to a function that
|
|
|
|
receives five arguments, following @t{completing-read}. The default
|
|
|
|
value is @code{ido-completing-read}; to use emacs's default behavior,
|
|
|
|
set the variable to @code{completing-read}. Helm users can use the
|
|
|
|
same value, and by enabling @code{helm-mode} use helm-style
|
|
|
|
completion.
|
|
|
|
|
|
|
|
@subsection With a lot of Maildir folders, jumping to them can get slow. What can I do?
|
|
|
|
Set @code{mu4e-cache-maildir-list} to @code{t} (make sure to read
|
2016-07-31 10:23:38 +02:00
|
|
|
its docstring).
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can I hide messages from the search results?
|
2017-01-22 21:12:40 +01:00
|
|
|
See the variable @code{mu4e-headers-hide-predicate}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection I'm getting an error 'Variable binding depth exceeds max-specpdl-size' when using mu4e -- what can I do about it?
|
|
|
|
The error occurs because @t{mu4e} is binding more variables than
|
|
|
|
@t{emacs} allows for, by default. You can avoid this by setting a
|
|
|
|
higher value, e.g. by adding the following to your configuration:
|
2017-03-18 09:22:46 +01:00
|
|
|
@lisp
|
|
|
|
(setq max-specpdl-size 5000)
|
|
|
|
@end lisp
|
2016-07-31 10:23:38 +02:00
|
|
|
|
|
|
|
@node Retrieving mail
|
|
|
|
@section Retrieving mail
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I get notifications when receiving mail?
|
|
|
|
There is @code{mu4e-index-updated-hook}, which gets triggered when the
|
|
|
|
indexing process triggered sees an update (not just new mail though).
|
|
|
|
To use this hook, put something like the following in your setup
|
|
|
|
(assuming you have @t{aplay} and some soundfile, change as needed):
|
2012-09-11 10:58:00 +02:00
|
|
|
@lisp
|
2012-09-13 21:58:13 +02:00
|
|
|
(add-hook 'mu4e-index-updated-hook
|
2012-09-11 10:58:00 +02:00
|
|
|
(defun new-mail-sound ()
|
2012-09-13 21:58:13 +02:00
|
|
|
(shell-command "aplay ~/Sounds/boing.wav&")))
|
2012-09-11 10:58:00 +02:00
|
|
|
@end lisp
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection Getting mail through a local mailserver. What should I use for @code{mu4e-get-mail-command}?
|
|
|
|
Use the literal string @t{"true"} (or don't do anything, it's the
|
|
|
|
default) which then uses @t{/bin/true} (a command that does nothing
|
|
|
|
and always succeeds). This makes getting mail a no-op, but the
|
|
|
|
messages are still re-indexed.
|
|
|
|
|
|
|
|
@subsection How can I re-index my messages without getting new mail?
|
2012-10-25 11:28:11 +02:00
|
|
|
Use @kbd{M-x mu4e-update-index}
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection When I try to run @t{mu index} while @t{mu4e} is running I get errors
|
|
|
|
For instance:
|
2012-10-17 17:35:23 +02:00
|
|
|
@verbatim
|
|
|
|
mu: mu_store_new_writable: xapian error
|
2019-07-12 16:36:08 +02:00
|
|
|
'Unable to get write lock on ~/.cache/mu/xapian: already locked
|
2012-10-11 16:50:32 +02:00
|
|
|
@end verbatim
|
2020-02-24 20:58:45 +01:00
|
|
|
What to do about this? You get this error because the underlying
|
|
|
|
Xapian database is locked by some other process; it can be opened only
|
|
|
|
once in read-write mode. There is not much @t{mu4e} can do about this,
|
|
|
|
but if is another @command{mu} instance that is holding the lock, you
|
|
|
|
can ask it to (gracefully) terminate:
|
2012-03-24 10:19:41 +01:00
|
|
|
@verbatim
|
|
|
|
pkill -2 -u $UID mu # send SIGINT
|
|
|
|
sleep 1
|
|
|
|
mu index
|
|
|
|
@end verbatim
|
2012-09-30 19:12:07 +02:00
|
|
|
@t{mu4e} automatically restarts @t{mu} when it needs it. In practice, this
|
2012-03-24 10:19:41 +01:00
|
|
|
seems to work quite well.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can I disable the @t{Indexing...} messages?
|
|
|
|
Set the variable @code{mu4e-hide-index-messages} to non-@t{nil}.
|
|
|
|
|
|
|
|
@subsection IMAP-synchronization and file-name changes
|
|
|
|
Some IMAP-synchronization programs such as @t{mbsync} (but not
|
|
|
|
@t{offlineimap}) don't like it when message files do not change their
|
|
|
|
names when they are moved to different folders. @t{mu4e} can attempt
|
|
|
|
to help with this - you can set the variable
|
|
|
|
@code{mu4e-change-filenames-when-moving} to non-@t{nil}.
|
|
|
|
|
|
|
|
@subsection @command{offlineimap} and UTF-7
|
|
|
|
@command{offlineimap} uses IMAP's UTF-7 for encoding non-ascii folder
|
|
|
|
names, while @command{mu} expects UTF-8 (so, e.g. @t{/まりもえ
|
|
|
|
お}@footnote{some Japanese characters} becomes @t{/&MH4wijCCMEgwSg-}).
|
|
|
|
|
|
|
|
This is best solved by telling @command{offlineimap} to use UTF-8
|
|
|
|
instead --- see
|
2013-06-16 23:54:19 +02:00
|
|
|
@url{https://github.com/djcb/mu/issues/68#issuecomment-8598652}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection @command{mbsync} or @command{offlineimap} do not sync properly
|
|
|
|
Unfortunately, @command{mbsync} and/or @command{offlineimap} do not
|
|
|
|
always agree with @t{mu} about the meaning of various Maildir-flags.
|
|
|
|
If you encounter unexpected behavior, it is recommended you check
|
|
|
|
before and after a sync-operation. If the problem only shows up
|
|
|
|
@emph{after} sync'ing, the problem is with the sync-program, and it's
|
|
|
|
most productive to complain there. Otherwise, there have been quite a
|
|
|
|
few related queries on the mailing-list; worthwhile to check out.
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Reading messages
|
|
|
|
@section Reading messages
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2020-02-25 20:22:24 +01:00
|
|
|
@subsection Opening messages is slower than expected - why?
|
|
|
|
@t{mu4e} is designed to be very fast, even with large amounts of mail.
|
|
|
|
However, if you experience slowdowns, here are some things to consider:
|
|
|
|
@itemize
|
|
|
|
@item opening messages while indexing:
|
|
|
|
@t{mu4e} corresponds with the @t{mu} server synchronously; this means
|
2020-03-05 21:25:28 +01:00
|
|
|
that you can do only one thing at a time. The one operation that
|
|
|
|
potentially does take a bit of time is indexing of mail, during which
|
|
|
|
you have to wait for messages to open. For some strategies to reduce
|
|
|
|
that time, see the next question.
|
2020-02-25 20:22:24 +01:00
|
|
|
@item getting contact information can take some time:
|
|
|
|
especially when opening @t{mu4e} the first time and you have a
|
|
|
|
@emph{lot} of contacts, it can take a few seconds to process those.
|
|
|
|
Note that @t{mu4e} 1.3 and higher only get @emph{changed} contacts in
|
|
|
|
subsequent updates (after and indexing operation), so this should be
|
|
|
|
less of a concern.
|
|
|
|
@item decryption / sign verification:
|
|
|
|
encrypted / signed messages sometimes require network access, and this
|
|
|
|
may take a while; certainly if the needed servers cannot be found.
|
|
|
|
Part of this may be that influential environment variables are not set
|
|
|
|
in the emacs environment.
|
|
|
|
@end itemize
|
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
If you still experience unexpected slowness, you can of course file a
|
|
|
|
ticket, but please be sure to mention the following:
|
2020-02-25 20:22:24 +01:00
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item are all messages slow or only some messages?
|
|
|
|
@item if it's only some messages, is there something specific about them?
|
|
|
|
@item in addition, please a (sufficiently censored version of) a message that is slow
|
|
|
|
@item is opening @emph{always} slow or only sometimes? When?
|
|
|
|
@end itemize
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I view attached images in my message view buffers? See
|
2012-08-29 17:00:23 +02:00
|
|
|
@ref{Viewing images inline}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I word-wrap long lines in when viewing a message?
|
|
|
|
You can toggle between wrapped and non-wrapped states using
|
2014-12-29 21:54:26 +01:00
|
|
|
@key{w}. If you want to do this automatically, invoke @code{visual-line-mode} in
|
2012-10-14 16:00:25 +02:00
|
|
|
your @code{mu4e-view-mode-hook}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I perform custom actions on messages and attachments?
|
|
|
|
See @ref{Actions}.
|
|
|
|
@subsection Does @t{mu4e} support crypto (i.e., decrypting messages and verifying signatures)?
|
2020-03-01 16:34:16 +01:00
|
|
|
Yes --- it is possible to do both (note, only PGP/MIME is
|
2015-12-27 13:30:02 +01:00
|
|
|
supported). In the @ref{Main view} the support is indicated by a big
|
|
|
|
letter @t{C} on the right hand side of the @t{mu4e} version. See
|
|
|
|
@ref{Decryption} and @ref{Verifying signatures}. For encryption and
|
|
|
|
signing messages, see @ref{Writing messages}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I prevent @t{mu4e} from automatically marking messages as `read' when I read them?
|
2016-07-31 10:23:38 +02:00
|
|
|
Set @code{mu4e-view-auto-mark-as-read} to @code{nil}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection Does @t{mu4e} support including all related messages in a thread, like Gmail does?
|
|
|
|
Yes --- see @ref{Including related messages}.
|
|
|
|
@subsection There seems to be a lot of duplicate messages --- how can I get rid of them?
|
|
|
|
See @ref{Skipping duplicates}.
|
|
|
|
@subsection How can I use the @t{eww} browser to view rich-text messages?
|
|
|
|
With a new enough emacs, this happens automatically. See
|
|
|
|
@ref{Html2text functions} for some details.
|
|
|
|
@subsection Some messages are almost unreadable in emacs --- can I view them in an external web browser?
|
|
|
|
Indeed, airlines often send messages that heavily depend on html and
|
|
|
|
are hard to digest inside emacs. Fortunately, there's an @emph{action}
|
|
|
|
(@ref{Message view actions}) defined for this. Simply add to your
|
|
|
|
configuration:
|
2013-03-17 18:43:12 +01:00
|
|
|
@lisp
|
|
|
|
(add-to-list 'mu4e-view-actions
|
|
|
|
'("ViewInBrowser" . mu4e-action-view-in-browser) t)
|
|
|
|
@end lisp
|
|
|
|
Now, when viewing such a difficult message, type @kbd{aV}, and the message
|
|
|
|
opens inside a webbrowser. You can influence the browser with
|
2016-03-15 05:40:21 +01:00
|
|
|
@code{browse-url-generic-program}; and see @ref{Privacy aspects}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I read encrypted messages that I sent?
|
|
|
|
Since you do not own the recipient's key you typically cannot read
|
|
|
|
those mails --- so the trick is to encrypt outgoing mails with your
|
|
|
|
key, too. This can be automated by adding the following snippet to
|
|
|
|
your configuration (courtesy of user @t{kpachnis}):
|
2015-07-05 19:45:11 +02:00
|
|
|
@lisp
|
|
|
|
(require 'epg-config)
|
|
|
|
(setq mml2015-use 'epg
|
|
|
|
epg-user-id "gpg_key_id"
|
|
|
|
mml2015-encrypt-to-self t
|
|
|
|
mml2015-sign-with-sender t)
|
|
|
|
@end lisp
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection Can I `bounce' or `resend' messages?
|
2020-03-05 21:25:28 +01:00
|
|
|
Somewhat --- it is possible to edit a (copy of) an existing message and
|
2020-02-24 20:58:45 +01:00
|
|
|
then send it, using @code{M-x mu4e-compose-resend}. This gives you a
|
|
|
|
raw copy of the message, including all headers, encoded parts and so
|
|
|
|
on. Reason for this is that for resending, it is important not to
|
|
|
|
change anything (except perhaps for the @t{To:} address when
|
|
|
|
bouncing); since we cannot losslessly decode an existing message, you
|
|
|
|
get the raw version.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Writing messages
|
|
|
|
@section Writing messages
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection What's the deal with replies to messages I wrote myself?
|
|
|
|
Like many other mail-clients, @t{mu4e} treats replies to messages you
|
|
|
|
wrote yourself as special --- these messages keep the same @t{To:} and
|
|
|
|
@t{Cc:} as the original message. This is to ease the common case of
|
|
|
|
following up to a message you wrote earlier.
|
|
|
|
|
|
|
|
@subsection How can I automatically set the @t{From:}-address for a reply-message?
|
|
|
|
See @ref{Compose hooks}.
|
|
|
|
|
|
|
|
@subsection How can I dynamically determine the folders for draft/sent/trashed messages?
|
|
|
|
See @ref{Dynamic folders}.
|
|
|
|
|
|
|
|
@subsection How can I define aliases for (groups of) e-mail addresses?
|
|
|
|
See @ref{(emacs) Mail Aliases}.
|
|
|
|
|
|
|
|
@subsection How can I automatically add some header to an outgoing message?
|
|
|
|
See @ref{Compose hooks}.
|
|
|
|
|
|
|
|
@subsection How can I influence the way the original message looks when replying/forwarding?
|
|
|
|
Since @code{mu4e-compose-mode} derives from @code{message-mode}, you
|
|
|
|
can re-use many of its facilities. @inforef{Insertion
|
|
|
|
Variables,,message}.
|
|
|
|
|
|
|
|
@subsection How can I easily include attachments in the messages I write?
|
|
|
|
You can drag-and-drop from your desktop; alternatively, you can use
|
|
|
|
@t{dired} --- see @ref{Dired}.
|
|
|
|
|
2020-04-30 21:45:09 +02:00
|
|
|
@subsection @t{mu4e} seems to remove myself from the @t{Cc:}-list; how can I prevent that?
|
2020-02-24 20:58:45 +01:00
|
|
|
Set @code{mu4e-compose-keep-self-cc} to @t{t} in your configuration.
|
|
|
|
|
2020-04-30 21:45:09 +02:00
|
|
|
@subsection @t{mu4e} include myself from the @t{Cc:}-list; how can I prevent that?
|
|
|
|
You need list your personal addresses by passing one or more
|
|
|
|
@t{--my-address=...} to @t{mu init}. Note that the
|
|
|
|
@code{mu4e-user-mail-address-list} which was used in older @t{mu4e}
|
|
|
|
versions is no longer used. Also see the entries for version 1.4 in
|
|
|
|
@t{NEWS.org} (@kbd{N}) in the main-menu.
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I start a new message-thread from a reply?
|
|
|
|
Remove the @t{In-Reply-To} header, and @t{mu4e} automatically removes
|
|
|
|
the (hidden) @t{References} header as well when sending it. This makes
|
|
|
|
the message show up as a top-level message rather than as a response.
|
|
|
|
|
|
|
|
@subsection How can I attach an existing message?
|
|
|
|
Use @code{mu4e-action-capture-message} (i.e., @kbd{a c} in the headers
|
|
|
|
view) to `capture' the to-be-attached message, then when editing the
|
|
|
|
message, use @kbd{M-x mu4e-compose-attach-captured-message}.
|
|
|
|
|
|
|
|
@subsection How can I sign or encrypt messages?
|
|
|
|
You can do so using Emacs' MIME-support --- check the
|
|
|
|
@t{Attachments}-menu while composing a message. Also see @ref{Signing
|
|
|
|
and encrypting}.
|
|
|
|
|
2020-05-24 19:11:20 +02:00
|
|
|
You can do so using Emacs' MIME-support --- check the
|
|
|
|
@t{Attachments}-menu while composing a message. Also see @ref{Signing
|
|
|
|
and encrypting}.
|
|
|
|
|
|
|
|
@subsection Addres auto-completion does not work?
|
|
|
|
If you have set @code{mu4e-compose-complete-only-personal} to non-nil,
|
|
|
|
@t{mu4e} only completes 'personal' addresses - so you tell it about
|
|
|
|
your e-mail addresses when setting up the database (@t{mu init});
|
|
|
|
@ref{Initializing the message store}.
|
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection Can I use @t{BBDB} with @t{mu4e}?
|
2020-05-24 19:11:20 +02:00
|
|
|
Yes, with releases of BBDB after 3.1.2. @ref{BBDB}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can I get rid of the message buffer after sending?
|
2012-10-14 16:00:25 +02:00
|
|
|
@lisp
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
|
|
|
@end lisp
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection Sending big messages is slow and blocks emacs --- what can I do about it?
|
|
|
|
|
|
|
|
For this, there's @url{https://github.com/jwiegley/emacs-async} (also
|
|
|
|
available from the Emacs package repository); add the following
|
|
|
|
snippet to your configuration:
|
2013-03-17 18:43:12 +01:00
|
|
|
@lisp
|
|
|
|
(require 'smtpmail-async)
|
|
|
|
(setq
|
|
|
|
send-mail-function 'async-smtpmail-send-it
|
|
|
|
message-send-mail-function 'async-smtpmail-send-it)
|
|
|
|
@end lisp
|
2016-12-31 17:01:30 +01:00
|
|
|
With this, messages are sent using a background Emacs instance.
|
2013-11-19 06:44:18 +01:00
|
|
|
|
2016-07-31 10:23:38 +02:00
|
|
|
A word of warning though, this tends to not be as reliable as sending
|
2020-02-24 20:58:45 +01:00
|
|
|
the message in the normal, synchronous fashion, and people have
|
|
|
|
reported silent failures, where mail sending fails for some reason
|
|
|
|
without any indication of that.
|
2013-11-19 06:44:18 +01:00
|
|
|
|
|
|
|
You can check the progress of the background by checking the
|
|
|
|
@t{*Messages*}-buffer, which should show something like:
|
2013-07-06 17:57:32 +02:00
|
|
|
@verbatim
|
|
|
|
Delivering message to "William Shakespeare" <will@example.com>...
|
|
|
|
Mark set
|
2013-07-06 18:17:15 +02:00
|
|
|
Saving file /home/djcb/Maildir/sent/cur/20130706-044350-darklady:2,S...
|
2013-07-06 17:57:32 +02:00
|
|
|
Wrote /home/djcb/Maildir/sent/cur/20130706-044350-darklady:2,S
|
|
|
|
Sending...done
|
|
|
|
@end verbatim
|
|
|
|
The first and final messages are the most important, and there may be
|
|
|
|
considerable time between them, depending on the size of the message.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection Is it possible to compose messages in a separate frame?
|
2016-12-31 17:01:30 +01:00
|
|
|
Yes --- set the variable @code{mu4e-compose-in-new-frame} to @code{t}.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can I apply format=flowed to my outgoing messages?
|
|
|
|
This enables receiving clients that support this feature to reflow
|
|
|
|
paragraphs. Plain text emails with @t{Content-Type: text/plain;
|
|
|
|
format=flowed} can be reflowed (i.e. line endings removed, paragraphs
|
|
|
|
refilled) by receiving clients that support this standard. Clients
|
|
|
|
that don't support this, show them as is, which means this feature is
|
|
|
|
truly non-invasive.
|
|
|
|
|
|
|
|
Here's an explanatory blog post which also shows why this is a
|
|
|
|
desirable feature:
|
|
|
|
@url{https://mathiasbynens.be/notes/gmail-plain-text} (if you don't
|
|
|
|
have it, your mails mostly look quite bad especially on mobile
|
2015-02-01 08:25:00 +01:00
|
|
|
devices) and here's the RFC with all the details:
|
2018-03-24 12:20:00 +01:00
|
|
|
@url{https://www.ietf.org/rfc/rfc2646.txt}.
|
2015-02-01 08:25:00 +01:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
Since version 0.9.17, @t{mu4e} sensd emails with @t{format=flowed} by
|
2016-05-07 13:12:11 +02:00
|
|
|
setting
|
|
|
|
@lisp
|
|
|
|
(setq mu4e-compose-format-flowed t)
|
|
|
|
@end lisp
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
@noindent
|
2016-05-07 13:12:11 +02:00
|
|
|
in your Emacs init file (@file{~/.emacs} or @file{~/.emacs.d/init.el}).
|
|
|
|
The transformation of your message into the proper format is
|
2016-12-31 17:01:30 +01:00
|
|
|
done at the time of sending. For this to happen properly, you should
|
2016-05-07 02:47:13 +02:00
|
|
|
write each paragraph of your message of as a long line (i.e. without
|
|
|
|
carriage return). If you introduce unwanted newlines in your paragraph,
|
|
|
|
use @kbd{M-q} to reformat it as a single line.
|
|
|
|
|
2016-05-07 13:12:11 +02:00
|
|
|
If you want to send the message with paragraphs on single lines but
|
|
|
|
without @t{format=flowed} (because, say, the receiver does not
|
|
|
|
understand the latter as it is the case for Google or Github), use
|
|
|
|
@kbd{M-x use-hard-newlines} (to turn @code{use-hard-newlines} off) or
|
2016-05-07 02:47:13 +02:00
|
|
|
uncheck the box @t{format=flowed} in the @t{Text} menu when composing a
|
|
|
|
message.
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@subsection How can force images to be shown at the end of my messages, regardless of where I insert them?
|
2018-06-13 12:21:22 +02:00
|
|
|
User Marcin Borkowski has a solution:
|
|
|
|
@lisp
|
|
|
|
(defun mml-attach-file--go-to-eob (orig-fun &rest args)
|
|
|
|
"Go to the end of buffer before attaching files."
|
|
|
|
(save-excursion
|
|
|
|
(save-restriction
|
|
|
|
(widen)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(apply orig-fun args))))
|
|
|
|
|
|
|
|
(advice-add 'mml-attach-file :around #'mml-attach-file--go-to-eob)
|
|
|
|
@end lisp
|
2019-01-08 21:28:25 +01:00
|
|
|
|
2020-02-24 20:58:45 +01:00
|
|
|
@subsection How can I avoid Outlook display issues?
|
2019-01-08 21:28:25 +01:00
|
|
|
|
|
|
|
Limited testing shows that certain Outlook clients do not work well
|
|
|
|
with inline replies, and the entire message including-and-below the
|
|
|
|
first quoted section is collapsed. This means recipients may not even
|
|
|
|
notice important inline text, especially if there is some top-posted
|
|
|
|
content. This has been observed on OS X, Windows, and Web-based
|
|
|
|
Outlook clients accessing Office 365.
|
|
|
|
|
|
|
|
It appears the bug is triggered by the standard reply regex "On ...
|
|
|
|
wrote:". Changing "On", or removing the trailing ":" appears to fix
|
|
|
|
the bug (in limited testing). Therefore, a simple work-around is to
|
|
|
|
set `message-citation-line-format` to something slightly non-standard,
|
|
|
|
such as:
|
|
|
|
@lisp
|
|
|
|
(setq message-citation-line-format "On %Y-%m-%d at %R %Z, %f wrote...")
|
|
|
|
@end lisp
|
2012-08-29 17:00:23 +02:00
|
|
|
|
2012-09-29 12:30:49 +02:00
|
|
|
@node Known issues
|
|
|
|
@section Known issues
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2015-12-25 08:41:35 +01:00
|
|
|
Although they are not really @emph{questions}, we end this chapter with
|
|
|
|
a list of known issues and/or missing features in @t{mu4e}. Thus, users
|
|
|
|
won't have to search in vain for things that are not there (yet), and
|
|
|
|
the author can use it as a todo-list.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2020-03-01 16:34:16 +01:00
|
|
|
@subsection UTF-8 language environment is required
|
|
|
|
@t{mu4e} does not work well if the Emacs language environment is not
|
|
|
|
UTF-8; so, if you encounter problems with encodings, be sure to have
|
|
|
|
@code{(set-language-environment "UTF-8")} in your @file{~/.emacs} (or
|
|
|
|
its moral equivalents in other places).
|
|
|
|
|
|
|
|
@subsection Thread handling is incomplete
|
|
|
|
While threads are calculated and are visible in the headers buffer,
|
|
|
|
you cannot collapse/open them.
|
|
|
|
|
|
|
|
@subsection Key-bindings are @emph{somewhat} hard-coded.
|
|
|
|
That is, the main menu assumes the default key-bindings, as do the
|
|
|
|
clicks-on-bookmarks.
|
2012-01-06 13:04:08 +01:00
|
|
|
|
2013-06-12 09:09:19 +02:00
|
|
|
For a more complete list, please refer to the issues-list in the
|
|
|
|
github-repository.
|
|
|
|
|
2013-02-11 22:38:14 +01:00
|
|
|
@node Tips and Tricks
|
|
|
|
@appendix Tips and Tricks
|
|
|
|
|
|
|
|
@menu
|
2016-01-10 10:56:58 +01:00
|
|
|
* Fancy characters:: Non-ascii characters in the UI
|
|
|
|
* Refiling messages:: Moving message to some archive folder
|
|
|
|
* Saving outgoing messages:: Automatically save sent messages
|
|
|
|
* Confirmation before sending:: Check messages before sending
|
2013-02-11 22:38:14 +01:00
|
|
|
@end menu
|
|
|
|
|
2016-01-10 10:56:58 +01:00
|
|
|
@node Fancy characters
|
|
|
|
@section Fancy characters
|
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
When using `fancy characters' (@code{mu4e-use-fancy-chars}) with the
|
2016-01-10 10:56:58 +01:00
|
|
|
@emph{Inconsolata}-font (and likely others as well), the display may be
|
|
|
|
slightly off; the reason for this issue is that Inconsolata does not
|
2016-12-31 17:01:30 +01:00
|
|
|
contain the glyphs for the `fancy' arrows and the glyphs that are used
|
2016-01-10 10:56:58 +01:00
|
|
|
as replacements are too high.
|
|
|
|
|
|
|
|
To fix this, you can use something like the following workaround (in
|
|
|
|
your @t{.emacs}-file):
|
|
|
|
@lisp
|
|
|
|
(if (equal window-system 'x)
|
|
|
|
(progn
|
|
|
|
(set-fontset-font "fontset-default" 'unicode "Dejavu Sans Mono")
|
|
|
|
(set-face-font 'default "Inconsolata-10")))
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
Other fonts with good support for Unicode are @t{unifont} and
|
|
|
|
@t{symbola}.
|
|
|
|
|
|
|
|
For a more complete solution, but with greater overhead, you can also
|
|
|
|
try the @emph{unicode-fonts} package:
|
|
|
|
@lisp
|
|
|
|
(require 'unicode-fonts)
|
|
|
|
(require 'persistent-soft) ; To cache the fonts and reduce load time
|
|
|
|
(unicode-fonts-setup)
|
|
|
|
@end lisp
|
|
|
|
|
2013-12-01 20:09:38 +01:00
|
|
|
@node Refiling messages
|
|
|
|
@section Refiling messages
|
2013-02-11 22:38:14 +01:00
|
|
|
|
|
|
|
By setting @code{mu4e-refile-folder} to a function, you can dynamically
|
|
|
|
determine where messages are to be refiled. If you want to do this based
|
|
|
|
on the subject of a message, you can use a function that matches the
|
|
|
|
subject against a list of regexes in the following way. First, set up a
|
|
|
|
variable @code{my-mu4e-subject-alist} containing regexes plus associated
|
|
|
|
mail folders:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defvar my-mu4e-subject-alist '(("kolloqui\\(um\\|a\\)" . "/Kolloquium")
|
|
|
|
("Calls" . "/Calls")
|
|
|
|
("Lehr" . "/Lehre")
|
|
|
|
("webseite\\|homepage\\|website" . "/Webseite"))
|
|
|
|
"List of subjects and their respective refile folders.")
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
Now you can use the following function to automatically refile messages
|
|
|
|
based on their subject line:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my-mu4e-refile-folder-function (msg)
|
|
|
|
"Set the refile folder for MSG."
|
|
|
|
(let ((subject (mu4e-message-field msg :subject))
|
|
|
|
(folder (or (cdar (member* subject my-mu4e-subject-alist
|
|
|
|
:test #'(lambda (x y)
|
|
|
|
(string-match (car y) x))))
|
|
|
|
"/General")))
|
|
|
|
folder))
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
Note the @t{"/General"} folder: it is the default folder in case the
|
|
|
|
subject does not match any of the regexes in
|
|
|
|
@code{my-mu4e-subject-alist}.
|
|
|
|
|
|
|
|
In order to make this work, you'll of course need to set
|
|
|
|
@code{mu4e-refile-folder} to this function:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(setq mu4e-refile-folder 'my-mu4e-refile-folder-function)
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
If you have multiple accounts, you can accommodate them as well:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my-mu4e-refile-folder-function (msg)
|
|
|
|
"Set the refile folder for MSG."
|
|
|
|
(let ((maildir (mu4e-message-field msg :maildir))
|
|
|
|
(subject (mu4e-message-field msg :subject))
|
|
|
|
folder)
|
|
|
|
(cond
|
|
|
|
((string-match "Account1" maildir)
|
|
|
|
(setq folder (or (catch 'found
|
|
|
|
(dolist (mailing-list my-mu4e-mailing-lists)
|
2013-06-12 09:09:19 +02:00
|
|
|
(if (mu4e-message-contact-field-matches
|
|
|
|
msg :to (car mailing-list))
|
2013-02-11 22:38:14 +01:00
|
|
|
(throw 'found (cdr mailing-list)))))
|
|
|
|
"/Account1/General")))
|
|
|
|
((string-match "Gmail" maildir)
|
|
|
|
(setq folder "/Gmail/All Mail"))
|
|
|
|
((string-match "Account2" maildir)
|
|
|
|
(setq folder (or (cdar (member* subject my-mu4e-subject-alist
|
|
|
|
:test #'(lambda (x y)
|
2013-06-12 09:09:19 +02:00
|
|
|
(string-match
|
|
|
|
(car y) x))))
|
2013-02-11 22:38:14 +01:00
|
|
|
"/Account2/General"))))
|
|
|
|
folder))
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
This function actually uses different methods to determine the refile
|
2016-12-31 17:01:30 +01:00
|
|
|
folder, depending on the account: for @emph{Account2}, it uses
|
2013-05-25 18:26:54 +02:00
|
|
|
@code{my-mu4e-subject-alist}, for the @emph{Gmail} account it simply uses the
|
2016-12-31 17:01:30 +01:00
|
|
|
folder ``All Mail''. For Account1, it uses another method: it files the
|
2013-02-11 22:38:14 +01:00
|
|
|
message based on the mailing list to which it was sent. This requires
|
|
|
|
another variable:
|
|
|
|
|
|
|
|
@lisp
|
2013-06-12 09:09:19 +02:00
|
|
|
(defvar my-mu4e-mailing-lists
|
|
|
|
'(("mu-discuss@@googlegroups.com" . "/Account1/mu4e")
|
|
|
|
("pandoc-discuss@@googlegroups.com" . "/Account1/Pandoc")
|
|
|
|
("auctex@@gnu.org" . "/Account1/AUCTeX"))
|
|
|
|
"List of mailing list addresses and folders where
|
|
|
|
their messages are saved.")
|
2013-02-11 22:38:14 +01:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@node Saving outgoing messages
|
|
|
|
@section Saving outgoing messages
|
|
|
|
|
2013-08-24 10:17:00 +02:00
|
|
|
Like @code{mu4e-refile-folder}, the variable @code{mu4e-sent-folder} can also
|
|
|
|
be set to a function, in order to dynamically determine the save folder. One
|
|
|
|
might, for example, wish to automatically put messages going to mailing lists
|
|
|
|
into the trash (because you'll receive them back from the list anyway). If you
|
|
|
|
have set up the variable @code{my-mu4e-mailing-lists} as mentioned, you can
|
|
|
|
use the following function to determine a save folder:
|
2013-02-11 22:38:14 +01:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(defun my-mu4e-sent-folder-function (msg)
|
|
|
|
"Set the sent folder for the current message."
|
|
|
|
(let ((from-address (message-field-value "From"))
|
|
|
|
(to-address (message-field-value "To")))
|
|
|
|
(cond
|
2015-12-15 11:57:25 +01:00
|
|
|
((string-match "my.address@@account1.example.com" from-address)
|
2013-02-11 22:38:14 +01:00
|
|
|
(if (member* to-address my-mu4e-mailing-lists
|
|
|
|
:test #'(lambda (x y)
|
|
|
|
(string-match (car y) x)))
|
|
|
|
"/Trash"
|
|
|
|
"/Account1/Sent"))
|
|
|
|
((string-match "my.address@@gmail.com" from-address)
|
|
|
|
"/Gmail/Sent Mail")
|
|
|
|
(t (mu4e-ask-maildir-check-exists "Save message to maildir: ")))))
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
Note that this function doesn't use @code{(mu4e-message-field msg
|
|
|
|
:maildir)} to determine which account the message is being sent from.
|
2016-12-31 17:01:30 +01:00
|
|
|
The reason is that the function in @code{mu4e-sent-folder} is
|
|
|
|
called when you send the message, but before @t{mu4e} has created the
|
2013-02-11 22:38:14 +01:00
|
|
|
message struct from the compose buffer, so that
|
|
|
|
@code{mu4e-message-field} cannot be used. Instead, the function uses
|
|
|
|
@code{message-field-value}, which extracts the values of the headers in
|
|
|
|
the compose buffer. This means that it is not possible to extract the
|
|
|
|
account name from the message's maildir, so instead the from address is
|
|
|
|
used to determine the account.
|
|
|
|
|
|
|
|
Again, the function shows three different possibilities: for the first
|
2015-12-15 11:57:25 +01:00
|
|
|
account (@t{my.address@@account1.example.com}) it uses
|
2013-02-11 22:38:14 +01:00
|
|
|
@code{my-mu4e-mailing-lists} again to determine if the message goes to a
|
|
|
|
mailing list. If so, the message is put in the trash folder, if not, it
|
|
|
|
is saved in @t{/Account1/Sent}. For the second (Gmail) account, sent
|
|
|
|
mail is simply saved in the Sent Mail folder.
|
|
|
|
|
|
|
|
If the from address is not associated with Account1 or with the Gmail
|
|
|
|
account, the function uses @code{mu4e-ask-maildir-check-exists} to ask
|
|
|
|
the user for a maildir to save the message in.
|
|
|
|
|
2014-05-25 03:15:43 +02:00
|
|
|
@node Confirmation before sending
|
|
|
|
@section Confirmation before sending
|
|
|
|
|
|
|
|
To protect yourself from sending messages too hastily, you can add a
|
|
|
|
final confirmation, which you can of course make as elaborate as you
|
|
|
|
wish.
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(add-hook 'message-send-hook
|
|
|
|
(lambda ()
|
|
|
|
(unless (yes-or-no-p "Sure you want to send this?")
|
|
|
|
(signal 'quit nil))))
|
|
|
|
@end lisp
|
|
|
|
|
2020-01-12 21:44:56 +01:00
|
|
|
Another option is to simply set @code{message-confirm-send} to
|
|
|
|
non-@t{nil} so the question ``Send message?'' is asked for confirmation.
|
|
|
|
|
2011-12-22 23:39:32 +01:00
|
|
|
@node How it works
|
2012-01-06 13:04:08 +01:00
|
|
|
@appendix How it works
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2014-05-25 03:15:43 +02:00
|
|
|
While perhaps not interesting for all users of @t{mu4e}, some curious
|
|
|
|
souls may want to know how @t{mu4e} does its job.
|
2011-12-22 23:39:32 +01:00
|
|
|
|
|
|
|
@menu
|
2016-12-31 17:01:30 +01:00
|
|
|
* High-level overview::How the pieces fit together
|
2016-01-10 10:56:58 +01:00
|
|
|
* mu server::The mu process running in the background
|
|
|
|
* Reading from the server::Processing responses from the server
|
|
|
|
* The message s-expression::What messages look like from the inside
|
2011-12-22 23:39:32 +01:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node High-level overview
|
|
|
|
@section High-level overview
|
|
|
|
|
2012-10-06 21:22:11 +02:00
|
|
|
At a high level, we can summarize the structure of the @t{mu4e} system using
|
2011-12-22 23:39:32 +01:00
|
|
|
some ascii-art:
|
|
|
|
|
2012-10-11 16:50:32 +02:00
|
|
|
@cartouche
|
2011-12-22 23:39:32 +01:00
|
|
|
@example
|
|
|
|
+---------+
|
|
|
|
| emacs |
|
|
|
|
| +------+
|
|
|
|
+----| mu4e | --> send mail (smtpmail)
|
|
|
|
+------+
|
2011-12-23 18:09:03 +01:00
|
|
|
| A
|
|
|
|
V | ---/ search, view, move mail
|
2011-12-22 23:39:32 +01:00
|
|
|
+---------+ \
|
|
|
|
| mu |
|
|
|
|
+---------+
|
|
|
|
| A
|
|
|
|
V |
|
|
|
|
+---------+
|
|
|
|
| Maildir | <--- receive mail (fetchmail,
|
|
|
|
+---------+ offlineimap, ...)
|
|
|
|
@end example
|
2012-10-11 16:50:32 +02:00
|
|
|
@end cartouche
|
2011-12-22 23:39:32 +01:00
|
|
|
|
|
|
|
In words:
|
|
|
|
@itemize
|
2012-10-17 17:35:23 +02:00
|
|
|
@item Your e-mail messages are stored in a Maildir-directory
|
2012-10-16 20:43:49 +02:00
|
|
|
(typically, @file{~/Maildir} and its subdirectories), and new mail comes in
|
|
|
|
using tools like @t{fetchmail}, @t{offlineimap}, or through a local mail
|
|
|
|
server.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @t{mu} indexes these messages periodically, so you can quickly search for
|
|
|
|
them. @t{mu} can run in a special @t{server}-mode, where it provides services
|
2012-10-17 17:35:23 +02:00
|
|
|
to client software.
|
2020-02-24 20:58:45 +01:00
|
|
|
@item @t{mu4e}, which runs inside Emacs is
|
2016-08-02 20:15:32 +02:00
|
|
|
such a client; it communicates with @command{mu} (in its @t{server}-mode) to
|
2013-05-21 19:11:11 +02:00
|
|
|
search for messages, and manipulate them.
|
2012-10-14 16:00:25 +02:00
|
|
|
@item @t{mu4e} uses the facilities
|
2020-02-24 20:58:45 +01:00
|
|
|
offered by Emacs (the Gnus message editor and @t{smtpmail}) to send
|
2012-10-14 16:00:25 +02:00
|
|
|
messages.
|
2011-12-22 23:39:32 +01:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@node mu server
|
|
|
|
@section @t{mu server}
|
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
@t{mu4e} is based on the @t{mu} e-mail searching/indexer. The latter
|
|
|
|
is a C++-program; there are different ways to communicate with a
|
|
|
|
client that is emacs-based.
|
|
|
|
|
|
|
|
One way to implement this, would be to call the @t{mu} command-line
|
|
|
|
tool with some parameters and then parse the output. In fact, that was
|
|
|
|
the first approach --- @t{mu4e} would invoke e.g., @t{mu find} and
|
2020-02-24 20:58:45 +01:00
|
|
|
process the output in Emacs.
|
2020-01-19 20:38:05 +01:00
|
|
|
|
|
|
|
However, with this approach, we need to load the entire e-mail
|
|
|
|
@emph{Xapian} database (in which the message is stored) for each
|
|
|
|
invocation. Wouldn't it be nicer to keep a running @t{mu} instance
|
|
|
|
around? Indeed, it would --- and thus, the @t{mu server} sub-command
|
|
|
|
was born. Running @t{mu server} starts a simple shell, in which you
|
|
|
|
can give commands to @command{mu}, which then spits out the
|
|
|
|
results/errors. @command{mu server} is not meant for humans, but it
|
|
|
|
can be used manually, which is great for debugging.
|
2011-12-22 23:39:32 +01:00
|
|
|
|
|
|
|
@node Reading from the server
|
|
|
|
@section Reading from the server
|
|
|
|
|
|
|
|
In the design, the next question was what format @t{mu} should use for its
|
2020-02-24 20:58:45 +01:00
|
|
|
output for @t{mu4e} (Emacs) to process. Some other programs use
|
2011-12-22 23:39:32 +01:00
|
|
|
@abbr{JSON} here, but it seemed easier (and possibly, more efficient) just to
|
2020-02-24 20:58:45 +01:00
|
|
|
talk to Emacs in its native language: @emph{s-expressions}, and
|
|
|
|
interpret those using the Emacs-function
|
2012-04-21 11:48:00 +02:00
|
|
|
@code{read-from-string}. See @ref{The message s-expression} for details on the
|
|
|
|
format.
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2016-12-31 17:01:30 +01:00
|
|
|
So, now let's look at how we process the data from @t{mu server} in
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs. We'll leave out a lot of details, @t{mu4e}-specifics, and look
|
2012-10-14 16:00:25 +02:00
|
|
|
at a bit more generic approach.
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2012-04-30 07:16:44 +02:00
|
|
|
The first thing to do is to create a process (for example, with
|
2012-09-30 19:12:07 +02:00
|
|
|
@code{start-process}), and then register a filter function for it, which is
|
|
|
|
invoked whenever the process has some data for us. Something like:
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2012-04-06 10:00:39 +02:00
|
|
|
@lisp
|
2011-12-22 23:39:32 +01:00
|
|
|
(let ((proc (start-process <arguments>)))
|
|
|
|
(set-process-filter proc 'my-process-filter)
|
|
|
|
(set-process-sentinel proc 'my-process-sentinel))
|
2012-04-06 10:00:39 +02:00
|
|
|
@end lisp
|
2011-12-23 18:09:03 +01:00
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
Note, the process sentinel is invoked when the process is terminated
|
|
|
|
--- so there you can clean things up. The function
|
|
|
|
@code{my-process-filter} is a user-defined function that takes the
|
|
|
|
process and the chunk of output as arguments; in @t{mu4e} it looks
|
|
|
|
something like (pseudo-lisp):
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2012-04-06 10:00:39 +02:00
|
|
|
@lisp
|
2011-12-22 23:39:32 +01:00
|
|
|
(defun my-process-filter (proc str)
|
|
|
|
;; mu4e-buf: a global string variable to which data gets appended
|
|
|
|
;; as we receive it
|
2011-12-23 18:09:03 +01:00
|
|
|
(setq mu4e-buf (concat mu4e-buf str))
|
2011-12-22 23:39:32 +01:00
|
|
|
(when <we-have-received-a-full-expression>
|
2011-12-23 18:09:03 +01:00
|
|
|
<eat-expression-from mu4e-buf>
|
2011-12-22 23:39:32 +01:00
|
|
|
<evaluate-expression>))
|
2012-04-06 10:00:39 +02:00
|
|
|
@end lisp
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
@code{<evaluate-expression>} de-multiplexes the s-expression we got.
|
|
|
|
For example, if the s-expression looks like an e-mail message header,
|
|
|
|
it is processed by the header-handling function, which appends it to
|
|
|
|
the header list. If the s-expression looks like an error message, it
|
|
|
|
is reported to the user. And so on.
|
2011-12-22 23:39:32 +01:00
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
The language between frontend and backend is documented partly in the
|
|
|
|
@t{mu-server} man-page and more completely in the output of @t{mu
|
|
|
|
server --commands}.
|
|
|
|
|
|
|
|
@t{mu4e} can log these communications; you can use @kbd{M-x
|
|
|
|
mu4e-toggle-logging} to turn logging on and off, and you can view the
|
|
|
|
log using @kbd{M-x mu4e-show-log} (@key{$}).
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
@node The message s-expression
|
|
|
|
@section The message s-expression
|
|
|
|
|
2012-04-24 21:37:50 +02:00
|
|
|
A typical message s-expression looks something like the following:
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(:docid 32461
|
|
|
|
:from (("Nikola Tesla" . "niko@@example.com"))
|
|
|
|
:to (("Thomas Edison" . "tom@@example.com"))
|
|
|
|
:cc (("Rupert The Monkey" . "rupert@@example.com"))
|
|
|
|
:subject "RE: what about the 50K?"
|
|
|
|
:date (20369 17624 0)
|
|
|
|
:size 4337
|
2012-10-14 16:00:25 +02:00
|
|
|
:message-id "C8233AB82D81EE81AF0114E4E74@@123213.mail.example.com"
|
2012-04-21 11:48:00 +02:00
|
|
|
:path "/home/tom/Maildir/INBOX/cur/133443243973_1.10027.atlas:2,S"
|
|
|
|
:maildir "/INBOX"
|
|
|
|
:priority normal
|
|
|
|
:flags (seen)
|
2012-05-13 14:02:40 +02:00
|
|
|
:parts ( (:index 1 :mime-type "text/plain" :size 12345 :attachment nil)
|
2012-09-28 16:12:09 +02:00
|
|
|
(:index 2 :name "photo.jpg" :mime-type "image/jpeg"
|
|
|
|
:size 147331 :attachment t)
|
|
|
|
(:index 3 :name "book.pdf" :mime-type "application/pdf"
|
|
|
|
:size 192220 :attachment t))
|
2012-10-14 16:00:25 +02:00
|
|
|
:references ("C8384574032D81EE81AF0114E4E74@@123213.mail.example.com"
|
|
|
|
"38203498230942D81EE81AF0114E4E74@@123213.mail.example.com")
|
|
|
|
:in-reply-to "38203498230942D81EE81AF0114E4E74@@123213.mail.example.com"
|
2012-04-21 11:48:00 +02:00
|
|
|
:body-txt "Hi Tom,
|
|
|
|
....
|
2013-04-17 20:04:42 +02:00
|
|
|
")
|
2012-04-21 11:48:00 +02:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
This s-expression forms a property list (@t{plist}), and we can get values
|
|
|
|
from it using @t{plist-get}; for example @code{(plist-get msg :subject)} would
|
|
|
|
get you the message subject. However, it's better to use the function
|
2012-09-28 16:12:09 +02:00
|
|
|
@code{mu4e-message-field} to shield you from some of the implementation
|
|
|
|
details that are subject to change; and see the other convenience functions in
|
|
|
|
@file{mu4e-message.el}.
|
2012-04-21 11:48:00 +02:00
|
|
|
|
|
|
|
Some notes on the format:
|
|
|
|
@itemize
|
|
|
|
@item The address fields are @emph{lists} of pairs @code{(name . email)},
|
2016-12-31 17:01:30 +01:00
|
|
|
where @t{name} can be @t{nil}.
|
2020-02-24 20:58:45 +01:00
|
|
|
@item The date is in format Emacs uses (for example in
|
2012-04-21 11:48:00 +02:00
|
|
|
@code{current-time}).@footnote{Emacs 32-bit integers have only 29 bits
|
2020-01-19 20:38:05 +01:00
|
|
|
available for the actual number; the other bits are use by
|
2020-02-24 20:58:45 +01:00
|
|
|
Emacs for internal purposes. Therefore, we need to split
|
2020-01-19 20:38:05 +01:00
|
|
|
@t{time_t} in two numbers.}
|
2012-04-21 11:48:00 +02:00
|
|
|
@item Attachments are a list of elements with fields @t{:index} (the number of
|
|
|
|
the MIME-part), @t{:name} (the file name, if any), @t{:mime-type} (the
|
|
|
|
MIME-type, if any) and @t{:size} (the size in bytes, if any).
|
|
|
|
@item Messages in the @ref{Headers view} come from the database and do not have
|
|
|
|
@t{:attachments}. @t{:body-txt} or @t{:body-html} fields. Message in the
|
|
|
|
@ref{Message view} use the actual message file, and do include these fields.
|
|
|
|
@end itemize
|
2012-04-11 01:11:47 +02:00
|
|
|
|
|
|
|
@subsection Example: ping-pong
|
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
As an example of the communication between @t{mu4e} and @command{mu},
|
|
|
|
let's look at the @t{ping-pong}-sequence. When @t{mu4e} starts, it
|
|
|
|
sends a command @t{ping} to the @t{mu server} backend, to learn about
|
|
|
|
its version. @t{mu server} then responds with a @t{pong} s-expression
|
|
|
|
to provide this information (this is implemented in
|
|
|
|
@file{mu-cmd-server.c}).
|
2012-04-11 01:11:47 +02:00
|
|
|
|
|
|
|
We start this sequence when @t{mu4e} is invoked (when the program is
|
2012-09-30 19:12:07 +02:00
|
|
|
started). It calls @t{mu4e-proc-ping}, and registers a (lambda) function for
|
|
|
|
@t{mu4e-proc-pong-func}, to handle the response.
|
2012-04-11 01:11:47 +02:00
|
|
|
|
|
|
|
@verbatim
|
2020-01-19 20:38:05 +01:00
|
|
|
-> (ping)
|
|
|
|
<-<prefix>(:pong "mu" :props (:version "x.x.x" :doccount 78545))
|
2012-04-11 01:11:47 +02:00
|
|
|
@end verbatim
|
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
When we receive such a @t{pong} (in @file{mu4e-proc.el}), the lambda
|
|
|
|
function we registered is called, and it compares the version we got
|
|
|
|
from the @t{pong} with the version we expected, and raises an error if
|
|
|
|
they differ.
|
2012-04-11 01:11:47 +02:00
|
|
|
|
2018-06-13 12:21:22 +02:00
|
|
|
@node Debugging
|
|
|
|
@appendix Debugging
|
2012-04-16 17:31:48 +02:00
|
|
|
|
|
|
|
As explained in @ref{How it works}, @t{mu4e} communicates with its backend
|
|
|
|
(@t{mu server}) by sending commands and receiving responses (s-expressions).
|
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
For debugging purposes, it can be very useful to see this data. For
|
|
|
|
this reason, @t{mu4e} can log all these messages. Note that the
|
|
|
|
`protocol' is documented to some extent in the @t{mu-server} manpage.
|
2012-04-16 17:31:48 +02:00
|
|
|
|
2020-01-19 20:38:05 +01:00
|
|
|
You can enable (and disable) logging with @kbd{M-x
|
|
|
|
mu4e-toggle-logging}. The log-buffer is called @t{*mu4e-log*}, and in
|
|
|
|
the @ref{Main view}, @ref{Headers view} and @ref{Message view},
|
|
|
|
there's a keybinding @key{$} that takes you there. You can quit it by
|
|
|
|
pressing @key{q}.
|
2012-04-16 17:31:48 +02:00
|
|
|
|
2019-07-12 16:36:08 +02:00
|
|
|
Logging can be a bit resource-intensive, so you may not want to leave
|
|
|
|
it on all the time. By default, the log only maintains the most recent
|
|
|
|
1200 lines. @t{mu} itself keeps a log as well, you can find it in
|
|
|
|
@t{<MUHOME>/mu.log}, on Unix typically @t{~/.cache/mu/mu.log}.
|
2012-04-16 18:33:21 +02:00
|
|
|
|
2012-01-01 21:48:11 +01:00
|
|
|
@node GNU Free Documentation License
|
|
|
|
@appendix GNU Free Documentation License
|
2012-10-22 19:27:49 +02:00
|
|
|
|
2012-10-20 14:49:53 +02:00
|
|
|
@include fdl.texi
|
2012-01-01 21:48:11 +01:00
|
|
|
|
2012-10-03 11:53:24 +02:00
|
|
|
@bye
|
2020-02-24 20:58:45 +01:00
|
|
|
|
|
|
|
@c Local Variables:
|
|
|
|
@c coding: utf-8
|
|
|
|
@c End:
|