<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux etc. &#187; mutt</title>
	<atom:link href="http://promberger.info/linux/category/mutt/feed/" rel="self" type="application/rss+xml" />
	<link>http://promberger.info/linux</link>
	<description>my outsourced memory for your perusal</description>
	<lastBuildDate>Mon, 02 Aug 2010 11:32:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mutt: set dynamic email signature from shell command output</title>
		<link>http://promberger.info/linux/2009/10/03/mutt-set-dynamic-email-signature-from-shell-command-output/</link>
		<comments>http://promberger.info/linux/2009/10/03/mutt-set-dynamic-email-signature-from-shell-command-output/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 09:29:48 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Bash shell]]></category>
		<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=311</guid>
		<description><![CDATA[I want to set my signature when mailing to the r-help mailing list to contain information about the R version I have currently installed. Creating a bash script that directly echoes the several lines that I want to have in my signature and executing that in the muttrc using backticks gives a &#8220;broken pipe&#8221; error. [...]]]></description>
			<content:encoded><![CDATA[<p>I want to set my signature when mailing to the r-help mailing list to contain information about the <a href="http://www.r-project.org">R</a> version I have currently installed. Creating a bash script that directly echoes the several lines that I want to have in my signature and executing that in the muttrc using backticks gives a &#8220;broken pipe&#8221; error. </p>
<p>One solution (I&#8217;m sure there are others, maybe better ones) is to make the shell script create a temporary signature file and echo the path to that file, then execute the shell script using backticks.</p>
<p>Shell script (don&#8217;t forget to <code>chmod 744</code>):</p>
<pre>#!/bin/bash                                                                                          

thesigfile=~/.mutt/rsig

echo  "Marianne Promberger PhD, King's College London
http://promberger.info" > $thesigfile
R --version | head -n 1 >> $thesigfile
cat /etc/issue | head -n 1 | cut -d " " -f 1-2 >> $thesigfile
echo $thesigfile</pre>
<p><code>muttrc</code>:</p>
<pre>send-hook '~t r-help' 'set signature=`~/.mutt/signature_r-help`'</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/10/03/mutt-set-dynamic-email-signature-from-shell-command-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>extract_url.pl needs MIME-tools perl module</title>
		<link>http://promberger.info/linux/2009/10/03/extract_urlpl-needs-mime-tools-perl-module-for/</link>
		<comments>http://promberger.info/linux/2009/10/03/extract_urlpl-needs-mime-tools-perl-module-for/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 09:21:52 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=292</guid>
		<description><![CDATA[extract_url.pl fails with:
Can't locate MIME/Parser.pm in @INC
Solution:
sudo aptitude install libmime-tools-perl
]]></description>
			<content:encoded><![CDATA[<p><code>extract_url.pl</code> fails with:</p>
<pre>Can't locate MIME/Parser.pm in @INC</pre>
<p>Solution:</p>
<pre>sudo aptitude install libmime-tools-perl</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/10/03/extract_urlpl-needs-mime-tools-perl-module-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mutt: match messages that started a thread and have no replies</title>
		<link>http://promberger.info/linux/2009/09/16/mutt-match-messages-that-started-a-thread-and-have-no-replies/</link>
		<comments>http://promberger.info/linux/2009/09/16/mutt-match-messages-that-started-a-thread-and-have-no-replies/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:44:40 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=283</guid>
		<description><![CDATA[Thanks to the helpful people on mutt-users.
As the title says. Mainly useful for mailing lists like r-help &#8212; questions that still need answering. (As if I knew any answers to r-help questions, ha.)
!~x . ~$
Note it combines ~x which looks into the &#8220;References:&#8221; header, so !~x . means &#8220;No References header&#8221;, i.e., messages that started [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the helpful people on mutt-users.</p>
<p>As the title says. Mainly useful for mailing lists like r-help &#8212; questions that still need answering. (As if I knew any answers to r-help questions, ha.)</p>
<pre>!~x . ~$</pre>
<p>Note it combines <code>~x</code> which looks into the &#8220;References:&#8221; header, so <code>!~x .</code> means &#8220;No References header&#8221;, i.e., messages that started a thread (and those from mail agents that don&#8217;t reference properly, alas) and <code>~$</code> matches unreferenced messages. Default combination for pattern terms is AND.</p>
<p>Of course, use with the lovely <code>limit</code> command and maybe combine with a date range:</p>
<pre>!~x . ~$ ~d <1w</pre>
<p>(Note <strong>no space</strong> after the <).</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/09/16/mutt-match-messages-that-started-a-thread-and-have-no-replies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OfflineIMAP settings for King&#8217;s College London email account</title>
		<link>http://promberger.info/linux/2009/09/04/offlineimap-settings-for-kings-college-london-email-account/</link>
		<comments>http://promberger.info/linux/2009/09/04/offlineimap-settings-for-kings-college-london-email-account/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 20:19:36 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=252</guid>
		<description><![CDATA[Same as in the previous post &#8230; the information you need is in fact already available here, but if you want to just cut-and-paste this into your ~/.offlineimaprc, see below. (For those who don&#8217;t know, offlineimap is an incredibly useful tool that syncs local maildirs with IMAP accounts. You get all the benefits of being [...]]]></description>
			<content:encoded><![CDATA[<p>Same as in the previous post &#8230; the information you need is in fact already available <a href="http://www.kcl.ac.uk/content/1/c6/04/30/94/GenericSettings.pdf">here</a>, but if you want to just cut-and-paste this into your ~/.offlineimaprc, see below. (For those who don&#8217;t know, <a href="http://software.complete.org/software/projects/show/offlineimap">offlineimap</a> is an incredibly useful tool that syncs local maildirs with IMAP accounts. You get all the benefits of being able to access mail remotely, from different machines, while getting the speed of local access, and being able to access all old mail while offline, because you in fact point your mail client at your local maildirs.)</p>
<p>For the stuff below, some settings are obviously optional or a matter of taste, <code>man offlineimap</code>. I&#8217;ll note just these:</p>
<ul>
<li>Replace YOURKCLLOGIN and YOURPASSWORD (duh)</li>
<li><code>localfolders = ~/maildir/kcl</code>: This is you local maildir location, you&#8217;ll probably have to change that, and that folder must already exist before you run offlineimap</li>
<li><code>folderfilter = lambda foldername: foldername in ['INBOX']</code>: This now just syncs your Inbox! I have this set because I actually archive mail to a different mail server. If you want to create IMAP folders on the KCL server, you&#8217;ll obviously have to omit this or fiddle with it &mdash; there seem to be quite a lot of folders there by default that seem to be related to MS exchange.</li>
</ul>
<pre>
[Account kcl]
localrepository = kcl_local
remoterepository = kcl_remote
autorefresh = 2
quick = 7

[Repository kcl_local]
type = Maildir
localfolders = ~/maildir/kcl

[Repository kcl_remote]
type = IMAP
ssl = yes
port = 993
maxconnections=2
remotehost = kclimap.kcl.ac.uk
remoteuser = kclad\YOURKCLLOGIN
remotepass = YOURPASSWORD
folderfilter = lambda foldername: foldername in ['INBOX']
</pre>
<h3>Addendum</h3>
<p>I had <code>holdconnectionopen = true</code> in the settings for <code>kcl_remote</code> when I posted this. OfflineIMAP crashed a lot, and it seems when I take out this setting this happens a lot less.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/09/04/offlineimap-settings-for-kings-college-london-email-account/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>msmtprc settings for King&#8217;s College London email account</title>
		<link>http://promberger.info/linux/2009/09/04/msmtprc-settings-for-kings-college-london-email-account/</link>
		<comments>http://promberger.info/linux/2009/09/04/msmtprc-settings-for-kings-college-london-email-account/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 16:55:44 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Mail setup]]></category>
		<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=246</guid>
		<description><![CDATA[Just to maybe spare someone some time. There&#8217;s a pdf on the KCL website with all the information you need, but it&#8217;s even easier just to cut and paste.
Note: 

account kcl Can be something else, especially, can be &#8220;default&#8221; if you want it to be the default.
Replace &#8220;USERNAME&#8221; with your username, but make sure you [...]]]></description>
			<content:encoded><![CDATA[<p>Just to maybe spare someone some time. There&#8217;s a <a href="http://www.kcl.ac.uk/content/1/c6/04/30/94/GenericSettings.pdf">pdf on the KCL website</a> with all the information you need, but it&#8217;s even easier just to cut and paste.</p>
<p>Note: </p>
<ul>
<li><code>account kcl</code> Can be something else, especially, can be &#8220;default&#8221; if you want it to be the default.</li>
<li>Replace &#8220;USERNAME&#8221; with your username, but make sure you leave the preceding <code>kclad\</code> in there.</li>
<li>replace PASSWORD</li>
<li><code>tls_trust_file</code> can vary depending on your system. This should work if you use Debian or Ubuntu and have the package <code>ca-certificates</code> installed. If you must, replace with <code>tls_certcheck off</code></li>
<li><code>logfile</code> setting is optional, but recommended</li>
</ul>
<pre>
account kcl
host kclsmtp.kcl.ac.uk
user kclad\USERNAME
password PASSWORD
auth on
tls
tls_trust_file /etc/ssl/certs/ca-certificates.crt
port 587
logfile ~/.msmtp-log
</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/09/04/msmtprc-settings-for-kings-college-london-email-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mutt: limit or search by date</title>
		<link>http://promberger.info/linux/2009/07/23/mutt-limit-or-search-by-date/</link>
		<comments>http://promberger.info/linux/2009/07/23/mutt-limit-or-search-by-date/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:14:11 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=222</guid>
		<description><![CDATA[mutt rocks; I cannot say this often enough. You spend so much time dealing with email. If there is one task where it really pays off to train your brain to remember some shortcuts to never have to touch the mouse, and to benefit from enormous possibilities of customization, email must be it. 
Still, here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mutt.org">mutt</a> rocks; I cannot say this often enough. You spend so much time dealing with email. If there is one task where it really pays off to train your brain to remember some shortcuts to never have to touch the mouse, and to benefit from enormous possibilities of customization, email must be it. </p>
<p>Still, here&#8217;s one of the things I don&#8217;t do often enough to remember properly, so I  keep messing this up.  You need to pay attention to the spaces. Say you are looking for mail sent less than a week ago.  The following will <strong>not work</strong>: </p>
<pre>~d < 1w</pre>
<p>Use this instead:</p>
<pre>~d <1w</pre>
<p>Also, remember mutt uses the "AND" operator by default, so do not add <code>&#038;</code> or <code>&#038;&#038;</code> to combine searches using AND. Instead, just string them together. Say you want to see all mail to, from, or cc a specific address group, sent in the last seven days, do <code>l</code> for limit, or <code>/</code> for search, followed by:</p>
<pre>%L groupname ~d <1w</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/07/23/mutt-limit-or-search-by-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs regular expressions: match at least n occurrences of character class</title>
		<link>http://promberger.info/linux/2009/06/16/emacs-regular-expressions-match-exactly-n-occurrences-of-character-class/</link>
		<comments>http://promberger.info/linux/2009/06/16/emacs-regular-expressions-match-exactly-n-occurrences-of-character-class/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 09:40:49 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Regular expressions]]></category>
		<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=213</guid>
		<description><![CDATA[Aside: I just discovered the very useful Emacs regex builder tool. Type M-x regexp-builder.
I wanted a regular expression to match the pattern of mutt mail edit buffers, to apply mail-mode, but I did not want to match the muttrc and mutt.hooks files I have.
Mail edit buffers get a pattern that starts with &#8220;mutt&#8221;, followed by [...]]]></description>
			<content:encoded><![CDATA[<p>Aside: I just discovered the very useful Emacs regex builder tool. Type <code>M-x regexp-builder</code>.</p>
<p>I wanted a regular expression to match the pattern of mutt mail edit buffers, to apply mail-mode, but I did not want to match the <code>muttrc</code> and <code>mutt.hooks</code> files I have.</p>
<p>Mail edit buffers get a pattern that starts with &#8220;mutt&#8221;, followed by a combination of dashes, letters and numbers. Examples:</p>
<pre>mutt-lauren-ad34AD-
muttadR12
muttadrsd</pre>
<p>The pattern <code>mutt[-0-9a-zA-Z]+$</code> matches these just fine, but it would also match <code>muttrc</code>. So I want a regex that looks for at least three occurrences from the character class described in the brackets. Generally, this is done using <code>{3,}</code> (using the <code>{m,n}</code> pattern to match at least <i>m</i> and at most <i>n</i> occurrences). (You can match exactly <i>n</i> occurrences, by using <code>{3}</code>).</p>
<p>In Emacs, this didn&#8217;t work, and it turns out I had to escape the curly brackets <strong>twice</strong>: <code>mutt[-0-9a-zA-Z]\\{3,\\}$</code>.</p>
<p>Here&#8217;s the full section in my <code>.emacs</code> file:</p>
<pre>(defun mutt-edit-hook ()
  (setq fill-column 70)
  (setq make-backup-files nil)
  )

(add-to-list 'auto-mode-alist '("mutt[-0-9a-zA-Z]\\{3,\\}$" . mail-mode))
(add-hook 'mail-mode-hook 'turn-on-auto-fill)
(add-hook 'mail-mode-hook 'mutt-edit-hook)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/06/16/emacs-regular-expressions-match-exactly-n-occurrences-of-character-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining a whitelist of e-mail senders with local mutt and procmail on a server</title>
		<link>http://promberger.info/linux/2009/06/08/maintaining-a-whitelist-of-e-mail-senders-with-local-mutt-and-procmail/</link>
		<comments>http://promberger.info/linux/2009/06/08/maintaining-a-whitelist-of-e-mail-senders-with-local-mutt-and-procmail/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 20:00:49 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Mail setup]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[procmail]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=175</guid>
		<description><![CDATA[I run mutt locally on several different computers. OfflineIMAP automatically synchronizes the mailboxes, and that is a huge benefit. But I still had to set up a system that synchronizes my address books and mail settings. I&#8217;ve forgotten what exactly I am doing to accomplish this, and I now think there&#8217;s a small mistake somewhere [...]]]></description>
			<content:encoded><![CDATA[<p>I run mutt locally on several different computers. <a href="http://software.complete.org/software/projects/show/offlineimap">OfflineIMAP</a> automatically synchronizes the mailboxes, and that is a huge benefit. But I still had to set up a system that synchronizes my address books and mail settings. I&#8217;ve forgotten what exactly I am doing to accomplish this, and I now think there&#8217;s a small mistake somewhere that sometimes causes me to lose e-mail addresses from my address book. So I&#8217;ll write a little series in the category <a href="http://promberger.info/linux/category/mail-setup/">mail setup</a> to document this on this blog, step by step, as I have time. This is the first instalment.</p>
<p>I maintain a whitelist of e-mail addresses to save spamassassin some work and myself some false positives.<br />
To do this, I have a script that I run periodically (using crontab). The relevant lines of this script are (there&#8217;s some more stuff, since I also use it to blacklist things):</p>
<pre>
#!/bin/bash
ALIASFILE=$HOME/.mutt/.mutt.aliases
WHITELISTMAN=$HOME/.mutt/my_manual_whitelist
WHITELIST=$HOME/.mutt/my_whitelist
grep @ $ALIASFILE | cut -d "<" -f 2  | cut -d ">" -f 1 | grep -v " " > $WHITELIST
cat $WHITELISTMAN >> $WHITELIST
ping -c1 colobus.isomerica.net > /dev/null 2>&#038;1
if [ $? != 0 ] ; then
  exit 0
else
  rsync $WHITELIST isomerica:.procmail/my_whitelist
fi
</pre>
<p>The script just gets the e-mail addresses from my mutt alias file, combines this with any addresses from a manually maintained alias file, then uploads that to the server. On the server, the spam handling recipe in <code>~/.procmailrc</code> does not pipe mail from these addresses to spamassassin, but everything else:</p>
<pre>
 :0fw
* ! ? (echo "$FROM" | $FGREP -f $WHITELIST)
| spamc
:0:
* ^X-spam-flag: yes
$HOME/.maildir/inbox/.Junk/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/06/08/maintaining-a-whitelist-of-e-mail-senders-with-local-mutt-and-procmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use mutt to send individual e-mails to lots of people at once</title>
		<link>http://promberger.info/linux/2009/03/18/how-to-use-mutt-to-send-individual-e-mails-to-lots-of-people-at-once/</link>
		<comments>http://promberger.info/linux/2009/03/18/how-to-use-mutt-to-send-individual-e-mails-to-lots-of-people-at-once/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 18:15:30 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Bash shell]]></category>
		<category><![CDATA[Noobs]]></category>
		<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=144</guid>
		<description><![CDATA[So, you want to send an e-mail to a list of people, but you don&#8217;t want to put them all in the &#8220;To:&#8221; or the &#8220;Bcc:&#8221; field of a single mail. You want each person to get an individual e-mail, but with the same subject line and the same content. It&#8217;s easy using mutt.

Create a [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to send an e-mail to a list of people, but you don&#8217;t want to put them all in the &#8220;To:&#8221; or the &#8220;Bcc:&#8221; field of a single mail. You want each person to get an individual e-mail, but with the same subject line and the same content. It&#8217;s easy using mutt.</p>
<ul>
<li>Create a text file that contains all the recipients, one on each line. This can be the full e-mail address, or it can be the alias you have defined in your mutt aliases file (which is your mutt &#8220;addressbook&#8221;). For our example, we&#8217;ll call it <code>recipients.txt</code></li>
<li>Create a text file with the text of your message. Let&#8217;s call it <code>message.txt</code>.</li>
<li>Create a bash shell script containing the following:
<pre>#!/bin/bash
while read line
do
mutt $line -s 'Message subject'  < message.txt
done < recipients.txt</pre>
<p>Where "Message subject" is whatever your message subject should be. Of course, you need to run your shell script from the directory in which the files "message.txt" and "recipients.txt" are stored. Otherwise, you need to substitute their names with the full path name, e.g. <code>~/message.txt</code>.
</li>
<li>Make your bash script executable and run it. Done. Your individual e-mails should show up in your mailfolder for sent mail (defined by <code>set record=...</code> in your <code>~/.muttrc</code>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/03/18/how-to-use-mutt-to-send-individual-e-mails-to-lots-of-people-at-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding an &#8220;X-label&#8221; header to lots of messages at once using mutt</title>
		<link>http://promberger.info/linux/2009/01/22/adding-an-x-label-header-to-lots-of-messages-at-once-using-mutt/</link>
		<comments>http://promberger.info/linux/2009/01/22/adding-an-x-label-header-to-lots-of-messages-at-once-using-mutt/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 11:31:08 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mutt]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/2009/01/22/adding-an-x-label-header-to-lots-of-messages-at-once-using-mutt/</guid>
		<description><![CDATA[I&#8217;m using this method to add labels to individual messages in mutt. (You can use the X-label header in a similar way that you label e-mail in Gmail. You can search for messages with a certain label using the ~y pattern in mutt). But what if you suddenly want to apply a label to lots [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://footils.org/cms/show/59">this method</a> to add labels to individual messages in mutt. (You can use the X-label header in a similar way that you label e-mail in Gmail. You can search for messages with a certain label using the <code>~y</code> pattern in mutt). But what if you suddenly want to apply a label to lots of messages in a mailbox?</p>
<p>If your original messages are in an &#8220;mbox&#8221; format mailbox, you can pipe the messages to formail, which adds the header, and append the messages to the current mailbox (let&#8217;s assume it&#8217;s called &#8220;mycurrentmbox&#8221;: </p>
<pre>formail -I "X-label: yourlabel" >> mycurrentmbox</pre>
<p>Note that this will remove any other &#8220;X-label&#8221; headers, if present. Alternatively, you might want to check out the <code>-a</code> or <code>-i</code> options (<code>man formail</code>).</p>
<p>I have my mail in &#8220;maildir&#8221; format, where each mail is an individual file. I use a workaround: pipe all messages to formail, which adds the header, then append to a temporary &#8220;mbox&#8221; format, delete the original messages in the maildir, then move the messages from the temporary mbox to the original maildir.</p>
<p>In your original maildir, tag and pipe-message, then:</p>
<pre>formail -I "X-label: yourlabel" >> mytempmbox</pre>
<p>Optionally check that the labeled messages have arrived safely in your temporary mailbox, delete all the tagged (unlabeled) original messages, then go to your temporary mailbox with </p>
<pre>mutt -f mytempmbox</pre>
<p>tag all messages there, save tagged to the original mailbox. Delete the temporary mailbox.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/01/22/adding-an-x-label-header-to-lots-of-messages-at-once-using-mutt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
