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>)
  funcall-interactively(message-send-and-exit nil)
  call-interactively(message-send-and-exit nil nil)

Relevant configs:

(setq mu4e-contexts
            :name "me"
            (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")))

            :name "uni"
            (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
  (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.

  • Why are you using gmail as your smtp server for your university email? – phils Jun 13 '20 at 12:10
  • @phils Our university email runs on Google Suite, so we are essentially using gmail's servers. – ath0 Jun 14 '20 at 16:12
  • I think that your smtp configuration should be specific for each context that you have defined. In my gmail mu3e-context config I have all of these variables defined: smtpmail-starttls-credentials, smtpmail-smtp-user, smtpmail-stream-type, smtpmail-default-smtp-server, smtpmail-smtp-server and smtpmail-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

Your Answer

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

Browse other questions tagged or ask your own question.