eww is basically an interactive wrapper around the shr package, which renders HTML as Emacs text (the actual HTML parsing is done by the libxml package). You can use it in mu4e by setting mu4e-html2text-command to a simple custom function:
(defun my-render-html-message ()
(let ((dom (libxml-parse-html-region (point-min) (point-max))))
I'm using mu4e with two accounts. Each account has its own maildir:
The manual comes with an example function to choose an account:
(defun my-mu4e-set-account ()
"Set the account for composing a message."
(let ((maildir (mu4e-message-field mu4e-...
I can only suggest a solution for gnus and dired but it is at least easier as lawlist suggested. Open the directory in dired with C-x 4 d and type M-x turn-on-gnus-dired-mode. Then mark the required files and type C-c RET C-a. That's it and the files can be attached to an already opened or a new message buffer (I'm not sure if this works for other MUAs as ...
You can't set mu4e-maildir in contexts.
You can set any kind of variable; including settings for mail servers etc. However, settings such as mu4e-maildir and mu4e-mu-home are not changeable after they have been set without quitting mu4e first.
So, you should set as follows:
I'm using two different accounts that I want to mix as little as possible.
offlineimap is configured with two accounts, one delivering mail into ~/.maildir-work the other one into ~/.maildir-home.
My configuration for mu4e uses the new context mechanism:
You can skip specific maildir from indexing for search, using .noindex file.
If there is a file called .noindex in a directory, the contents of that directory and all of its subdirectories
will be ignored. This can be useful to exclude certain directories from the indexing process, for example direc‐
tories with spam-messages.
Use wrapper shell script.
Below please find trivial sample script checking connection status as reported by Unix/Linux NetworkManager.
# exit if there is no internet connection
/usr/bin/nm-online || exit
Emacs fix (use wrapper instead of directly using offlineimap):
(setq mu4e-get-mail-command "/home/me/bin/offlineimap-...
The usual approach is to force encryption to happen for your own key, in addition to the recipients' (and that's only one encryption).
Depending on what you use exactly, you might want to
(setq mml2015-encrypt-to-self t)
in your gnupg configuration, or anything similar.
This way, your messages will be stored encrypted, and you'll ...
You can turn off auto-fill-mode in the mu4e message buffer. You can do so automatically by adding a function to the mu4e-compose-mode-hook:
(defun no-auto-fill ()
"Turn off auto-fill-mode."
(add-hook 'mu4e-compose-mode-hook #'no-auto-fill)
The variable mu4e~contacts-for-completion stores a list of contacts that mu4e knows about. The contacts are conveniently stored as "name <email>" strings, which is the same thing you want to insert.
Here's an example function that uses the variable together with ido to select and insert a contact:
(defun select-and-insert-contact ()
If you use offlineimap (like I do) then your drafts likely accumulate because offlineimap syncs emacs' #autosave# files (kept in Drafts/cur folder). As offlineimap can only ignore files starting with '.' (and it's not configurable) the solution is to change the way draft autosaves are named:
(defun draft-auto-save-buffer-name-handler (operation &rest ...
e runs the command mu4e-view-save-attachment
Offer to save attachment(s). If MULTI (prefix-argument) is nil, save a
single one, otherwise, offer to save a range of attachments.
Alternatively, with point on an attachment name, you can use S-RET:
S-return runs the command mu4e~view-save-attach-from-binding
Save the attachement at ...
It's been almost two years since the question was asked, but I have just had the same problem and I managed to solve it using the smtpmail-smtp-user variable. In the manual it says:
If the variable smtpmail-smtp-user is set to a non-nil value, then only entries for that user are considered.
In my personal context vars I have:
(smtpmail-smtp-user . "...
(Posting this Q&A combo since it took me a while to figure out, and it might save someone else the trouble.)
this answer to
a question on how to test for an internet connection within elisp,
we can call a shell command:
(defun internet-up-p (&optional host)
(= 0 (call-process "ping" nil nil nil "-c" "1" "-W" "1"
g will prompt you for a url to visit, which you select by number. (The numbers appear next to the link in the message)
From mu4e you can open the manual at any time with H. This will open the manual at the section for whichever view you were in - main, headers, message, editor. To find out what you can do with an individual message you need the Message View ...
mu4e uses message.el to edit the messages. The documentation for message-citation-line-function in that package shows:
Function called to insert the "Whomever writes:" line.
Predefined functions include ‘message-insert-citation-line’ and
‘message-insert-formatted-citation-line’ (see the variable
The definition of ...
I have dealt with this issue a lot. The encoding will be depending on information in the file. If there is no information in the file explicitly to determine what it is, you could get such things as above.
If your work doesn't involve a lot of ancient systems which require different coding, you could consider to force default UTF-8 coding everywhere.
We can set
(setq mm-sign-option 'guided)
and now we will be prompted with key selection menu before sending a message.
Option of creating signed parts. nil, use default signing keys; guided, ask user to select signing keys from the menu.
We should be able to automate key selection based on e.g. From: field with ...
Is there a way to let mu4e display certain attachments inline with the email text?
The short answer is "no."
mu concatenates all text/plain parts to form the body of a message--- both for indexing and viewing messages. As far as I can tell only text/plain gets this treatment and since this is done by mu you cannot change this behavior in mu4e. (See static ...
Turns out that it's pretty straightforward to put this function together, although there's a bunch of housekeeping to keep the buffers tidy. The following command words with mu4e in both its headers and view modes. It's minimally tested at this point, but seems to be working in the main. Note that it hard codes a few things such as the section heading and ...
Set the following variable in your Emacs init file (or try it in the *scratch* buffer)
(setq mu4e-view-show-addresses 't)
In a pinch, you can also look at the raw message when in view mode with a period (.).
The org-mode integration is built-in to mu4e, but it is kept in a separate package that is not enabled by default. You have to run
After that you can use org-store-link in both mu4e headers and message modes. The link is then added to a buffer with org-insert-link as always.
More in the manual.
org-read-date can handle a certain amount of fuzziness, e.g.
'22 sept 0:34’ ⇒ 2006-09-22 0:34
‘w4’ ⇒ ISO week for of the current year 2006
‘2012 w4 fri’ ⇒ Friday of ISO week 4 in 2012
‘2012-w04-5’ ⇒ Same as above
See Org Mode date/time prompt for the gory details.
You may have display of "related messages" turned on. Try pressing W (note: capital) while in your inbox (mu4e-headers-toggle-include-related) and seeing if those messages disappear.
If this is what is happening then those messages you were seeing weren't being "moved" back from where they were archived to; mu4e is including them in the inbox headers list ...
I like to use helm-find-files for this. You navigate to where the files are, mark the ones you want with C-spc, and attach them with C-c C-a (or press tab and find the attach files to email action).
The ivy equivalent of this is counsel-find-file. First, add this action to it:
'(("a" (lambda (x)
(unless (memq ...
I'm using a setup very similar to Magnus', and just wanted to add that (mu4e-quit) exists, and it works fine for cleaning up accounts without restarting. Actual mechanism:
(defun mail-gmail ()
(setenv "MAILDIR" "/Users/foo/Maildir/gmail")
(setenv "MU_HOME" "/Users/foo/.mu/gmail")
(setq mu4e-maildir "/Users/foo/Maildir/gmail")
My first suggestion would be to try the following.
(add-hook 'message-send-hook (lambda () (org-store-link nil)))
Since you said you tried the hook, another way is to just combine
org-store-link and message sending into a single function.
(defun store-link-then-send-message ()
"Call `org-store-link', then send current email message."
You could write a function that copies the subtree to the kill ring, creates a new buffer in message-mode, inserts a couple of lines and pastes the contents of the kill ring, like so:
(defun my-status-as-email ()
;; TODO: copy org subtree to kill ring
(set-buffer (get-buffer-create "*draft*"))
(insert "From: ...