Live data from Hacker News

Himalaya: CLI to Manage Emails

github.com

101–102 of 102 posts

Re: Himalaya: CLI to Manage Emails

#101
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.

Re: Himalaya: CLI to Manage Emails

#102
post #23

Earlier quoted context omitted.

> HTML breaks not only the philosophy but also many of the tools developed around email I was one of these die-hard-text-only people, back in the mid to late 90s. It was true. People were sending HTML/rich text emails, and it broke everything, and it was awful to read with. Not to mention the kilobytes of bandwidth wasted! But it's 2024 now. There are vastly more tools that can deal with HTML email than those that ca…

> Email is not plain text any more. We can't pretend that it is or should be. I send plain text emails and this is a hill I will die on. :-) Do you not contribute to the development of any open-source projects that only accept patches via plain text emails sent to mailing lists (e.g., many GNU projects)? Here's a tip for anyone who sends plain text emails, or wants to, and has to deal with annoying normies who compla…

> I send plain text emails and this is a hill I will die on. :-)

I don't want to be mean, but yes, it is likely this hill will die with you :-)))

I doubt you can find many 18 year olds these days that would willingly use plain text emails.

Post reply on HN