🧠Second Brain
Search
HEY-Screener in (Neo)Mutt
To create my favorite feature from HEY.com, the Screener, I had to get the existing work and screen in and out of the list for two years or so. Below is how I made it.
But why I am doing this? I enjoy Neovim and its Vim Language (and Motions), and HEY feels very laggy at times, I wanted to try could build a Screener, with a little help from my AI friend 😉.
And Spoiler alert, it actually works. Next up, I will also add the Feed and Paper Trail list.
If you like the video, you can also check my Asciinema video
“Getting all ScreenIn and Out emails from Hey.com”
To see how I downloaded all emails from Hey.com, see HEY.com- Get a list of ScreenedIn and Out emails.
# So what is a Screener?
Screen emails like you screen calls. You screen your calls, so why can’t you screen your emails? With HEY, you can. HEY puts you in complete control of who’s allowed to email you. The first time someone emails you, you get to decide if you want to hear from them again.
# How is this different from a spam filter?
HEY also has a spam filter which every email hits before it hits The Screener, but plenty of people/services email you who would never be considered spam. A newsletter someone else signed you up for, a salesperson reaching out to inquire, a friend of a friend’s uncle’s brother’s neighbor who got your email address somehow. The Screener puts you in control of who’s allowed to email you — and who isn’t.
# Use-Cases
ToScreen
: None screened emails land in that folderScreenedOut
: Mail from screened out list will automatically moved out of the inbox to that listPaperTrail
,Feed
: The same goes for these two list, emails from that list go automatically into this folderINBOX
: Leftovers are the only emails I actively screened and approved. No email will reach my inbox otherwise.
# How I use it
S
: shortcut to sync IMAP with my local state.A
: to automatically run the above logic to move email around according to my lists.O/I
: for screen Out or In a selected email,P
for adding to PaperTrail,F
for adding to Feed.
# Screener Setup
- Creating Screening Lists
First, set up your screening lists: screened_in.txt
, screened_out.txt
, feed.txt
, and papertrail.txt
. These lists will contain email addresses that you want to categorize.
- Script Configuration
Use the provided Bash script to process incoming emails. The script checks the sender of each email against your screening lists and moves the email to the appropriate folder:
- Emails from senders in
screened_in.txt
remain in your inbox. - Emails from senders in
screened_out.txt
go to the ScreenedOut folder. - Emails from senders in
feed.txt
are moved to the Feed folder. - Emails from senders in
papertrail.txt
go to the PaperTrail folder.
Update the mail_dir
variable in the script to point to your Neomutt mail directory.
- Setting Up NeoMutt Macros
In your .muttrc
file, set up the following macros for easy management of your screening lists:
I
: Screens in the sender of the current email.O
: Screens out the sender of the current email.F
: Adds the sender to the Feed list.P
: Adds the sender to the PaperTrail list.
These macros automate the process of updating your lists directly from within NeoMutt.
Usage
Run the script periodically (e.g., via a cron job) to process new emails. Use the NeoMutt macros to quickly add or remove senders from your lists, streamlining your email management process.
# Setting up Neomutt Offline
I followed this Setting up neomutt with offlineimap and msmtp, but you can see my Mutt Dotfiles.
# OfflineIMAP
|
|
Offlineimap has an error, fixing it manually in /opt/homebrew/Cellar/offlineimap/8.0.0_1/libexec/lib/python3.11/site-packages/offlineimap/LocalStatusSQLite.py
according to
LocalStatusSQLite.py (fixed in master, but no new release)
# Config
|
|
# msmtp
|
|
my working config:
|
|
testing with:
|
|
# Neomutt
|
|
Origin:
References:
Created 2023-11-19