{"id":2820,"date":"2026-01-16T23:11:43","date_gmt":"2026-01-16T23:11:43","guid":{"rendered":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2820"},"modified":"2026-01-16T23:33:24","modified_gmt":"2026-01-16T23:33:24","slug":"open-with-and-external-programs-on-claws-mail","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2820","title":{"rendered":"Open with and external programs on Claws-Mail"},"content":{"rendered":"<p>I was integrating <a href=\"https:\/\/github.com\/gawen947\/runrunrun\">rrr<\/a> with <a href=\"https:\/\/www.claws-mail.org\">claws-mail<\/a> and use it to open external files, so I could centralize file opening configuration there. I created a <i>mail<\/i> profile in <code>~\/.config\/rrr.conf<\/code> with a catch-all rule <code>* echo \"'%s'\" >> \/tmp\/mail-rrr.log<\/code> to debug which files and extensions were being passed. The plan was to set <code>rrr -p mail -F '%s'<\/code> as the default external application, but the command kept failing.<\/p>\n<p>I wrote a small test.sh script to display each argument individually as passed by claws-mail. That&#8217;s when I discovered the issue: claws-mail treats each space in the command as a separate argument delimiter. So <code>rrr -p&nbsp;&nbsp;mail -F '%s'<\/code> (note the double space between <code>-p<\/code> and <code>mail<\/code>) resulted in the argument list: <code>[\"rrr\", \"-p\", \"\", \"mail\", \"-F\", \"the-actual-file\"]<\/code>. The empty string broke everything.<\/p>\n<p>So the fix was simple, just had to make sure there were no extra space everywhere.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was integrating rrr with claws-mail and use it to open external files, so I could centralize file opening configuration there. I created a mail profile in ~\/.config\/rrr.conf with a catch-all rule * echo &#8220;&#8216;%s'&#8221; >> \/tmp\/mail-rrr.log to debug which &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=2820\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[631,590,1204,1197,1196],"class_list":["post-2820","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-claws-mail","tag-external","tag-external-files","tag-rrr","tag-runrunrun"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2820"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}