🧠 Second Brain

Search

Search IconIcon to open search

HEY-Screener in (Neo)Mutt

Last updated Feb 9, 2024

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 slaggy 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
asciicast

“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

# How I use it

# Screener Setup

  1. 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.

  1. 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:

Update the mail_dir variable in the script to point to your NeoMutt mail directory.

  1. Setting Up NeoMutt Macros

In your .muttrc file, set up the following macros for easy management of your screening lists:

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

1
brew install 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[general]
ui = ttyui
accounts = domain.com

#### account 1 ------------------------------------
[Account domain.com]
localrepository = domain.com-local
remoterepository = domain.com-remote

[Repository domain.com-local]
type = Maildir
localfolders = ~/Documents/mutt/domain.com
status_backend = plain

[Repository domain.com-remote]
type = IMAP
auth_mechanisms = PLAIN, LOGIN
remoteuser = simu@domain.com
remotepass = my pass - escape every % with %%
remotehost = imap.mail.hostpoint.ch
remoteport = 993
ssl = yes
sslcacertfile = /opt/homebrew/etc/openssl@3/cert.pem

# msmtp

1
2
3
brew install msmtp
vim ~/.msmtprc
chmod 600 ~/.msmtprc

my working config:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
defaults
auth on
tls on
tls_starttls on
tls_trust_file /opt/homebrew/etc/openssl@3/cert.pem
syslog LOG_USER
logfile ~/.msmtp.log
timeout 60

#### account 1 ------------------------------------
account domain.com
host asmtp.mail.hostpoint.ch
domain domain.com
port 587
auth on
from simu@domain.com
user simu@domain.com
password my password, don't escape % as above

# Set this account as the default
account default : domain.com

testing with:

1
echo "Subject: Oye from msmtp" | msmtp test@gmail.com

# Neomutt

1
2
3
4
5
6
7
### offline email -------------------------
set sendmail = "/usr/bin/msmtp -a domain.com"
set folder = "~/Documents/mutt/domain.com/"
alias me "Simon" "simu@domain.com"
set mbox_type = Maildir
set ssl_starttls = yes
set ssl_force_tls = yes

Origin:
References:
Created 2023-11-19