Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize attachment download directory at CLI and env levels #559

Open
butterthebuddha opened this issue Feb 9, 2025 · 2 comments
Open

Comments

@butterthebuddha
Copy link

Hello,

Himalaya is a neat little program.

It would be nice if himalaya attachment download worked something like

$ himalaya -o json attachment download 22832
{"22832": [{"name": "A.pdf", "location": "~/Downloads/A.pdf"}]}

instead of

$ himalaya -o json attachment download 22832
"Downloaded 1 attachment!\n"

to allow one to write scripts leveraging himalaya and jq that process email attachments1.

I have very limited Rust experience, but I'd be happy to take a look at putting a change together for this.

Footnotes

  1. My specific use case is fairly simple. I just need to download and re-send attachments in a different email. I'm trying to use Himalaya to replace much of a Python script used to ease the tedium of filing health insurance claims: https://git.sr.ht/~ani/email-automation/tree/main/item/bcbs_claim_mailer.py.

@letoram
Copy link

letoram commented Feb 12, 2025

Seconded, but also to be able to either define the target directory as part of the attachments command, or at the least respect XDG_DOWNLOAD_DIR rather than just the account config.

Right now the only option to differentiate downloads between envelopes from a script seem to be to generate the config for every attempt, and that's .. less than ideal.

@soywod
Copy link
Member

soywod commented Feb 18, 2025

Regarding the JSON output of the attachment download command, I would advise to subscribe to #547. I will extend its scope.

Regarding the download directory, I agree to make it customizable both at CLI level via a new argument and at env level with XDG_DOWNLOAD_DIR. That said, XDG_DOWNLOAD_DIR should already work, but only in case you don't define a custom directory in your config. Something smarter could be done: take arg first, then env, then finally config. Let's keep this issue for that particular purpose.

Thank you for your both feedbacks!

@soywod soywod changed the title Output the names and locations of attachments downloaded with "himalaya attachment download" Customize attachment download directory at CLI and env levels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants