wrong-type-argument listp mu4e-sent-folder

523 views
Skip to first unread message

nuk3...@gmail.com

unread,
Jan 7, 2015, 4:48:07 PM1/7/15
to mu-di...@googlegroups.com
HI everyone,

Thank you very much djcb for the excellent blog emacs-fu and of course mu and mu4e.

I'm running arch-linx 64 bit, emacs 24.4.1, mu 0.9.11 and offlineimap 6.5.5.

I've setup offlineimap to authenticate against a .authinfo.gpg file and that is working fine.  I can fetch mail successfully, however I must explicitly invoke mu from either the command line or mu4e-update-index to get new mail.

But that's not the major issue, the issue is that I am unfortunately unable to send any mail. Even with only a single account active... (i.e. other settings commented out)?

Specifically there seems to be something regarding the email witching that is expecting mu4e-sent-folder to be a list, when it's a string i.e. "/Account1/sent/". I fear that I've made a really stupid and trivial mistake in the elisp syntax somewhere, and I'm really sorry to clog the mailling list like this. I've scrounged around for a solution on the internet, the #emacs, #lisp #erc irc channels and was as yet unfortunately unable to comeup with a solution.

When running (Compile, Reply, Forward, etc) with debuger-enter-on-error: it throws " (wrong-type-argument listp mu4e-sent-folder) ". I do get prompted in the minibuffer to chose one of the accounts in ~/Maildir, but on selection of any of these, an error results, please see below.

