unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Vivishek Sudhir <vivishek.sudhir@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: gnus unable to login to gmail intermittently
Date: Sat, 25 Nov 2017 10:57:19 -0800 (PST)	[thread overview]
Message-ID: <ca3dadd8-ed2a-4efc-b105-be5e10055e78@googlegroups.com> (raw)

Hi,

I've been using gnus to fetch/reply-to emails on my gmail via gnus' in-built nniamp backend. The minimal working configuration (in my init.el) is as follows:

(use-package gnus
    :config
    (require 'nnir) ; for searching through imap

    (require 'epa-file) ; to be able to code/decode gpg files in emacs
    (epa-file-enable)
    (setq epa-pinentry-mode 'loopback
	     epa-file-cache-passphrase-for-symmetric-encryption t)

    (require 'auth-source) ; setup gpg file access
    (setq auth-sources '((:source "./authinfo.gpg"))) ; this is where to find the login details

    ; set gmail as the primary source of incoming mail
    (setq gnus-select-method
	  '(nnimap "gmail"
		   (nnimap-address "imap.gmail.com")
		   (nnimap-server-port 993)
		   (nnimap-stream ssl)
		   (nnir-search-engine imap)
		   )
	  ; ensure gnus doesnt ignore gmail folders
	  gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\”]\”[#’()]"
	  ; mark all sent messages as read
	  gnus-gcc-mark-as-read t 
	  )

    ; configure sending email via gmail smtp, with starttls encryption
    (setq message-send-mail-function 'smtpmail-send-it
	  smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
	  smtpmail-auth-credentials '(("smtp.gmail.com" 587 "myemail@gmail.com" nil))
	  smtpmail-default-smtp-server "smtp.gmail.com"
	  smtpmail-smtp-server "smtp.gmail.com"
	  smtpmail-smtp-service 587
	  starttls-use-gnutls t)

      ; cache emails
    (setq message-directory "~/gmail"
	  gnus-use-cache t
	  gnus-cache-directory "~/gmail/cache"
	  gnus-cache-enter-articles '(ticked dormant read unread)
	  gnus-cache-remove-articles nil
	  gnus-cacheable-groups "^nnimap"
	  gnus-keep-backlog 200
	  )

    ; set gnus parameters
    (setq gnus-parameters
      '((".*"
	 (gnus-use-scoring nil)
	 (expiry-wait . 2)
	 (display . all)
	 )))
    ; retrieve 100 newest messages from all groups by default
    ; (setq gnus-parameter-large-newsgroup-initial-alist ((".*" . 100)))
    (setq gnus-large-newsgroup 100)
  )

There is also some buffer formatting settings I've omitted in the above. 

Essentially, the file authinfo.gpg contains my login credentials for gmail's imap and smtp servers, which is read by gnus to log in to fetch/reply-to emails. 

The problem is that *sometimes* when I start gnus, things work perfectly; but about 3 out of 5 times, it would get stuck and show something like "IMAP user at gmail (default <myemail>):" on the minibuffer, and if I do RET, it would ask for my password. It seems that on these occasions, gnus doesn't read the authinfo.gpg file, and falls back to asking me for the login credentials.

Why is this happening, and how can this be solved?

Thanks.


             reply	other threads:[~2017-11-25 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-25 18:57 Vivishek Sudhir [this message]
2017-11-25 19:50 ` gnus unable to login to gmail intermittently Emanuel Berg
     [not found] ` <mailman.4529.1511639479.27995.help-gnu-emacs@gnu.org>
2017-11-25 21:16   ` Vivishek Sudhir
2017-11-25 21:37     ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca3dadd8-ed2a-4efc-b105-be5e10055e78@googlegroups.com \
    --to=vivishek.sudhir@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).