-1

I recently started to move my workflow over to emacs and was able to configure my email with mu4e with emacs, but offlineimap, which controls updating my email, function is not working when I invoke it.

Screenshot of Error

I use zsh as my shell. Would that be the reason it is not working, because when I run it in my zsh shell it works? Do I need to use bash and how would I change it?

When running:mu index --maildir=~/Maildir I get the error mu: mu_store_new_writable: xapian error 'Unable to get write lock on /Users/nathan/.mu/xapian: already locked' (11)

Here is my emacs configuration:

(add-to-list 'load-path "/usr/local/Cellar/mu/HEAD-b4cc67d/share/emacs/site-lisp/mu/mu4e")
(require 'mu4e)

(setq mu4e-mu-binary "/usr/local/Cellar/mu/HEAD-b4cc67d/bin/mu")

;; use mu4e for e-mail in emacs
(setq mail-user-agent 'mu4e-user-agent)
;; default
;; (setq mu4e-maildir "~/Maildir")

(setq mu4e-drafts-folder "/Drafts")
(setq mu4e-sent-folder   "/Sent Mail")
(setq mu4e-trash-folder  "/Trash")

;; don't save message to Sent Messages, Lavabit/IMAP takes care of this
(setq mu4e-sent-messages-behavior 'delete)

;; (See the documentation for "mu4e-sent-messages-behavior' if you have

;; setup some handy shortcuts
;; 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''.

(setq mu4e-maildir-shortcuts
    '( ("/Inbox"                 . ?i)
       ("/Sent Mail"             . ?s)
       ("/Trash"                 . ?t)
       ("/All Mail"              . ?a)))

;; allow for updating mail using 'U' in the main view:
(setq mu4e-get-mail-command "offlineimap -o" mu4e-update-interval (* 60 5))

;; something about ourselves
(setq
   user-mail-address "*******.com"
   user-full-name  "*********"
   mu4e-compose-signature
    (concat
      "************\n"
      "***********\n"))

;; sending mail -- replace USERNAME with your lavabit 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
   starttls-use-gnutls t
   smtpmail-starttls-credentials '(("smtp.********.com" 587 nil nil))
   smtpmail-auth-credentials
     '(("smtp.lavabit.com" 587 "************" nil))
   smtpmail-default-smtp-server "smtp.**********.com"
   smtpmail-smtp-server "smtp.*********.com"
   smtpmail-smtp-service 587)

;; don't keep message buffers around
(setq message-kill-buffer-on-exit t)
  • Please edit your post to include your actual code rather than a screenshot. As a shot in the semi-dark, try (setq mu4e-get-mail-command "offlineimap -o" mu4e-update-interval (* 60 5)). OTOH, the error message seems to imply that offlineimap may not be on your path. – Dan Apr 6 '18 at 19:17
  • That didn't work. Still gives the same error. zsh:1:command not found: offlineimap – Nathan Jackson Apr 6 '18 at 23:33
1

command not found: offlineimap is a weird hint, but a better one than you might expect. Emacs doesn't always have the PATH you might expect; there's a very good package designed precisely to help with this.

The test is pretty simple: evaluate[fn1] the following code.

(executable-find "offlineimap")

If this works, you should get back a path pointing to a binary -- something like /usr/local/bin/offlineimap. If it doesn't work, kick over to your terminal and i If none of that is the problem, then it's less likely the problem is zsh (which is perfectly civil)ssue which offlineimap. Whatever dir it's in needs to be added to the Emacs path. Helpful hint: exec-path-from-shell has a wonderful init function which will do this for you.

[fn1] You can evaluate arbitrary emacs lisp by either putting it in a scratch buffer, putting your cursor anywhere inside the sexp, and calling M-x eval-defun (bound to C-M x by default), or by hitting M-:, entering the expression into the mini buffer, and hitting RET.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.