241 lines
10 KiB
HTML
241 lines
10 KiB
HTML
<!DOCTYPE html>
|
||
<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Search your email! | duckland.org news</title>
|
||
<link href="../assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
|
||
<link rel="alternate" type="application/rss+xml" title="RSS" href="../rss.xml">
|
||
<link rel="canonical" href="http://www.duckland.org/posts/200905search-your-email.html">
|
||
<!--[if lt IE 9]><script src="../assets/js/html5.js"></script><![endif]--><meta name="author" content="Don Harper">
|
||
<link rel="prev" href="200904wifiroamd-intel-prowireless-3945abg-and-fedora.html" title="wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora" type="text/html">
|
||
<link rel="next" href="200912making-life-easy-over-flaky-links.html" title="Making life easy over flaky links" type="text/html">
|
||
<meta property="og:site_name" content="duckland.org news">
|
||
<meta property="og:title" content="Search your email!">
|
||
<meta property="og:url" content="http://www.duckland.org/posts/200905search-your-email.html">
|
||
<meta property="og:description" content="Search your email!
|
||
|
||
One of the features that most of the pretty GUI mailers offer you is the ability to search your email. While this is not a feature I use regularly, it is one which when you need it">
|
||
<meta property="og:type" content="article">
|
||
<meta property="article:published_time" content="2009-05-25T18:05:00-05:00">
|
||
<meta property="article:tag" content="cli">
|
||
<meta property="article:tag" content="email">
|
||
<meta property="article:tag" content="search">
|
||
<meta property="article:tag" content="software">
|
||
</head>
|
||
<body>
|
||
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
|
||
|
||
<!-- Menubar -->
|
||
|
||
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><div class="container">
|
||
<!-- This keeps the margins nice -->
|
||
<div class="navbar-header">
|
||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
|
||
<span class="sr-only">Toggle navigation</span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
</button>
|
||
<a class="navbar-brand" href="http://www.duckland.org/">
|
||
|
||
<span id="blog-title">duckland.org news</span>
|
||
</a>
|
||
</div>
|
||
<!-- /.navbar-header -->
|
||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||
<ul class="nav navbar-nav">
|
||
<li>
|
||
<a href="../index.html">Home</a>
|
||
</li>
|
||
<li>
|
||
<a href="../stories/about.html">About me</a>
|
||
</li>
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">My Sites<b class="caret"></b></a>
|
||
<ul class="dropdown-menu">
|
||
<li>
|
||
<a href="http://www.donaldharper.com">My Photo Blog</a>
|
||
</li>
|
||
<li>
|
||
<a href="http://p365.donaldharper.com">My Attempt at a Project 365</a>
|
||
</li>
|
||
<li>
|
||
<a href="http://www.duckland.org">My Personal and Tech Blog</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="dropdown">
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Social Sites<b class="caret"></b></a>
|
||
<ul class="dropdown-menu">
|
||
<li>
|
||
<a href="https://twitter.com/duckunix">My Twitter</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://plus.google.com/+DonHarper/">My Google+</a>
|
||
</li>
|
||
<li>
|
||
<a href="http://www.linkedin.com/in/donaldharper/">My LinkedIN</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<a href="../archive.html">Archive</a>
|
||
</li>
|
||
<li>
|
||
<a href="../categories/index.html">Tags</a>
|
||
</li>
|
||
<li>
|
||
<a href="../rss.xml">RSS</a>
|
||
|
||
|
||
</li>
|
||
</ul>
|
||
<ul class="nav navbar-nav navbar-right"></ul>
|
||
</div>
|
||
<!-- /.navbar-collapse -->
|
||
</div>
|
||
<!-- /.container -->
|
||
</nav><!-- End of Menubar --><div class="container" id="content">
|
||
<div class="body-content">
|
||
<!--Body content-->
|
||
<div class="row">
|
||
|
||
|
||
<article class="post-text h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article"><header><h1 class="p-name entry-title" itemprop="headline name"><a href="#" class="u-url">Search your email!</a></h1>
|
||
|
||
<div class="metadata">
|
||
<p class="byline author vcard"><span class="byline-name fn">Don Harper</span></p>
|
||
<p class="dateline"><a href="#" rel="bookmark"><time class="published dt-published" datetime="2009-05-25T18:05:00-05:00" itemprop="datePublished" title="2009-05-25">2009-05-25</time></a></p>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</header><div class="e-content entry-content" itemprop="articleBody text">
|
||
<h1>Search your email!</h1>
|
||
|
||
<p>One of the features that most of the pretty GUI mailers offer you is the ability to search your email. While this is not a feature I use regularly, it is one which when you need it, you really need it. I have used <a href="http://grepmail.sf.net">grepmail</a> in the past, but it slow for me (it scans the mail files every time) and the big thing for me is that is only supports <a href="http://en.wikipedia.org/wiki/Mbox">mbox</a> files, and I use <a href="http://en.wikipedia.org/wiki/Maildir">maildir</a> since I use <a href="http://software.complete.org/software/projects/show/offlineimap">offlineimap</a>.</p>
|
||
|
||
<p>I recently found <a href="http://www.rpcurnow.force9.co.uk/mairix/">mairix</a>. While I have not been using it long, so far I am very impressed with it. It uses an index to speed up the search process, and it smartly adds only new or changed files to the index. The first indexing run was only a few seconds on my archive of almost 15,000 mail messages. I have it scheduled to update the index every 15 minutes, and I never notice the load this will put on the system.</p>
|
||
|
||
<p>To integrated mairix with mutt, I wrote a quick little script to search from within (or without) mutt:</p>
|
||
|
||
<pre><code>#!/bin/bash
|
||
#===============================================================================
|
||
#
|
||
# FILE: mailsearch.sh
|
||
#
|
||
# USAGE: ./mailsearch.sh
|
||
#
|
||
# DESCRIPTION: search mail stuff
|
||
#
|
||
# OPTIONS: ---
|
||
# REQUIREMENTS: ---
|
||
# BUGS: ---
|
||
# NOTES: ---
|
||
# AUTHOR: Don Harper (), duck@duckland.org
|
||
# COMPANY: Don Harper
|
||
# VERSION: 1.0
|
||
# CREATED: 05/25/2009 07:03:30 PM CST
|
||
# REVISION: ---
|
||
#===============================================================================
|
||
|
||
rm -rf $HOME/Maildir/mfolder
|
||
echo " t::word
|
||
Match word in the To: header.
|
||
c::word
|
||
Match word in the Cc: header.
|
||
f::word
|
||
Match word in the From: header.
|
||
s::word
|
||
Match word in the Subject: header.
|
||
m::word
|
||
Match word in the Message-ID: header.
|
||
b::word
|
||
Match word in the message body.
|
||
d::[start-datespec]--[end-datespec]
|
||
Match messages with Date: headers lying in the specific range.
|
||
z::[low-size]--[high-size]
|
||
Match messages whose size lies in the specified range.
|
||
n::word
|
||
Match word occurring as the name of an attachment in the mes-
|
||
sage. Since attachment names are usually long, this option
|
||
F::flags
|
||
Match messages with particular flag settings.
|
||
s meaning seen,
|
||
r meaning replied
|
||
f meaning flags
|
||
prefixed by a - to negate its sense.
|
||
|
||
The a:: search pattern is an abbreviation for tcf:
|
||
|
||
Match words
|
||
The word argument to the search strings can take various forms.
|
||
~word
|
||
Match messages not containing the word.
|
||
word1,word2
|
||
This matches if both the words are matched in the specified message part.
|
||
word1/word2
|
||
This matches if either of the words are matched in the specified message part.
|
||
substring=
|
||
Match any word containing substring as a substring
|
||
substring=N
|
||
Match any word containing substring, allowing up to N errors in
|
||
the match. For example, if N is 1, a single error is allowed,
|
||
where an error can be
|
||
* a missing letter
|
||
* an extra letter
|
||
* a different letter.
|
||
^substring=
|
||
Match any word containing substring as a substring, with the
|
||
requirement that substring occurs at the beginning of the
|
||
matched word.
|
||
d::start-end
|
||
Specify both start and end explicitly
|
||
"
|
||
echo -n "Enter your search string: "
|
||
read string
|
||
mairix $string
|
||
mutt -f=mfolder
|
||
rm -rf $HOME/Maildir/mfolder
|
||
</code></pre>
|
||
|
||
<p>Then, I bound this to “S'’ from within mutt:</p>
|
||
|
||
<pre><code> macro index,pager S "!mailsearch\n"
|
||
</code></pre>
|
||
|
||
<p>This will give me a reminder of the search command, run the search, and then give me the search results in a new mutt session.</p>
|
||
</div>
|
||
<aside class="postpromonav"><nav><ul itemprop="keywords" class="tags">
|
||
<li><a class="tag p-category" href="../categories/cli.html" rel="tag">cli</a></li>
|
||
<li><a class="tag p-category" href="../categories/email.html" rel="tag">email</a></li>
|
||
<li><a class="tag p-category" href="../categories/search.html" rel="tag">search</a></li>
|
||
<li><a class="tag p-category" href="../categories/software.html" rel="tag">software</a></li>
|
||
</ul>
|
||
<ul class="pager">
|
||
<li class="previous">
|
||
<a href="200904wifiroamd-intel-prowireless-3945abg-and-fedora.html" rel="prev" title="wifiroamd, Intel PRO/Wireless 3945ABG, and Fedora">Previous post</a>
|
||
</li>
|
||
<li class="next">
|
||
<a href="200912making-life-easy-over-flaky-links.html" rel="next" title="Making life easy over flaky links">Next post</a>
|
||
</li>
|
||
</ul></nav></aside></article>
|
||
</div>
|
||
<!--End of body content-->
|
||
|
||
<footer>
|
||
Contents © 2015 <a href="mailto:duck@duckland.org">Don Harper</a> - Powered by <a href="http://getnikola.com" rel="nofollow">Nikola</a>
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<script src="../assets/js/all-nocdn.js"></script><script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script><!-- fancy dates --><script>
|
||
moment.locale("");
|
||
fancydates(1, "YYYY-MM-DD");
|
||
</script><!-- end fancy dates -->
|
||
</body>
|
||
</html>
|