2

I'm trying to use mu4e to send/receive email with my Gmail account. I've followed what I believe is the official documentation here, but I think some of the description here seems outdated. As far as receiving mail goes, everything's fine - I'm using offlineimap and an app password from Google (which is saved in an encrypted file).

Sending mail is a problem - I write my message and hit ^C ^C, and am then prompted for an smtp username and password.

Here is the template that I'm using in my init.el:


(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it
   starttls-use-gnutls t
   smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
   smtpmail-auth-credentials
     '(("smtp.gmail.com" 587 "USERNAME@gmail.com" nil))
   smtpmail-default-smtp-server "smtp.gmail.com"
   smtpmail-smtp-server "smtp.gmail.com"
   smtpmail-smtp-service 587)

which is from the standard Gmail template with USERNAME appropriately changed.

I want to keep this setup relatively simple and I've seen other issues with more complicated arrangements that I want to avoid to begin with.

It does seem to me that I need a password of some kind -- how do I set this up (and why isn't this mentioned in this standard template?!). I played around with gnus before, is the simplest solution getting another app password and saving it to some auth.gpg file?

nonreligious
  • 473
  • 2
  • 14

1 Answers1

3

In the end, I created another app password from my google account and stored it in .authinfo.gpg, which is formatted as per the Gnus Gmail instructions

machine smtp.gmail.com login <USER> password <APP-PASSWORD> port 587

To get this to work, I added

   smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg") 

into the smtpmail config block shown in my initial question.

There may be something more convenient (I now have to separate app passwords for offlineimap and for smtpmail) but I'll figure that out as I go along.

nonreligious
  • 473
  • 2
  • 14