I have set up email in emacs using mu4e for both my personal and university account (both use gmail).
However I am unable to send email from my university account. Personal account works totally fine. When I try to send a mail from my uni account I get a wrong type argument error. Here's the backtrace:
Debugger entered--Lisp error: (wrong-type-argument characterp lambda)
smtpmail-try-auth-method(#<process smtpmail> plain "university@uni.edu" (lambda (&rest --cl-rest--) (apply (quote #[(G4 G5) "J\203 \211J J!L\210) J\207" [G4 G5 v] 4]) (quote --token-decoder--) (quote --lexv--) --cl-rest--)))
smtpmail-try-auth-methods(#<process smtpmail> (enhancedstatuscodes (auth login plain xoauth2 plain-clienttoken oauthbearer xoauth) 8bitmime (size \35882577)) "smtp.gmail.com" 587 nil)
smtpmail-via-smtp(("personal@gmail.com") #<buffer smtpmail temp>)
smtpmail-send-it()
message-multi-smtp-send-mail()
message-send-mail(nil)
message-send-via-mail(nil)
message-send(nil)
message-send-and-exit(nil)
funcall-interactively(message-send-and-exit nil)
call-interactively(message-send-and-exit nil nil)
command-execute(message-send-and-exit)
Relevant configs:
...
(setq mu4e-contexts
`(,(make-mu4e-context
:name "me"
:match-func
(lambda (msg) (when msg
(string-prefix-p "/Gmail" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . "personal@gmail.com")
(smtpmail-smtp-user . "personal@gmail.com")
(user-full-name . "Atharva Raykar")
(mu4e-trash-folder . "/gmail/[Gmail]/Trash")
(mu4e-drafts-folder . "/gmail/[Gmail]/Drafts")
(mu4e-sent-folder . "/gmail/[Gmail].Sent Mail")
(mu4e-refile-folder . "/gmail/[Gmail]/Archive")))
,(make-mu4e-context
:name "uni"
:match-func
(lambda (msg) (when msg
(string-prefix-p "/uni" (mu4e-message-field msg :maildir))))
:vars `((user-mail-address . "university@uni.edu")
(smtpmail-smtp-user . "university@uni.edu")
(user-full-name . "University")
(mu4e-trash-folder . "/uni/[uni]/Trash")
(mu4e-drafts-folder . "/uni/[uni]/Drafts")
(mu4e-sent-folder . "/uni/[uni].Sent Mail")
(mu4e-refile-folder . "/uni/[uni]/Archive")))))
(use-package smtpmail
:ensure t
:config
(setq message-send-mail-function 'smtpmail-send-it
starttls-use-gnutls t
smtpmail-debug-info t
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587)
;; don't keep message buffers around
(setq message-kill-buffer-on-exit t))
My ~/.authinfo
:
machine smtp.gmail.com login personal@gmail.com port 587 password <personalpassword>
machine smtp.gmail.com login university@uni.edu port 587 password <unipassword>
From what I can tell smtp is taking a lambda instead of a character, but I have not found anything in my config that could possibly lead to that.
Any help would be appreciated.
smtpmail-starttls-credentials
,smtpmail-smtp-user
,smtpmail-stream-type
,smtpmail-default-smtp-server
,smtpmail-smtp-server
andsmtpmail-smtp-service
. I'd also suggest that you completely comment your personal account/remove that line from authinfo.gpg and see if the work email then works. – Ajned Aug 5 '20 at 16:14