<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: mutt</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/mutt/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Viewing A Textual PDF In Mutt</title>
      <link>https://chrisjrob.com/2011/03/23/viewing-a-textual-pdf-in-mutt/</link>
      <pubDate>Wed, 23 Mar 2011 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2011/03/23/viewing-a-textual-pdf-in-mutt</guid>
      <description>
       <![CDATA[
         
         <p>I think there must be something wrong with me. Why, in this age of
graphical user interfaces, does it delight me so much that I can view
textual PDFs within Mutt (on a remote server without a gui)?</p>

<p>To set this up, you need to install pdftotext. This application is
available in either poppler-utils or xpdf-utils - most people seem to
use the latter, but I suspect the former is probably a better option for
a text-only server. I installed poppler-utils.</p>

<!--more-->

<p>Next create (or edit) the <code class="language-plaintext highlighter-rouge">~/.mailcap</code> file, so that it has the
following line:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>application/pdf;                pdftotext -layout %s -; copiousoutput
</code></pre></div></div>

<p>You could also add the line:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>text/html;                      elinks %s; nametemplate=%s.html`
</code></pre></div></div>

<p>The latter line opens HTML attachments in elinks.</p>

<p>Then just hit “V” when viewing an email, and you will see the
attachments, select the attachment and hit Enter to view it. Awesome :)</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Configuring Mutt For Spam</title>
      <link>https://chrisjrob.com/2011/03/23/configuring-mutt-for-spam/</link>
      <pubDate>Wed, 23 Mar 2011 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2011/03/23/configuring-mutt-for-spam</guid>
      <description>
       <![CDATA[
         
         <p>I have been using Mutt for some time, but have always found it a pain
for handling spam, so I finally spent the time yesterday to work out how
to do it. The surprising thing is that there seemed to be different and
confusing advice on how to achieve this. The best information turned out
to be the <a href="http://wiki.mutt.org/?MuttGuide/Macros">Mutt manual</a> itself,
which is a great example of how open source documentation should be.</p>

<!--more-->

<p>My folder layout is that I have a Spam folder, within which I have two
folders - Spam/Ham and Spam/Verified. The Spam/Ham are good emails,
particularly those that have been wrongly identified as Spam. The
Spam/Verified are the Spam that I am confirming are definitely Spam.
SpamAssassin places all the detected Spam in the Spam folder. I
generally move all the Spam folder into Spam/Verified except the one or
two false positives, which I move to Spam/Ham. Then overnight
<a href="http://spamassassin.apache.org/">SpamAssassin</a> learns from those two
folders - a fairly standard SpamAssassin layout I think.</p>

<p>Occasionally we get Spam in our Inbox, and obviously these can be moved
straight to the Spam/Verified folder.</p>

<p>The important factor here is that I want to be able to easily flag
individual emails in my Inbox as Spam, but I also want to be able to tag
the whole of my Spam folder and flag as Spam.</p>

<p>The manual gives a <a href="http://www.mutt.org/doc/devel/manual.html#functions">list of functions</a>, which I
used rather than the normal key bindings, as the manual advises that
this is more portable and robust. I used the <code class="language-plaintext highlighter-rouge">tag-prefix</code> command to
enable tagging. I was not using the keys H nor S, so I chose these as
Ham and Spam respectively.</p>

<p>You need two macros for each function - one for use in the folder list
(index) and one for use inside an email message (pager), so that you can
flag it as Spam without moving back to the message list.</p>

<p>The biggest problem I encountered was the difficulty that removing the
unread flag resulted in the selection moving down to the next email, and
then the next email would be flagged as Spam - frustrating. The only
solution seemed to be modify the muttrc configuration before and after,
and almost unbelievably that is in fact possible using the function.</p>

<p>The final macros are shown below:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Move message(s) to Spam/Verified by pressing "S"
macro index S "&lt;tag-prefix&gt;&lt;enter-command&gt;unset resolve&lt;enter&gt;&lt;tag-prefix&gt;&lt;clear-flag&gt;N&lt;tag-prefix&gt;&lt;enter-command&gt;set resolve&lt;enter&gt;&lt;tag-prefix&gt;&lt;save-message&gt;=INBOX/Spam/Verified&lt;enter&gt;" "file as Spam"
macro pager S "&lt;save-message&gt;=INBOX/Spam/Verified&lt;enter&gt;" "file as Spam"
# Move message(s) to Spam/Ham by pressing "H"
macro index H "&lt;tag-prefix&gt;&lt;enter-command&gt;unset resolve&lt;enter&gt;&lt;tag-prefix&gt;&lt;clear-flag&gt;N&lt;tag-prefix&gt;&lt;enter-command&gt;set resolve&lt;enter&gt;&lt;tag-prefix&gt;&lt;save-message&gt;=INBOX/Spam/Ham&lt;enter&gt;" "file as Ham"
macro pager H "&lt;save-message&gt;=INBOX/Spam/Ham&lt;enter&gt;" "file as Ham"
# Return to Inbox by pressing "."
macro index . "&lt;change-folder&gt;=INBOX&lt;enter&gt;" "Inbox"
</code></pre></div></div>

<p>Suddenly Mutt is the easiest way for me to handle by Spam.</p>


       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
