Extract email addresses

The configuration files expect email addresses (I store passwords and
other encrypted information elsewhere).  These email addresses are
hardly private, but I figured I would annoy any screenscraping
spam-inducing crawlers out there, while still allowing others to
follow my lead on configuring Emacs and Email.
This commit is contained in:
Howard Abrams 2021-12-01 11:04:02 -08:00
parent c295a915a4
commit d756049f90
3 changed files with 106 additions and 68 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@
/ha-work.org /ha-work.org
/elisp/gourmet-projects.el /elisp/gourmet-projects.el
/ha-private.org /ha-private.org
/incubate.org

View file

@ -853,6 +853,7 @@ Build the hydra as well as configure the =perspective= project.
("9" (persp-switch-by-number 9)) ("9" (persp-switch-by-number 9))
("0" (persp-switch-by-number 0)) ("0" (persp-switch-by-number 0))
("n" ha-project-persp) ("n" ha-project-persp)
("N" ha-new-persp)
("]" persp-next :color pink) ("]" persp-next :color pink)
("[" persp-prev :color pink) ("[" persp-prev :color pink)
("r" persp-rename) ("r" persp-rename)
@ -959,6 +960,17 @@ Displaying a few files? Well, when /starting/ I am only showing one or two files
(split-window-horizontally) (split-window-horizontally)
(ha--project-show-files root more)))) (ha--project-show-files root more))))
#+END_SRC #+END_SRC
The =persp-switch= allows me to select or create a new project, but what if we insisted on a new workspace?
#+BEGIN_SRC emacs-lisp
(defun ha-new-persp (name)
(interactive "sNew Workspace: ")
(persp-switch name)
(cond
((s-ends-with? "mail" name) (notmuch))
((s-starts-with? "twit" name) (twit))))
#+END_SRC
Once we create the new perspective workspace, if it matches a particular name, I pretty much know what function I would like to call.
* Applications * Applications
Can we really call these /applications/? Can we really call these /applications/?
** Magit ** Magit

View file

