pimalaya / himalaya

CLI to manage emails
https://pimalaya.org
MIT License
3.17k stars 95 forks source link

Documentation Notation Unclear #382

Closed Andonome closed 2 years ago

Andonome commented 2 years ago

Himalaya's template help suggests:

[-- \<template>...]

I assume that -- and ..., and perhaps [ mean something but I have no idea. I can't save a template with himalaya --template test.mail, or anything similar.

The 'send` is the same. It has:

himalaya send [-- <message>...]

... but it's unclear what anything means beyond the word 'send'. The documentation in the wiki is the same.

It'd be easier to list examples of something to type to send an email.

soywod commented 2 years ago

It'd be easier to list examples of something to type to send an email.

The template send command misses some pertinent examples I agree. But the send command is clear enough IMO:

Sends a raw message to the specified mailbox. For example:

himalaya send -- From: test@mail.com\r\n\r\nHello

# Using stdin
himalaya send < my-template.mail
cat my-template.mail | himalaya send

I assume that -- and ..., and perhaps [ mean something but I have no idea.

The CLI is build with clap, you can find information there. The -- is for passing raw data to the CLI (this is not related to Himalaya, it is a common bash convention)

So if I take back your example, to send a file you should use the stdout (either by piping cat test.mail | himalaya send or by redirecting himalaya send < test.mail), but once again this is not related to Himalaya, it is common bash convention.

Just a note about the send commands: himalaya send will send your message without modifying it (it sends the raw email you give in parameter, which implies that your message is a valid sendable message), while himalaya template send will build a sendable message from the template you give then send it. There is an open issue on this topic https://github.com/soywod/himalaya/issues/341, and I think we should document more the template in this same issue. Thanks for your feedback!

Andonome commented 2 years ago

himalaya send -- From: malinfreeborn@posteo.net\r\n\r\nHello

This produces

Error: cannot build sendable message

Caused by:
    missing source address, invalid envelope

I realize there's something obvious I'm missing, but I couldn't figure it out. I tried specifying which account (account is set up fine, and works with other commands), adding a 'TO: ' field, but still have no idea what's missing.

Sending from a template works fine.