View Single Post
Posts: 368 | Thanked: 975 times | Joined on Aug 2013
#31
Today I've set up emacs to receive email (with gnus) on my N900. Here' s what I did. It is pretty straightforward.
This thread seems to be the most appropriate to add this info but no problem to create a separate thread if that is preferred.

Source

Code:
Put the following in ~/.profile :

export EMAIL="<EMAIL_ADDRESS>"
export NAME="<FULL NAME>"
export SMTPSERVER="smtp.gmail.com"

For example, if your name is John Smith and your email address is johnsmith@gmail.com:

export EMAIL="johnsmith@gmail.com"
export NAME="John Smith"
export SMTPSERVER="smtp.gmail.com"

Now put the following in your ~/.gnus file:

(setq gnus-select-method
      '(nnimap "gmail"
	       (nnimap-address "imap.gmail.com")  ; it could also be imap.googlemail.com if that's your server.
	       (nnimap-server-port "imaps")
	       (nnimap-stream ssl)))

(setq smtpmail-smtp-service 587
      gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

Put the following in your ~/.authinfo file, replacing <USER> with your email address and replacing <PASSWORD> with your password—or your application-specific password:

machine imap.gmail.com login <USER> password <PASSWORD> port imaps
machine smtp.gmail.com login <USER> password <PASSWORD> port 587
You need to change your gmail account / settings to enable IMAP:



You also need to adjust your gmail account to enable accept connecting with "Less secure apps" link

After that you should be able to read Gmail with Emacs on your N900. Just start it with M-x gnus

Additional links that might be useful.

Default gnus only shows unread mail - method to enable showing read mail link

Practical guide to use Gnus with Gmail

I haven' t been able to send email yet, but receiving it works fine. Will update this post once I made it work or have other info that might be helpful.

[edit]

update: sending email is possible with Emacs by first installing gnutls-bin from the repo and after that add below to the .gnus file.


Code:
setq smtpmail-smtp-service 587
      smtpmail-smtp-server "smtp.gmail.com"
      message-send-mail-function 'smtpmail-send-it
      starttls-extra-arguments nil
      starttls-gnutls-program "/usr/bin/gnutls-cli"
      starttls-extra-arguments nil
      starttls-use-gnutls t
      gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")

(with-eval-after-load 'gnus-group
  (gnus-group-list-all-groups 5))

Last edited by t-b; 2016-09-25 at 19:06.
 

The Following 4 Users Say Thank You to t-b For This Useful Post: