CLI email clients are so fucked because email is so fucked. Like, I want to just have `cat body.txt | email send --to example@example.com` `email list --from example@example.com | less`

@mauve

I do this kinda stuff routinely using the `mail` command from mailutils. If postfix is installed you can do similar with `sendmail -t` just like back in the old days.

For example: ```
mail -s "Email Subject" -a "From: sender@example.com" recipient0@example.com recipient1@example.com < body.txt
```

Or: ```
{
cat << EOF
To: recipient0@example.com, recipient1@example.com
From: sender@example.com
Subject: Bla bla bla

EOF
cat body.txt
} | sendmail -t
```

This could also easily be wrapped into a shell script to provide the exact command syntax you want. Though that's presuming you also have an smtpd setup on that system with proper SPF, DKIM, DMARC, TLS, and so on. If you need authentication to an external smtpd then it can be a bit more of a challenge, but arguably still doable if you open a socket and send the raw SMTP messages via your shell script.

@toiletpaper Sending mail I think is the easier part, although doing the configuration is IMO a major pain in the butt still (compared to graphical interfaces). What do you use to read the mail back? I find the split between sending/loading/reading to be a bit overwhelming.

@mauve

It depends on whose system I'm on, but generally I just use mutt. I have a bunch of different aliases and macros for doing stuff like view attachments, stripping html, etc. If mutt's not installed I just use `mail`. For a daily driver, it's mutt. If I'm on the road, I have a copy of roundcube setup.
Follow

@toiletpaper Hmm, mail might do the trick. In my case I can't use TUIs because I'm interfacing through a terminal screen reader and dynamic rendering messes with its readback.

By mail you mean s-nail? Do you know of any tutorials for doing a complete setup with it?

· · Web · 1 · 0 · 0
@mauve

I've not used s-nail personally. Nor do I have much experience with screen readers beyond a couple decades back helping a couple blind friends with a few things. But email wasn't part of the help. What screen reader do you use?

@toiletpaper I'm using tdsr but really any CLI that has minimal output and doesn't do a TUI should be fine. e.g. if it outputs raw content to STDOUT I should be able to hear it without issues. Stuff like loading indicators and line numbers is what messes me up.

Also I need to somehow integrate with Microsoft and Google mail since I use them for work. 😅 From what I understand, that's a major PITA.

@mauve

Yeah. gmail and exchange servers are a pain. I think there are some tutorials for setting them up with `mutt`, but I haven't looked into doing it with `mail`. For something like that you might need to roll-your-own. If you're okay with shell scripting, it's probably doable, but you'd basically need to create an IMAP/POP client. I have one I wrote with Perl, but it was mainly for extracting years worth of "From" addresses for a client so they could generate and update their mailing list. Something more interactive would be a fair amount of work depending on the features you need.

@toiletpaper Yeah, honestly I think I'll just set up a client from scratch that does reading/sending with all the backends I need. It's unfortunate this sort of setup isn't more "standard" but it makes sense given the history of email.

@toiletpaper I see. I think s-nail is pretty much a more recent version of the same interface. It's bundled with arch which I use on most of my boxes these days. man.archlinux.org/man/mail.1.e

@mauve

Well I can't guarantee I'd be able to help with everything, but if you get stuck, don't be afraid to reach out.
Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.