Debugger entered--Lisp error: (wrong-type-argument listp mu4e-sent-folder)
  car(mu4e-sent-folder)
  (set (car var) (cadr var))
  (lambda (var) (set (car var) (cadr var)))(mu4e-sent-folder)
  mapc((lambda (var) (set (car var) (cadr var))) (mu4e-sent-folder "/Gmail/Sent" mu4e-drafts-folder "/Gmail/Drafts" mu4e-trash-folder "/Gmail/Trash" mu4e-spam-folder "/Gmail/Spam" (user-mail-address "str...@gmail.com") (user-full-name "str str") (mu4e-compose-signature "-- str str str --") (smtpmail-stream-type (quote starttls)) (smtpmail-starttls-credentials (quote (("smtp.gmail.com" 587 nil nil)))) (smtpmail-auth-credentials (quote (("smtp.gmail.com" 587 "str...@gmail.com" nil)))) (smtpmail-default-smtp-server "smtp.gmail.com") (smtpmail-smtp-service 587)))
  (if account-vars (mapc (function (lambda (var) (set (car var) (cadr var)))) account-vars) (error "No email account found"))
  (let* ((account (if mu4e-compose-parent-message (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir))) (string-match "/\\(.*?\\)/" maildir) (match-string 1 maildir)) (completing-read (format "Compose with account: (%s) " (mapconcat (function ...) my-mu4e-account-alist "/")) (mapcar (function (lambda ... ...)) my-mu4e-account-alist) nil t nil nil (caar my-mu4e-account-alist)))) (account-vars (cdr (assoc account my-mu4e-account-alist)))) (if account-vars (mapc (function (lambda (var) (set (car var) (cadr var)))) account-vars) (error "No email account found")))
  my-mu4e-set-account()
  run-hooks(mu4e-compose-pre-hook)
  byte-code("\306\301!\210##\307\301\310\311#\210\312\313!\210\314\315\316\217\210\317 \210\212db\210\n\314#\211#\2039#\f@#\320\321#\322\"\321#\323\"\"\210\fA\211#\204$#+\324
!\210\325\314!\210
\326\235\203N#\327 \210\202Q#\330 \210\306\301!\210##\307\301\310\311#\210\331 \210\332 \207" [original-msg mu4e-compose-parent-message includes att --dolist-tail-- compose-type make-local-variable put permanent-local t run-hooks mu4e-compose-pre-hook nil (mu4e-draft-open compose-type original-msg) ((quit (byte-code "\300 \210\301\302!\210\303\304\305\"\207" [kill-buffer message "[mu4e] Operation aborted" throw --cl-block-mu4e~compose-handler-- nil] 3))) mu4e~draft-insert-mail-header-separator mml-attach-file plist-get :file-name :mime-type mu4e~compose-set-friendly-buffer-name set-buffer-modified-p (new forward) message-goto-to message-goto-body mu4e~compose-hide-headers mu4e-compose-mode] 6)
  mu4e~compose-handler(new)
  mu4e-compose(new)
  mu4e-compose-new()
  call-interactively(mu4e-compose-new nil nil)
  command-execute(mu4e-compose-new)



please find my mu4e config file below:

init-mu4e.el

;; 0xax.blogspot.com/2014/11/emacs-mu4e-offlineimap-multiply-accounts.html
;; vxlabs.com/2014/06/06/configuring-emacs-mu4e-with-nullmailer-offlineimap-and-multiple-identities/
;; www.djcbsoftware.nl/code/mu/mu4e/Multiple-accounts.html

;; interesting settings \ config at https://github.com/mardukbp/dotfiles/blob/master/emacs.d/mb-mu4e.el
(require 'mu4e)
(require 'smtpmail)
(require 'starttls)
;; Default Maildir location and account
;;(setq mu4e-maildir "~/Maildir"
;;      mu4e-sent-folder         "/Gmail/Sent"
;;      mu4e-drafts-folder       "/Gmail/Drafts"
;;      mu4e-trash-folder        "/Gmail/Trash"
;;      mu4e-spam-folder         "/Gmail/Spam"
;;      ;; identification
;;      user-mail-address       "str...@gmail.com"
;;      user-full-name          "Str Str"
;;      mu4e-compose-signature  "Kind regards,\nStr"
      ;; smtp
;;      smtpmail-stream-type 'starttls
;;      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
;;      smtpmail-auth-credentials '(("smtp.gmail.com" 587 "str...@gmail.com" nil))
;;      smtpmail-default-smtp-server "smtp.gmail.com"
;;      smtpmail-smtp-service 587
;;)

(setq
  ;; General
 
  ;; program to get mail, invoked with 'U' in main view
  mu4e-get-mail-command "offlineimap"
  mu4e-update-interval 300

  ;; don't keep message buffers around
  message-kill-buffer-on-exit t

  ;; use 'fancy' non-ascii characters in various places in mu4e
  mu4e-use-fancy-chars t

  ;; save attachments (this can also be a function)
  mu4e-attachment-dir "~/Downloads/attachments"

  ;; don't save message to Sent Mail, Gmail/IMAP handles this
  ;; refer to documentation on mu4e-sent-messages-behaviour for iCloud
  mu4e-sent-messages-behavior 'delete
  
  ;; smtp
  message-send-mail-function 'smtpmail-send-it
  smtpmail-stream-type 'starttls

  ;; insert signature
  mu4-compose-signature-auto-include t
  
  ;; keybindins / shortcuts for frequently used maildirs:
  ;; access them with 'j' ('jump'); i.e. switch to Gmail/INBOX using 'jg'
  mu4e-maildir-shortcuts
      '(("/Gmail/INBOX"        .    ?g)
	("/Gmail/Sent"         .    ?f)
	("/Gmail/Drafts"       .    ?d)
;;	("/Gmail/Spam"         .    ?f)
;;	("/Gmail/Trash"        .    ?a)
	
	("/strGmail/INBOX"    .    ?l)
	("/strGmail/Sent"     .    ?k)
	("/strGmail/Drafts"   .    ?j)
;;	("/strGmail/Spam"     .    ?j)
;;	("/strGmail/Trash"    .    ?t)

	("/iCloud/INBOX"       .    ?i)
	("/iCloud/Sent"        .    ?u)
	("/iCloud/Drafts"      .    ?y)
;;	("/iCloud/Spam"        .    ?u)
;;	("/iCloud/Trash"       .    ?y)
	)
)		

;; Additional customization

;; format date-time stamp in the header list
(setq mu4e-headers-date-format "%d-%m-%Y %H:%M")

;; customise the reply-quote-string
;; M-x find-function RET message-citation-line-format for docs
(setq message-citation-line-format "%N @ %d-%m-%Y %H:M %Z:\n")
(setq message-citation-line-function 'message-insert-formatted-citation-line)

;; show full addresses in view messages (instead of just names), group related and ignore duplicates
(setq mu4e-view-show-addresses t
      mu4e-headers-include-related t
      mu4e-headers-skip-duplicates t)

;; mu4e-action-view-in-browser is built into mu4e
;; by adding it to these lists of custom actions
;; it can be invoked by first pressing a, then selecting
;;(add-to-list 'mu4e-headers-actions
;;      '("in browser" . mu4e-action-view-in-browser) t)
;;(add-to-list 'mu4e-view-actions
;;      '("in browser" . mu4e-action-view-in-browser) t)

;; the headers to show in the headers list -- a pair of a field
;; and its width, with 'nil' meaning 'unlimited'
(setq mu4e-headers-fields
      '( (:date    .   25)
	 (:flags   .    6)
	 (:from    .   22)
	 (:subject .   nil)))
		   
;; attempt to show images when viewing messages
(setq mu4e-view-show-images t)

(when (fboundp 'imagemagick-register-types)
  (imagemagick-register-types))
  
;; external command for html->text conversion
(setq mu4e-view-prefer-html t)
;; (setq mu4e-html2text-command "html2text -utf8 -width 72")
(setq mu4e-html2text-command "html2text")
(setq mail-user-agent 'mu4e-user-agent)

;; Show smileys
(add-hook 'mu4e-view-mode-hook 'smiley-buffer)

;; suppress constant update messages from offlineimap and mu index in minibuffer
(setq mu4e-hide-index-messages t)

;; Description of all accounts, which must be identical to corresponding directory name under ~/Maildir
(defvar my-mu4e-account-alist
  '(("Gmail"
         ;; maildir
         ;;mu4e-maildir "~/Maildir/Gmail"             
         mu4e-sent-folder         "/Gmail/Sent"
	 mu4e-drafts-folder       "/Gmail/Drafts"
	 mu4e-trash-folder        "/Gmail/Trash"
	 mu4e-spam-folder         "/Gmail/Spam"
         ;; identification
         (user-mail-address       "str...@gmail.com")
         (user-full-name          "Str Str")
	 (mu4e-compose-signature  "Kind regards,\n Str")
	 ;; smtp
	 (smtpmail-stream-type 'starttls)
	 (smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
	 (smtpmail-auth-credentials '(("smtp.gmail.com" 587 "str...@gmail.com" nil)))
;;	 (smtpmail-auth-credentials "~/.authinfo.gpg")
	 (smtpmail-default-smtp-server "smtp.gmail.com")
	 (smtpmail-smtp-service 587))
    ("strGmail"
         ;; maildir
         ;;mu4e-maildir "~/Maildir/strGmail"             
         mu4e-sent-folder         "/strGmail/Sent"
	 mu4e-drafts-folder       "/strGmail/Drafts"
	 mu4e-trash-folder        "/strGmail/Trash"
	 mu4e-spam-folder         "/strGmail/Spam"
         ;; identification
         (user-mail-address       "str...@gmail.com")
         (user-full-name          "str str")
	 ;; must add sig file
	 (mu4e-compose-signature  "-- str str str str --")
	 ;; smtp
	 (smtpmail-stream-type 'starttls)
	 (smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
	 (smtpmail-auth-credentials '(("smtp.gmail.com" 587 "str...@gmail.com" nil)))
	 (smtpmail-default-smtp-server "smtp.gmail.com")
	 (smtpmail-smtp-service 587))
     ("iCloud"
         ;; maildir
         ;;mu4e-maildir "~/Maildir/iCloud"             
         mu4e-sent-folder         "/iCloud/Sent"
	 mu4e-drafts-folder       "/iCloud/Drafts"
	 mu4e-trash-folder        "/iCloud/Trash"
	 mu4e-spam-folder         "/iCloud/Junk"
         ;; identification
         (user-mail-address       "str...@icloud.com")
         (user-full-name          "Str Str")
	 (mu4e-compose-signature  "Kind regards,\nStr")
	 ;; smtp
	 (smtpmail-stream-type 'starttls)
	 (smtpmail-starttls-credentials '(("smtp.mail.me.com" 587 nil nil)))
	 (smtpmail-auth-credentials '(("smtp.mail.me.com" 587 "str...@icloud.com" nil)))
	 (smtpmail-default-smtp-server "smtp.mail.me.com")
	 (smtpmail-smtp-service 587))
))	 

;; Function for handling account switching for mail composition
;; my-mu4e-set-account will be called every time you edit a message. When composing a new message will be asked to choose account to send from (TAB completion works)
;; Replying, forwarding, editing an existing draft, account will be chosen automatically based on the first componenet of the maildir (i.e. directory under ~/Maildir)

(defun my-mu4e-set-account ()
  "Set the account for composing a message."
  (let* ((account
          (if mu4e-compose-parent-message
              (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))
                (string-match "/\\(.*?\\)/" maildir)
                (match-string 1 maildir))
            (completing-read (format "Compose with account: (%s) "
                                     (mapconcat #'(lambda (var) (car var))
                                                my-mu4e-account-alist "/"))
                             (mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)
                             nil t nil nil (caar my-mu4e-account-alist))))
         (account-vars (cdr (assoc account my-mu4e-account-alist))))
    (if account-vars
        (mapc #'(lambda (var)
                  (set (car var) (cadr var)))
              account-vars)
      (error "No email account found"))))

(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)

;; Preserve email account of a draft when starting another draft with another account
(defun cpb-make-buffer-local ()
  (make-local-variable 'mu4e-compose-signature)
  (make-local-variable 'user-mail-address)
  (flyspell-mode)
)
;;
(add-hook 'mu4e-compose-mode-hook 'cpb-make-buffer-local)
 
;;(provide 'init-mu4e) 

should I switch over to msmtp? Is there an updated mechanism or procedure for account switching on sending emails?

Thanks in advance,
liny

Dirk-Jan C. Binnema

unread,
Jan 8, 2015, 12:51:36 AM1/8/15
to mu-di...@googlegroups.com

On Wednesday Jan 07 2015, nuk3...@gmail.com wrote:

> HI everyone,
>
> Thank you very much djcb for the excellent blog emacs-fu and of course mu
> and mu4e.

Welcome!

> I'm running arch-linx 64 bit, emacs 24.4.1, mu 0.9.11 and offlineimap 6.5.5.
>
> I've setup offlineimap to authenticate against a .authinfo.gpg file and
> that is working fine. I can fetch mail successfully, however I must
> explicitly invoke mu from either the command line or mu4e-update-index to
> get new mail.
>
> But that's not the major issue, the issue is that I am unfortunately unable
> to send any mail. Even with only a single account active... (i.e. other
> settings commented out)?
>
> Specifically there seems to be something regarding the email witching that
> is expecting mu4e-sent-folder to be a list, when it's a string i.e.
> "/Account1/sent/". I fear that I've made a really stupid and trivial
> mistake in the elisp syntax somewhere, and I'm really sorry to clog the
> mailling list like this. I've scrounged around for a solution on the
> internet, the #emacs, #lisp #erc irc channels and was as yet unfortunately
> unable to comeup with a solution.

Compare your setup below with the one in
http://www.djcbsoftware.nl/code/mu/mu4e/Multiple-accounts.html
in particular, my-mu4e-account-alist.

E.g.

(mu4e-sent-folder "/Account1/Saved Items")
vs
mu4e-sent-folder "/Gmail/Sent"

Cheers,
Dirk.


--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

liny dr

unread,
Jan 8, 2015, 1:48:52 AM1/8/15
to mu-di...@googlegroups.com
Hi Dirk,

Sorry for being such a noob, but I'm not sure I completely understand.

In my offlineimaprc I have name translations for GMail "Sent Mail" and iCloud "Sent Messages" to "Sent" subdir in their respective maildirs. I'm assuming that "Saved Items" is the respective maildir in your configuration...?

Kind regards,
liny


--
You received this message because you are subscribed to a topic in the Google Groups "mu-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mu-discuss/Tet6VeqOUdg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mu-discuss+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

liny dr

unread,
Jan 8, 2015, 1:54:34 AM1/8/15
to mu-di...@googlegroups.com
Ah man,

Sorry for being such a dumbass, still new to elisp syntax, and it's only just dawned on me (clear as day from the debug message) - that mu4e-sent-folder is being assigned it's sent folder and everything that is not encapsulated in the next set braces.

Thank you very much!

Just one last question, I've set the mu4e-hide-index-messages t and mu4e-update-interval 300, however, my minibuffer is still "polluted" with offlineimap messages and I have to manually invoke mu4e-update-index....? Offlineimap fetches the messages alright, but they are however not indexed and available in mu4e without manual intervention.

Thanks again,
liny

nuk3...@gmail.com

unread,
Jan 9, 2015, 2:58:53 PM1/9/15
to mu-di...@googlegroups.com

Hi again Dirk,

Just have a few more things I'd like to clarify:

1) With regards to sending mail, the following two errors pop-up when
trying to send a previously saved draft:

gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly
terminated.

invalid connection type (quote starttls)

2) I still have a slight problem synchronizing the index after
offlineimap has fetched the new mail, I can only see the new mail after
manually running mu4e-update-index, I believe the associate error is:

Error running timer: (error #("[mu4e] Update process is already running"
1 5 (face mu4e-title-face)))

My init-mu4e.el has the following option set:

mu4e-get-mail-command "offlineimap"
mu4e-update-interval 300

3) Lastly, I'm struggling to get smtpmail to recognize my
~/.authinfo.gpg file, I'd imagine it should be easier to switch and
authenticate outgoing emails using that...?

...
(defvar my-mu4e-account-alist
...
("linyGmail"
...
;; smtp
(smtpmail-auth-credentials "~/.authinfo.gpg")
(smtpmail-stream-type 'starttls)
(smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
;;(smtpmail-auth-credentials '(("smtp.gmail.com" 587 "nuk3...@gmail.com" nil)))
;;(smtpmail-default-smtp-server "smtp.gmail.com")
;;(smtpmail-smtp-service 587)
(smtpmail-queue-dir "/home/nuk3/Maildir/linyGmail/queue/cur")
...

The above does not work for me, and ideas why...?

Thanks again,

Sorry for all the hassle.


liny @ 08-01-2015 08:M SAST:

> Ah man,
>
>
>
> Sorry for being such a dumbass, still new to elisp syntax, and it's only just
> dawned on me (clear as day from the debug message) - that mu4e-sent-folder is
> being assigned it's sent folder and everything that is not encapsulated in the
> next set braces.
>
>
>
> Thank you very much!
>
>
>
> Just one last question, I've set the mu4e-hide-index-messages t and mu4e-
> update-interval 300, however, my minibuffer is still "polluted" with
> offlineimap messages and I have to manually invoke mu4e-update-index....?
> Offlineimap fetches the messages alright, but they are however not indexed and
> available in mu4e without manual intervention.
>
>
>
> Thanks again,
>
> liny
>
>
>
> On Thu, Jan 8, 2015 at 8:48 AM, liny dr
> <[nuk3...@gmail.com](mailto:nuk3...@gmail.com)> wrote:
>
>> Hi Dirk,
>
>>
>
>>
>
>>
>
>> Sorry for being such a noob, but I'm not sure I completely understand.
>
>>
>
>>
>
>>
>
>> In my offlineimaprc I have name translations for GMail "Sent Mail" and
> iCloud "Sent Messages" to "Sent" subdir in their respective maildirs. I'm
> assuming that "Saved Items" is the respective maildir in your
> configuration...?
>
>>
>
>>
>
>>
>
>> Kind regards,
>
>>
>
>> liny
>
>>
>
>>
>
>>
>
>> On Thu, Jan 8, 2015 at 7:51 AM, Dirk-Jan C. Binnema
> <[dj...@djcbsoftware.nl](mailto:dj...@djcbsoftware.nl)> wrote:
>
>>
>
>>>
> On Wednesday Jan 07 2015, [nuk3...@gmail.com](mailto:nuk3...@gmail.com)
> [e:dj...@djcbsoftware.nl](mailto:e%3Ad...@djcbsoftware.nl)
> w:[www.djcbsoftware.nl](http://www.djcbsoftware.nl)
> pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
>
>>>
>
>>>
> \--
> You received this message because you are subscribed to a topic in the Google
> Groups "mu-discuss" group.
> To unsubscribe from this topic, visit <https://groups.google.com/d/topic/mu-
> discuss/Tet6VeqOUdg/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to [mu-
> discuss+u...@googlegroups.com](mailto:mu-
> discuss%2Bunsu...@googlegroups.com).
> For more options, visit <https://groups.google.com/d/optout>.
>
>>
>
>>
>
>

--
-- naturally untouchable Killah 3ntity --
Reply all
Reply to author
Forward
0 new messages