From 848e2a43a6ee39c62da31da2339250f516466784 Mon Sep 17 00:00:00 2001 From: Bendt Date: Fri, 19 Dec 2025 14:43:01 -0500 Subject: [PATCH] Fix Himalaya search by quoting query and placing it at end of command The search query was being inserted unquoted in the middle of the command, but Himalaya CLI expects the query to be quoted and positioned at the end. --- src/services/himalaya/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/himalaya/client.py b/src/services/himalaya/client.py index e98372a..3e05720 100644 --- a/src/services/himalaya/client.py +++ b/src/services/himalaya/client.py @@ -339,11 +339,15 @@ async def search_envelopes( # Himalaya query syntax: from or to or subject or body search_query = f"from {query} or to {query} or subject {query} or body {query}" - cmd = f"himalaya envelope list -o json -s {limit} {search_query}" + # Build command with options before the query (query must be at the end, quoted) + cmd = "himalaya envelope list -o json" if folder: cmd += f" -f '{folder}'" if account: cmd += f" -a '{account}'" + cmd += f" -s {limit}" + # Query must be quoted and at the end of the command + cmd += f' "{search_query}"' process = await asyncio.create_subprocess_shell( cmd,