Brian Lovin
/
Hacker News
Daily Digest email

Get the top HN stories in your inbox every day.

djha-skin

Himalaya makes it pretty easy to write cli tools and automate email workflows. It pairs well with August, another rust project that can render html to text on the terminal. I wrote a git email patch automation tool around Himalaya so that people can receive email patches easily[1].

1: https://github.com/djha-skin/git-receive-mail

cfiggers

This is cool. I like the ongoing trend of TUIs getting more attention and use.

A little while ago I wrote my own little TUI tool using Textual that interfaces with Outlook using pywin32. I really only needed (need) one specific feature above and beyond what Outlook already does. And that is, I wanted a Vim-like UX for assigning categories to emails and archiving/deleting them. What I have now works surprisingly well and it's very satisfying to have made my own thing that suits my own needs precisely the way I want it to.

rubicks

I have been looking for something like this. Got a link to your project?

cfiggers

Hey there. This project isn't posted publicly anywhere at the moment—it's a very idiosyncratic one-of-one sort of deal.

For one thing, while I know Python a little bit, I much prefer to write Lisp. But the Textual [0] library is for Python and nothing else seems to even compete in the same space. So my "outlook-explorer" ("oe" on my command line) is actually written in Hy [1], a Lisp-y syntax swap that emits Python AST objects. And there's a couple places where I just hard-coded my own info, like the email address I'm using it with in order to pull from the right inbox in Outlook, that would need some kind of user-facing and reasonably user-friendly config options before it'd be ready for general consumption.

Have you thought about making your own bespoke one-of-one thing? I got much further than I expected to in only a couple hours. It was already basically functional in three hours, I think, and I came to the table with no prior experience using Textual.

[0] https://textual.textualize.io/

[1] https://hylang.org/

snthpy

I've also been looking for something like this. Was going to post on the Textual discord actuality to ask around.

Most of the email tools like notmuch tend to be GPL which limits adoption IMHO.

xyst

I feel like this has been here before, glad it's kept up with updates. Will have to give this a shot soon.

From strictly reading the docs, I love these features:

* oauth2 * json output

But do I need to run the "himalaya ..." command every so often to get fresh e-mails? Or can I leave TUI open and it will refresh in the background?

When composing messages, does anybody know if the "From" header can be re-written like in Thunderbird? I am able to send from ad-hoc aliases with my mail server, but need to re-write the "From" header first. For example, I can receive mail sent to "xyst.hn@example.com" and delivered to mailbox at "xyst@example.com". In order to reply with same e-mail address, I must re-write the "From" header to match.

faitswulff

It's designed to be a CLI tool as opposed to a TUI so that it's more composable with other CLI tools. So you can use it as a building block to create a TUI, but it's not one by default.

jedisct1

I still use mutt on a daily basis.

Being able to select emails using regular expressions is super useful.

IMAPFilter is also simple and powerful to quickly sort email.

drwu

Yes! I use mutt for searching, tagging, thread operations (splitting,appending etc.), bouncing, attaching other mails, deleting attachments, openpgp (personal), smime (at work), and it works with IMAP out of the box.

I am also able to integrate (a locally hosted) LanguageTool to check the grammar in the editor.

The only issue is to write emails with embedded images. But personally I don't like such emails for occupying the space of the mailbox.

msravi

What do you use to fetch email? mbsync keeps messing up the UID of emails with gmail.

0fflineuser

Personnaly, I use https://gitlab.com/shackra/goimapnotify , you can add a `~/.config/imapnotify/{{ youremailaddresshere }}.yaml` config file for each of your email addresses and enable and start it as a systemd service with `systemctl --user enable ---now goimapnotify@{{ youremailaddresshere }}.service`

Here is and example of a config file for a gmail address :

```

  host: imap.gmail.com
  port: 993
  tls: true
  tlsOptions:
    rejectUnauthorized: false
  username: {{ youremailaddresshere }}
  password: ''
  passwordCMD: pass mw/{{ youremailaddresshere }} | head -n1
  onNewMail: mailsync {{ youremailaddresshere }} | while read OUTPUT; do notify-send "" "$OUTPUT"; done
  onNewMailPost: ''
  onDeletedMail: ''
  onDeletedMailPost: ''
  boxes:
    - INBOX
```

svilen_dobrev

> format

indent it with 2+ spaces

  like
  this

