reading-my-email-on-the-hurd.html 5.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>Reading my email on the Hurd — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>Reading my email on the Hurd</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — July 11, 2022</h3><div><p>;tldr The video of all of this blog post is available here:</p><p><a href="https://video.hardlimit.com/w/18NHmZA5sNEgVrZhoq7xna">https://video.hardlimit.com/w/18NHmZA5sNEgVrZhoq7xna</a></p><p>So recently I re-set up my Emacs to send email. I usually use Emacs’ Gnus
  2. mode for reading mailing lists. I have yet to find a better tool to process the
  3. sheer amount of email that mailing lists through at you. Gnus is cool, but
  4. it’s also a Turing tarpit (that’s another blog post).</p><p>So, if you dear reader want to check your mailing lists via Emacs’ Gnus in a
  5. Hurd vm, here’s what you want to do:</p><pre><code>$ wget https://cdimage.debian.org/cdimage/ports/latest/hurd-i386/debian-hurd.img.tar.gz
  6. $ tar -xz &lt; debian-hurd.img.tar.gz</code></pre><p>Modify my command to start your Hurd vm to your liking:</p><pre><code>qemu-system-i386 -m 4G \
  7. -drive format=raw,cache=writeback,file=./debian-hurd-20220331.img \
  8. -net user,hostfwd=tcp:127.0.0.1:2222-:22 -net nic,model=e1000 \
  9. -no-reboot --enable-kvm</code></pre><p>Now that you have the Hurd running in a vm, install emacs and msmtp!</p><pre><code>sudo apt-get install emacs msmtp</code></pre><p>Configure msmtp: <a href="https://wiki.archlinux.org/title/Msmtp">https://wiki.archlinux.org/title/Msmtp</a></p><p>That means put in this inside your ~/.msmtprc. Change the values to what you
  10. need. Check the wiki link above. The arch wiki is awesome!</p><pre><code># Example for a user configuration file ~/.msmtprc
  11. #
  12. # Set default values for all following accounts.
  13. defaults
  14. # Use the mail submission port 587 instead of the SMTP port 25.
  15. port 587
  16. # Always use TLS.
  17. tls on
  18. # Set a list of trusted CAs for TLS. The default is to use system settings, but
  19. # you can select your own file.
  20. tls_trust_file /etc/ssl/certs/ca-certificates.crt
  21. logfile ~/.msmtp.log
  22. # A dismail account
  23. account dismail.de
  24. # Host name of the SMTP server
  25. host smtp.dismail.de
  26. # Envelope-from address
  27. from jbranso@dismail.de
  28. # Authentication. The password is given using one of five methods, see below.
  29. auth on
  30. user jbranso@dismail.de
  31. # Password method 3: Store the password directly in this file. Usually it is not
  32. # a good idea to store passwords in plain text files. If you do it anyway, at
  33. # least make sure that this file can only be read by yourself.
  34. password ReallyAwesomePassword!
  35. # Set a default account
  36. account default : dismail.de
  37. sudo chmod og-rwx ~/.msmtprc</code></pre><p>Now you can test make sure that you can send email via msmtp. Check the
  38. archlinux wiki page for how to test to see if msmtp works.</p><p>Now decide where you want your emacs init file: “~/.emacs” or
  39. “~/.emacs.d/init.el”.</p><pre><code>mkdir ~/.emacs.d
  40. emacs ~/.emacs.d/init.el</code></pre><p>And you will put this into your emacs:</p><pre><code>;; Some functionality uses this to identify you, e.g. GPG configuration, email
  41. ;; clients, file templates and snippets.
  42. (setq user-full-name &quot;Joshua Branson&quot;
  43. user-mail-address &quot;jbranso@dismail.de&quot;)
  44. ;; gmail is &quot;imap.dismail.de&quot;
  45. ;; fastmail.com is a great paid email solution!
  46. (setq gnus-select-method '(nnimap &quot;imap.dismail.de&quot;))
  47. ;; use msmtp
  48. ;; from the emacs wiki: https://www.emacswiki.org/emacs/GnusMSMTP
  49. (setq message-send-mail-function 'message-send-mail-with-sendmail)
  50. ;; we substitute sendmail with msmtp
  51. (setq sendmail-program &quot;/usr/bin/msmtp&quot;)
  52. ;; This is needed to allow msmtp to do its magic:
  53. (setq message-sendmail-f-is-evil 't)
  54. ;;need to tell msmtp which account we're using
  55. (setq message-sendmail-extra-arguments '(&quot;--read-envelope-from&quot;))
  56. ;; This is optional, but highly reccommended.
  57. ;; save email replies to my Sent folder
  58. (setq gnus-posting-styles
  59. `((&quot;.*&quot;
  60. ;; between the &quot;+&quot; and the &quot;:&quot; put the string for
  61. ;; gnus-select-method
  62. (gcc &quot;\&quot;nnimap+imap.dismail.de:Sent\&quot;&quot;)
  63. ;; I use this next line for my dismail filter to mark as read archived messages
  64. ;; that gnus sends to my Sent folder.
  65. ;; this next line is optional. You may delete it.
  66. (&quot;X-Gnus-Sucks&quot; &quot;I know man&quot;)
  67. )))</code></pre><p>Restart Emacs, and <code>M-x m</code> your first email!</p><p><code>M-x Gnus</code> starts Gnus for the first time. You might need to read the manual or
  68. check out a youtube video online to help you set up Gnus for the first time.</p></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>