{"id":118,"date":"2022-10-10T10:32:34","date_gmt":"2022-10-10T08:32:34","guid":{"rendered":"https:\/\/www.softwolves.com\/wolfblog\/?p=118"},"modified":"2024-03-12T23:29:58","modified_gmt":"2024-03-12T22:29:58","slug":"displaying-eml-attachments-in-vivaldi-on-linux","status":"publish","type":"post","link":"https:\/\/www.softwolves.com\/wolfblog\/2022\/10\/10\/displaying-eml-attachments-in-vivaldi-on-linux\/","title":{"rendered":"Displaying EML attachments in Vivaldi on Linux"},"content":{"rendered":"\n<p>Until recently, I have been using the old Opera Mail client for my work email. Opera Mail 12 <a href=\"https:\/\/en.wikipedia.org\/wiki\/History_of_the_Opera_web_browser#Version_12\">was released in 2013<\/a>. Being almost ten years old by now, it is starting to show its age with lack of support for newer standards. Since I really like the way the Opera Mail client works, I was really looking forward to the work done by the amazing Vivaldi team (where a lot of my old colleagues from Opera Software ended up, together with a lot of other amazing people), on their <a href=\"https:\/\/vivaldi.com\/features\/mail\/\">Vivaldi Mail client<\/a>.<\/p>\n\n\n\n<p>As my $DAYJOB uses Microsoft 365 for their email, we have several Outlook users in the house, and sometimes I happen upon a forwarded email sent in .eml format, and while Vivaldi actually uses this format to store email internally, <a href=\"https:\/\/forum.vivaldi.net\/topic\/55077\">it cannot display an attachment in this format<\/a> (at least not as of October 2022). An eml file is basically just a bare email message, so it should be easy to read, right? Apparently, not so much. Googling around <a href=\"https:\/\/askubuntu.com\/questions\/28135\/how-to-open-eml-files\">mostly recommended installing Thunderbird and import it there<\/a>. That question did have an interesting answer recommending mhonarc, using it to convert to HTML. I ended up expanding on that, writing a script that converts to HTML and then calls back to my stand-alone Vivaldi e-mail instance. I have this as <em>\/home\/peter\/bin\/eml-viewer<\/em> (if you&#8217;re using the main instance, remove the &#8211;user-data stuff, otherwise replace it with a path to your configuration directory):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; auto-links: false; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\nif &#x5B; ! -e &quot;$1&quot; ]; then\n    echo &#039;eml-viewer file.eml&#039;\n    exit 1\nfi\nOUT=$(mktemp --suffix .html)\n\/bin\/mhonarc -single &quot;$1&quot; &gt; &quot;$OUT&quot;\n\/bin\/vivaldi-stable --user-data-dir=\/home\/peter\/.config\/vivaldi-standalone &quot;$OUT&quot;\n<\/pre><\/div>\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><\/div><\/div>\n\n\n\n<p>The next step is to connect this up to open .eml files. For this, we need to create a matching <em>.local\/share\/applications\/eml-viewer.desktop<\/em> file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; auto-links: false; title: ; notranslate\" title=\"\">\n&#x5B;Desktop Entry]\nVersion=1.0\nName=EML Viwer\nGenericName=EML Viewer\nComment=View Outlook EML file\nExec=\/home\/peter\/bin\/eml-viewer %U\nStartupNotify=false\nTerminal=false\nIcon=mail-mark-unread\nType=Application\nCategories=Viewer;\nMimeType=message\/rfc822;\n<\/pre><\/div>\n\n\n<p>And finally, make it the default application for opening eml files:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nxdg-mime default eml-viewer.desktop message\/rfc822\n<\/pre><\/div>\n\n\n<p>This will leave the temporary HTML files in your temporary directory, so take care about sensitive data if on a shared computer. Set $TMPDIR to somewhere private and clear it periodically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Until recently, I have been using the old Opera Mail client for my work email. Opera Mail 12 was released in 2013. Being almost ten years old by now, it is starting to show its age with lack of support for newer standards. Since I really like the way the Opera Mail client works, I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45,28],"tags":[50,11,10],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-email","category-internet","tag-eml","tag-linux","tag-vivaldi"],"_links":{"self":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":5,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/118\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}