e12e

> tlsOptions:

> rejectUnauthorized: false

Means trust any cert?

jedisct1

Just Mutt's IMAP support.

kmarc

offlineimap does the job for me I use it with Gmail and owa (trough davmail)

aynawn

Does it support email filters? I'd love to manage my gmail filters programmatically or use a configuration file to manage them so I can reuse the filters across multiple emails.

Edit: there is a separate tool for this for gmail https://github.com/mbrt/gmailctl

jonstewart

Neat. I used and loved “mh” in college, but that was before html email became prevalent. It was beautiful to have different commands and treat emails as individual files. Unfortunately mh was grotty old C code and just couldn’t keep up (IMHO) with how we use email today.

https://en.m.wikipedia.org/wiki/MH_Message_Handling_System

bandie91

shameless plug: i wrote emlv[1] (EMaiL Viewer) in the same mindset. it displays raw email files on the terminal.

[1] https://codeberg.org/hband/gemlv#emlv

zimpenfish

> I used and loved “mh” in college

Same and also `nmh`. Loved how you could combine the various parts to make your own tools.

mediumsmart

me too - nmh and MH-E still learning though

alberth

I'm confused, it is called 'Pimalaya' or 'Himalaya'

jarbus

Pimalaya is the org, Himalaya is the mail client, AFAIK

vigonotion

I think the README is missing some examples of what this can do. I used it for a script that marks every mail as seen:

    #!/bin/bash

    while true; do
    # Run the command and capture its exit code
    result=$(himalaya envelope list --folder INBOX --page 1 --page-size 100 --output json not flag Seen | \
        jq -r '.[] | "\(.id) Seen"')
    exit_code=$?

    # Check the exit code of `himalaya`
    if [[ $exit_code -ne 0 ]]; then
        echo "No more unseen emails to process or an error occurred."
        break
    fi

    # Check if result is empty
    if [[ -z "$result" ]]; then
        echo "No more unseen emails to process."
        break
    fi

    # Process unseen emails
    echo "$result" | xargs himalaya flag add

    echo "Processed unseen emails. Checking for more..."
    done
I'm not a shell coder and while writing the script I wasn't sure if the better way would have been to use the underlying Rust library, but that probably would have taken longer to build for such a small task.

Another idea I had was to use it to sort mails into folders by the receipient address suffix (my.name+amazon@example.com would sort into the amazon folder), which should be possible if I have read the man pages correctly.

Anyway, thanks for this, not sure if this is the "best" way for me to work with mails but it absolutely is the first tool that made me start automating my inbox.

brink

I love that logo.

oblio

Brilliant logo, thanks for pointing it out, I was just reading the comment before deciding if it was worth it to check out the project page.

MikeTheGreat

Genuine question - the HN title says "CLI to..." but looking at the GitHub repo I don't see any CLI-centric documentation.

I do see

    $ himalaya envelope list --account posteo --folder Archives.FOSS --page 2
and a screenshot that looks like PINE. Is that screenshot interactive (like PINE) or does himalaya print that out and then the process exits?

I guess my question is: is this different than PINE (or any other terminal-based, interactive email client)?

fabrixxm

Himalaya is not interactive: while Pine is a TUI, this is a CLI. Very useful to integrate emails in scripts easily.

zokier

The built release packages have full set of man-pages for you to familiarize with.

tempfile

Looks like mblaze but with extra steps

https://github.com/leahneukirchen/mblaze

38

last release 2017, good game. also only works on Windows with Linux emulator.

codetrotter

No? Version 1.3 was tagged in the repo September 13 this year.

https://github.com/leahneukirchen/mblaze/tags

And correspondingly of course that’s the version package repos have/will published too.

For example, Alpine Linux has that version in a community package repo on a branch.

https://pkgs.alpinelinux.org/package/edge/community/x86/mbla...

FreeBSD package repo is a little behind, still on v1.2 instead of v1.3. But that’s still a version from March of this year.

https://www.freshports.org/mail/mblaze

And even if the most recent release of mblaze really had been a few years ago, it could still be good software. Especially for email.

tempfile

> last release 2017

feature not a bug

> does not work on Windows

ditto

JeremyHerrman

Is anyone using local LLMs to manage their email? This seems like it could be helpful to hook that up.

Daily Digest email

Get the top HN stories in your inbox every day.