summary refs log tree commit diff
diff options
context:
space:
mode:
authornoa@gaiwan.org2024-07-14 23:58:32 +0000
committernoa@gaiwan.org2024-07-14 23:58:32 +0000
commite8b28dd54a0b71e861b2f15a35c182e3aa03cd5c (patch)
tree5c024957f3eb94eda9e152db2daae7fd86146a09
parent4be5d593f32ed6f95d715903ef501cf7311c10cf (diff)
Overhaul email configuration
-rw-r--r--config.org181
1 files changed, 16 insertions, 165 deletions
diff --git a/config.org b/config.org
index 30673f0..fbf0701 100644
--- a/config.org
+++ b/config.org
@@ -1771,132 +1771,13 @@ Not quite.  The keys that auth-source expects don't quite align with the keys th
 I don't use magit.  I tried it once, but my use of version control is very limited to just making some changes and then committing them.  I don't work in programming and my projects are simple.
 
 * Email
-I like to have my email offline.  Of course my preference is also to have it inside of emacs for consistency with everything else.  Currently i use mu4e as my mail user agent, which relies on an external tool.  I also use two small command line programs to download and send mail.
+I like to have my email offline.  Of course my preference is also to have it inside of emacs for consistency with everything else.  I use some external tools to fetch and send the mail.
 
 #+begin_src sh :tangle no
