{"id":49,"date":"2008-06-07T12:12:00","date_gmt":"2008-06-07T12:12:00","guid":{"rendered":"https:\/\/knielsen-hq.org\/w\/?p=49"},"modified":"2021-09-01T06:53:32","modified_gmt":"2021-09-01T06:53:32","slug":"using-gmail-from-gnus-on-ubuntu-hardy","status":"publish","type":"post","link":"https:\/\/knielsen-hq.org\/w\/using-gmail-from-gnus-on-ubuntu-hardy\/","title":{"rendered":"Using GMail from Gnus on Ubuntu Hardy"},"content":{"rendered":"\n<p>I have used GNUS (Emacs news\/mail reader) to read mail for ages, so I wanted to use it to access my GMail account as well.<\/p>\n\n\n\n<p>I managed to get it to work on my Ubuntu Hardy installation, though not without some hacking (I did not spend that long looking for a cleaner way).<\/p>\n\n\n\n<p>GMail supports both POP and SMTP, so that is the basics for getting it to work, but the problem is that TLS\/SSL is required for both and getting that configured in Gnus was a bit tricky for me. But I got it working in the following way:<\/p>\n\n\n\n<ol><li><code>sudo apt-get install gnutls-bin gnutls-doc starttls<\/code><\/li><li>The <code>smtpmail.el<\/code> included in emacs21 does not handle TLS (and the <code>gnus<\/code> package depends on emacs21, did not check if gnus is available for emacs22 in Ubuntu Hardy). But Gnus comes with another <code>smtpmail.el<\/code> which does support TLS, so I copied that into my load path instead (<code>\/usr\/share\/doc\/gnus\/contrib\/smtpmail.el.gz<\/code>).<\/li><li>I had to hack this small patch into <code>smtpmail.el<\/code> to get it to use STARTTLS, not sure what the real problem is here:<br><code>&nbsp;&nbsp;&nbsp;&nbsp;--- smtpmail.el 2008\/06\/06 18:12:50 1.1<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;+++ smtpmail.el 2008\/06\/06 18:13:15 1.2<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;@@ -472,7 +472,7 @@<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let ((cred (smtpmail-find-credentials<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpmail-starttls-credentials&nbsp;host&nbsp;port)))<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if (null (and cred (condition-case ()<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(with-no-warnings<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(progn<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(require&nbsp;'starttls)<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(call-process&nbsp;(if&nbsp;starttls-use-gnutls<\/code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;starttls-gnutls-program<\/code><\/li><li>Configure pop and smtpmail in .emacs:<br><code>(setq&nbsp;gnus-secondary-select-methods&nbsp;'((nnml&nbsp;\"\")))<\/code>\n<br><code>(setq&nbsp;mail-sources<\/code>\n<br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'(&nbsp;(pop&nbsp;:server&nbsp;\"pop.gmail.com\"&nbsp;:port&nbsp;995&nbsp;:user&nbsp;\"XXX@gmail.com\"&nbsp;:stream&nbsp;ssl)<\/code>\n<br><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;))<\/code>\n<br><code>(setq&nbsp;nnmail-pop-password-required&nbsp;t)<\/code>\n<br><code>(setq&nbsp;smtpmail-smtp-server&nbsp;\"smtp.gmail.com\")<\/code>\n<br><code>(setq&nbsp;smtpmail-smtp-service&nbsp;587)<\/code>\n<br><code>(setq&nbsp;smtpmail-local-domain&nbsp;nil)<\/code>\n<br><code>(setq&nbsp;smtpmail-auth-credentials&nbsp;'((\"smtp.gmail.com\"&nbsp;587&nbsp;\"XXX@gmail.com\"&nbsp;nil)))<\/code>\n<br><code>(setq&nbsp;smtpmail-starttls-credentials&nbsp;'((\"smtp.gmail.com\"&nbsp;587&nbsp;nil&nbsp;nil)))<\/code>\n<br><code>(setq&nbsp;send-mail-function&nbsp;'smtpmail-send-it)<\/code>\n<br><code>(setq&nbsp;smtpmail-default-smtp-server&nbsp;\"smtp.gmail.com\")<\/code>\n<br><code>(setq&nbsp;smtpmail-debug-info&nbsp;t)<\/code>\n<br><code>(setq&nbsp;message-send-mail-function&nbsp;'smtpmail-send-it)<\/code><\/li><\/ol>\n\n\n\n<p>So a bit of a pain, but I got it to work (and I am <em>really<\/em> used to Gnus by now and would hate to switch to something else).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have used GNUS (Emacs news\/mail reader) to read mail for ages, so I wanted to use it to access my GMail account as well. I managed to get it to work on my Ubuntu Hardy installation, though not without some hacking (I did not spend that long looking for a cleaner way). GMail supports&hellip; <a class=\"more-link\" href=\"https:\/\/knielsen-hq.org\/w\/using-gmail-from-gnus-on-ubuntu-hardy\/\">Continue reading <span class=\"screen-reader-text\">Using GMail from Gnus on Ubuntu Hardy<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[14,11,15],"_links":{"self":[{"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/posts\/49"}],"collection":[{"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":3,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":53,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/posts\/49\/revisions\/53"}],"wp:attachment":[{"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/knielsen-hq.org\/w\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}