@ -33,7 +33,33 @@ Next type ~s~ to view and organize mail I've never seen before. We need to keep
- ~S~ :: spam ... so much goes here - ~S~ :: spam ... so much goes here
- ~P~ :: receipts go to this *Paper Trail*, which takes a *tag* as the name of the store - ~P~ :: receipts go to this *Paper Trail*, which takes a *tag* as the name of the store
- ~f~ :: mailing lists and other things that might be nice to read go to *The Feed* - ~f~ :: mailing lists and other things that might be nice to read go to *The Feed*
** Email Addresses
The configuration files below expect email addresses (I store passwords and other encrypted information elsewhere). These email addresses are /hardly/ private, but I figured I would annoy any screenscraping spam-inducing crawlers out there, while still allowing others to follow my lead on configuring Emacs and Email.
#+NAME: email-address-1
#+BEGIN_SRC emacs-lisp :exports none :tangle no :results silent
(rot13-string "ubjneq.noenzf@tznvy.pbz")
#+END_SRC
#+NAME: email-address-2
#+BEGIN_SRC emacs-lisp :exports none :tangle no :results silent
(rot13-string "ubjneq@ubjneqnoenzf.pbz")
#+END_SRC
#+NAME: email-address-3
#+BEGIN_SRC emacs-lisp :exports none :tangle no :results silent
(rot13-string "ubjneq@shmmlgbnfg.pbz")
#+END_SRC
To use these, we set the =:noweb yes= (to pull in the /name/ of the code block) but put a pair of parens after the name to have it evaluated. For instance:
#+begin_example
,#+begin_src conf :noweb yes :tangle /tmp/foobar.txt :results silent
some-address: <<email-address-2()>>
,#+end_src
#+end_example
* Installation and Basic Configuration * Installation and Basic Configuration
To begin, we need the code. On Ubuntu, this is: To begin, we need the code. On Ubuntu, this is:
#+BEGIN_SRC shell :tangle no #+BEGIN_SRC shell :tangle no
@ -124,81 +150,79 @@ Currently, I have a couple of Google Mail accounts that I want connected.
The file generally can have a =Pass= entry for the encrypted passcode, but in order to demonstrate how to connect to multiple accounts, I'm using a GPG daemon: The file generally can have a =Pass= entry for the encrypted passcode, but in order to demonstrate how to connect to multiple accounts, I'm using a GPG daemon:
#+BEGIN_SRC conf-unix :tangle ~/.mbsyncrc #+BEGIN_SRC conf :tangle ~/.mbsyncrc :noweb yes
# Note: We now tangle this file from ~/other/hamacs/ha-email.org # Note: We now tangle this file from ~/other/hamacs/ha-email.org
Create Both Create Both
SyncState * SyncState *
MaxMessages 300 MaxMessages 300
Sync All # New ReNew Flags Sync All # New ReNew Flags
# PERSONAL ACCOUNT # PERSONAL ACCOUNT
IMAPAccount personal IMAPAccount personal
Host imap.gmail.com Host imap.gmail.com
User howard@howardabrams.com User <<email-address-2()>> # Obviously, you'd substitute your own email address here
# I took out the --no-tty as we need to get the password to decrypt the password file. PassCmd "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mailpass-personal.gpg"
# Note that the password is actually the token for the account. SSLType IMAPS
PassCmd "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mailpass-personal.gpg" AuthMechs LOGIN
SSLType IMAPS
AuthMechs LOGIN
IMAPStore personal-remote IMAPStore personal-remote
Account personal Account personal
MaildirStore personal-local MaildirStore personal-local
Path ~/.mail/personal/ Path ~/.mail/personal/
Inbox ~/.mail/personal/INBOX Inbox ~/.mail/personal/INBOX
Flatten . Flatten .
Channel personal-inbox Channel personal-inbox
Master :personal-remote: Master :personal-remote:
Slave :personal-local: Slave :personal-local:
Patterns * !"[Gmail]/Drafts" !"[Gmail]/Spam" Patterns * !"[Gmail]/Drafts" !"[Gmail]/Spam"
Expunge Both Expunge Both
# Patterns "inbox" # Patterns "inbox"
# ExpireUnread no # ExpireUnread no
Channel personal-sent Channel personal-sent
Master :personal-remote:"[Gmail]/Sent Mail" Master :personal-remote:"[Gmail]/Sent Mail"
Slave :personal-local:sent Slave :personal-local:sent
ExpireUnread yes ExpireUnread yes
Channel personal-trash Channel personal-trash
Master :personal-remote:"[Gmail]/Trash" Master :personal-remote:"[Gmail]/Trash"
Slave :personal-local:trash Slave :personal-local:trash
ExpireUnread yes ExpireUnread yes
# GMAIL ACCOUNT # GMAIL ACCOUNT
IMAPAccount gmail IMAPAccount gmail
Host imap.gmail.com Host imap.gmail.com
User howard.abrams@gmail.com User <<email-address-1()>> # Substitute your own email address here
PassCmd "gpg -q --for-your-eyes-only --pinentry-mode loopback -d ~/.mailpass-google.gpg" PassCmd "gpg -q --for-your-eyes-only --pinentry-mode loopback -d ~/.mailpass-google.gpg"
SSLType IMAPS SSLType IMAPS
AuthMechs LOGIN AuthMechs LOGIN
IMAPStore gmail-remote IMAPStore gmail-remote
Account gmail Account gmail
MaildirStore gmail-local MaildirStore gmail-local
Path ~/.mail/gmail/ Path ~/.mail/gmail/
Inbox ~/.mail/gmail/INBOX Inbox ~/.mail/gmail/INBOX
Flatten . Flatten .
Channel gmail-inbox Channel gmail-inbox
Master :gmail-remote: Master :gmail-remote:
Slave :gmail-local: Slave :gmail-local:
Patterns * !"[Gmail]/Drafts" !"[Gmail]/Spam" Patterns * !"[Gmail]/Drafts" !"[Gmail]/Spam"
Expunge Both Expunge Both
# Patterns "inbox" # Patterns "inbox"
Channel gmail-sent Channel gmail-sent
Master :gmail-remote:"[Gmail]/Sent Mail" Master :gmail-remote:"[Gmail]/Sent Mail"
Slave :gmail-local:sent Slave :gmail-local:sent
ExpireUnread yes ExpireUnread yes
Channel gmail-trash Channel gmail-trash
Master :gmail-remote:"[Gmail]/Trash" Master :gmail-remote:"[Gmail]/Trash"
Slave :gmail-local:trash Slave :gmail-local:trash
ExpireUnread yes ExpireUnread yes
#+END_SRC #+END_SRC
* Notmuch Configuration * Notmuch Configuration
@ -230,12 +254,13 @@ Here is where you can let notmuch know how you would like to be addressed. Valid
Notmuch will use the various email addresses configured here when formatting replies. It will avoid including your own addresses in the recipient list of replies, and will set the From address based on the address to which the original email was addressed. Notmuch will use the various email addresses configured here when formatting replies. It will avoid including your own addresses in the recipient list of replies, and will set the From address based on the address to which the original email was addressed.
#+BEGIN_SRC conf-unix :tangle ~/.notmuch-config #+BEGIN_SRC conf-unix :tangle ~/.notmuch-config :noweb yes
[user] [user]
name=Howard Abrams name=Howard Abrams
primary_email=howard.abrams@gmail.com primary_email=<<email-address-1()>>
other_email=howard@howardabrams.com;howard@fuzzytoast.com; other_email=<<email-address-2()>>;<<email-address-3()>>
#+END_SRC #+END_SRC
*NB:* In the configuration above, you may see the addresses are all set to =nil=. If you are copying this from a rendered web page, just note that you need to substitute that with your own email address.
*** Configuration for "notmuch new" *** Configuration for "notmuch new"
The following options are supported here: The following options are supported here:
@ -632,13 +657,13 @@ The gods ordained that Mail and Org should dance together, so step one is compos
"m" '("mime it" . org-mime-htmlize))) "m" '("mime it" . org-mime-htmlize)))
#+END_SRC #+END_SRC
A new option is to use [[https://github.com/jeremy-compostella/org-msg][org-msg]], so let's try it: A new option is to use [[https://github.com/jeremy-compostella/org-msg][org-msg]], so let's try it:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp :noweb yes
(use-package org-msg (use-package org-msg
:init :init
(setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" (setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t"
org-msg-startup "hidestars indent inlineimages" org-msg-startup "hidestars indent inlineimages"
org-msg-greeting-fmt "\nHi%s,\n\n" org-msg-greeting-fmt "\nHi%s,\n\n"
org-msg-recipient-names '(("howard.abrams@gmail.com" . "Howard Abrams")) org-msg-recipient-names '(("<<email-address-1()>>" . "Howard Abrams"))
org-msg-greeting-name-limit 3 org-msg-greeting-name-limit 3
org-msg-default-alternatives '((new . (text html)) org-msg-default-alternatives '((new . (text html))
(reply-to-html . (text html)) (reply-to-html . (text html))