-  sudo apt install maildir-utils isync msmtp
-  #+end_src
-
-** Fetching mail with mbsync
-Mbsync is downloaded with the isync package.  The configuration is not complicated.
-
-I use fastmail to host my email.
-
-#+begin_src text :tangle no
-  IMAPAccount fastmail
-  Host imap.fastmail.com
-  User noa@gaiwan.org
- #+end_src
-
-The ~passcmd~ is run to fetch my password.  I should put this into pass, but this isn't an ordinary password.  It's an app password, and needs to be updated on every new system.
-
-#+begin_src text :tangle no
-  PassCmd "cat ~/.config/mbsync-pass"
-#+end_src
-
-#+begin_src conf-unix :tangle no
-  SSLType IMAPS
-
-  IMAPStore fastmail-remote
-  Account fastmail
-
-  MaildirStore fastmail-local
-  SubFolders Verbatim
-  Path "~/mail/"
-  Inbox "~/mail/Inbox"
-
-  Channel fastmail
-  Far :fastmail-remote:
-  Near :fastmail-local:
-  Patterns *
-  Create Near
-  Expunge Near
-  SyncState *
-  CopyArrivalDate yes
-#+end_src
-
-** Reading mail with mu4e
-
-  #+begin_src elisp
-    (setopt mu4e-headers-skip-duplicates t)
-    (setopt mu4e-view-show-images t)
-    (setopt mu4e-view-show-addresses t)
-#+end_src
-
-In theory i like format flowed, but what i like even more is just not hard wrapping messages and dealing with hacks to get around that to begin with.  If software supported soft wrapping at an arbitrary column, the world would be a better place.
-
-#+begin_src elisp
-(setopt mu4e-compose-format-flowed nil)
-(setopt mu4e-change-filenames-when-moving t)
-(setopt mu4e-use-fancy-chars nil)
-(setopt mu4e-confirm-quit nil)
-(setopt mu4e-headers-leave-behavior 'apply)
-(setopt mu4e-headers-precise-alignment t)
-(setopt mu4e-headers-fields '((:flags . 6)
-                              (:from . 32)
-                              (:subject)))
-(setopt mu4e-search-threads nil)
-(setopt mu4e-hide-index-messages t)
-(setopt mu4e-get-mail-command "mbsync -c ~/.config/mbsyncrc fastmail")
-(setopt mu4e-maildir "~/mail")
-(setopt mu4e-drafts-folder "/Drafts")
-(setopt mu4e-sent-folder   "/Sent")
-(setopt mu4e-refile-folder "/Archive")
-(setopt mu4e-trash-folder  "/Trash")
-(setopt mu4e-bookmarks '((:name "Inbox" :query "maildir:/Inbox" :key ?i)
-                         (:name "Feeds" :query "maildir:/Feeds" :key ?f)
-                         (:name "Paper trail" :query "\"maildir:/Paper trail\"" :key ?p)))
-#+end_src
-
-function to move mails to trash
-
-#+begin_src elisp
-(with-eval-after-load 'mu4e
-  (bind-key (kbd "d") #'noa/move-to-trash 'mu4e-headers-mode-map)
-  (bind-key (kbd "d") #'noa/move-to-trash 'mu4e-view-mode-map)
-  (fset 'noa/move-to-trash "mTrash"))
-#+end_src
-
-The first string is for when fancy characters are disabled, and the second is for when they are enabled.  But i set them all manually because some of the other characters are ugly in fancy mode, but i like my unicode thread icons.
-
-#+begin_src elisp
-(setq mu4e-headers-thread-connection-prefix '("│ " . "│ ")
-      mu4e-headers-thread-last-child-prefix '("└ " . "└ ")
-      mu4e-headers-thread-blank-prefix '("  " . "  ")
-      mu4e-headers-thread-root-prefix '("□ " . "□ ")
-      mu4e-headers-thread-child-prefix '("│ " . "│ ")
-      mu4e-headers-thread-orphan-prefix '("♢ " . "♢ ")
-      mu4e-headers-thread-duplicate-prefix '("≡ " . "≡ ")
-      mu4e-headers-thread-first-child-prefix '("⚬ " . "⚬ ")
-      mu4e-headers-thread-single-orphan-prefix '("♢ " . "♢ "))
-#+end_src
-
-Setting this to nil stops auto-fill from being automatically enabled in message buffers.
-
-#+begin_src elisp
-(setopt message-fill-column nil)
+  sudo apt install mpop msmtp
 #+end_src
 
-It's nice to have a message signature.  I want the signature to be loaded from a file, which is store in my configuration directory.
-
-#+begin_src elisp
-  (setopt message-signature t)
-  (setopt message-signature-file "~/.config/signature")
-#+end_src
-
-The contents of the signature file is listed below.   Currently i only have two bullet points, when i think three would look nicer, but i don't have three things to say.
-
-#+begin_src text :tangle ~/.config/signature
-  ~noa (https://noa.pub)
-   • I try to reply to formal emails in three sentences or fewer; excuse my brevity.
-   • I queue replies and batch send them at intervals; excuse my untimeliness.
-#+end_src
-
-#+begin_src elisp
-(add-hook 'mu4e-view-mode-hook #'visual-line-fill-column-mode)
-#+end_src
-
-** Fetching mail with mpop
+** Fetching mail
 #+begin_src conf-unix :tangle ~/.config/mpop/config
   defaults
   tls on
@@ -1919,7 +1800,7 @@ The contents of the signature file is listed below.   Currently i only have two
   passwordeval "cat ~/.mpop-pass"
 #+end_src
 
-** Reading mail with rmail
+** Reading mail
 I have experimented with lots of different methods of reading mail, both in and out of emacs.  But i keep coming back to rmail, despite its many, many warts.
 
 #+begin_src elisp
@@ -1951,56 +1832,26 @@ I have experimented with lots of different methods of reading mail, both in and
   (setopt message-default-headers #'noa/message-default-headers)
 #+end_src
 
+** Composing mail
+Setting this to nil stops auto-fill from being automatically enabled in message buffers.
+
 #+begin_src elisp
-  (setopt mairix-file-path "~/data/mail/mairix/")
-  (setopt mairix-search-file "search.mbox")
+  (setopt message-fill-column nil)
 #+end_src
 
-** Composing mail from an org buffer
-As i keep mentioning, i have a big org file which i put everything into.  This includes interesting web articles, which i will paraphrase or quote.  However, this does not include mail, because mail is a bit of a beast.
-
-I have written this function as the first step in bridging that gap.  I can compose an email in org, via an org-capture template that will prompt me for a recipient and subject.  Then i can send the subtree to the mail buffer.
-
-At the moment, i am still recording sent mail in the outbox directory of my mail directory.  This is because at the moment i don't have a way to move whole emails from rmail to org (although i think there are ways to do that, and i have added the in_reply_to header for the future).
+It's nice to have a message signature.  I want the signature to be loaded from a file, which is stored in my configuration directory.
 
 #+begin_src elisp
-  (defun noa/org-mail-subtree ()
-    "Prepare a mail buffer to send the current subtree as an email.  Respects the headline properties MAIL_SUBJECT MAIL_TO MAIL_CC MAIL_BCC MAIL_FROM."
-    (interactive)
-    (save-excursion
-      (let* ((subject (org-entry-get nil "MAIL_SUBJECT" nil))
-             (to (org-entry-get nil "MAIL_TO" nil))
-             (from (org-entry-get nil "MAIL_FROM"))
-             (cc (org-entry-get nil "MAIL_CC" nil))
-             (bcc (org-entry-get nil "MAIL_BCC" nil))
-             (in-reply-to (org-entry-get nil "MAIL_IN_REPLY_TO" nil))
-             (other-headers (list (cons "Cc" cc)
-                                  (cons "Bcc" bcc)
-                                  (cons "From" from )
-                                  (cons "In-Reply-To" in-reply-to)))
-             (body (save-restriction (org-narrow-to-subtree)
-                                     (beginning-of-buffer)
-                                     (search-forward-regexp ":END:\n*")
-                                     (buffer-substring (point) (point-max)))))
-        (compose-mail to subject other-headers)
-        (message-goto-body)
-        (insert body))
-      (message-goto-to)))
-#+end_src
-
-#+begin_src elisp
-  (defun noa/org-compose-mail ()
-    "Launch an org buffer to compose a mail."
-    (interactive)
-    (org-capture nil "m"))
+  (setopt message-signature t)
+  (setopt message-signature-file "~/.config/signature")
+#+end_src
 
-  (defun noa/org-todo-reply-mail ()
-    "Capture the current mail as a todo ready to be replied to."
-    (interactive)
-    (org-capture nil "r"))
+#+begin_src text :tangle ~/.config/signature
+  ~noa (https://noa.pub)
+  I queue replies and batch send them at intervals; excuse my untimeliness.
 #+end_src
 
-** Sending mail with msmtp
+** Sending mail
 #+begin_src elisp
   (setopt message-send-mail-function 'message-send-mail-with-sendmail)
   (add-to-list 'exec-path "/home/noa/.config/Scripts")