notmuch-web: A web interface to the notmuch email indexer

[ library, web ] [ Propose Tags ]

An email client for the notmuch email indexer (http://notmuchmail.org), built using Yesod. This project implements a web server and uses bootstrap and jquery for the UI. The client is fully functional, with searching, viewing, and composing email messages.


[Skip to Readme]

Modules

[Last Documentation]

  • Application
  • Foundation
  • Handler
    • Handler.Compose
    • Handler.Home
    • Handler.Pager
    • Handler.Raw
    • Handler.Tags
    • Handler.View
  • Import
  • NotmuchCmd
  • Settings
  • StaticFiles

Flags

Automatic Flags
NameDescriptionDefault
dev

Turn on development settings, like auto-reload templates.

Disabled
library-only

Build for use with "yesod devel"

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.0.1, 0.1.1, 0.1.2, 0.1.2.1, 0.2.0
Dependencies aeson, attoparsec, attoparsec-conduit, base (>=4 && <5), blaze-builder, blaze-markup, bytestring, case-insensitive, clientsession, conduit, containers, data-default, directory, email-validate, filepath, hamlet, hjsmin, http-conduit, http-types, lifted-base, mime-mail, monad-control, notmuch-web, old-locale, process, process-conduit (>=0.5 && <0.6), pwstore-fast, random, shakespeare-css, shakespeare-js, shakespeare-text, template-haskell, text, time, transformers, unordered-containers, vector, wai, wai-extra, warp, yaml, yesod, yesod-auth, yesod-core, yesod-default, yesod-form, yesod-platform (>=1.1.6 && <1.2), yesod-static [details]
License LicenseRef-GPL
Author John Lenz <lenz@math.uic.edu>
Maintainer John Lenz <lenz@math.uic.edu>
Category Web
Home page https://bitbucket.org/wuzzeb/notmuch-web
Source repo head: hg clone https://bitbucket.org/wuzzeb/notmuch-web
Uploaded by JohnLenz at 2013-03-08T04:03:54Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables notmuch-web
Downloads 4640 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-21 [all 6 reports]

Readme for notmuch-web-0.1.0.1

[back to package description]

Notmuch Web Client

This project is an email client for notmuch written in Haskell and Yesod. The code implements a web server and uses bootstrap and jquery for the UI. The current features are

  • Search messages
    • link default searches from the navigation bar
    • view results in a table, with customizable buttons for retagging each thread
    • view results in a pager, which shows the thread content together with a navigation bar with "Next" button plus tagging buttons.
    • Opensearch.xml integration, so you can add notmuch-web as a search engine to your web browser.
  • View individual threads
    • a visible tree structure and the ability to collapse individual messages
    • download attachments from messages
    • customizable tagging buttons on each message
  • Compose email
    • sending with attachments
    • supports reply and reply all
  • Execute a raw notmuch command and view the results

Install

Binaries

One nice feature of GHC (the Haskell compiler) is the ability to statically link binaries to not require Haskell to be installed. I have therefore built the latest release; you can find the tarballs on the download page. The only prerequisites are glibc, libgmp, and zlib.

Source, latest released version

To compile the latest release from source, install the Haskell Platform, run "cabal update", then run "cabal install notmuch-web". This will install the latest release from hackage. The binary will then appear at ~/.cabal/bin/notmuch-web and the configuration files (see below) are in ~/.cabal/share/notmuch-web-version

Source, from bitbucket

To compile from bitbucket, install the Haskell Platform, run "cabal update", then run "cabal install yesod-platform". Next, clone from bitbucket and within the notmuch-web directory, run "cabal install --only-dependencies". You can now run "yesod devel" to start the development server or use the package.sh script to build a tarball.

Keter

Although I haven't used it, you might investigate keter for automatic building and deployment. See this blog post and this one for more information.

Configuration

When launching the notmuch-web binary, it expects several files to be located in two subdirectories of the current directory. No other configuration or install is needed, so you can copy the notmuch-web binary and these two folders anywhere, even deploy on computers with no Haskell installed.

First, an unmodified copy of the "static" folder must be in the current directory. The "static/tmp" directory can be periodically cleared, it is used to speed up serving of generated javascript and css (by using the sendfile syscall). If the files in static/tmp don't exist notmuch-web will create them, so it is helpful to clean out "static/tmp" after an upgrade. The other subfolders and files in static must be left unchanged.

Second, a (modified) copy of the "config" folder must be in the current directory. The config folder must contain:

  • robots.txt - this file is served as robots.txt as the root and by default denies all search engines. You can edit to your taste.
  • favicon.ico - this is served as the favicon and defaults to the notmuch favicon. You can replace with your own icon if you like.
  • client_session_key.aes - notmuch-web uses AES encrypted cookies to store session information and the AES key is stored in this file. If the file does not exist a new key is randomly generated and placed in this file. Make sure you keep this file private.
  • settings.yml - the yaml file containing all the configuration. The binary tarballs contain a file settings.yml.example which should be copied to settings.yml. See the next section for the settings.

Settings

notmuch-web has four modes: Development, Testing, Staging, and Production. The mode is specified on the command line when launching notmuch-web. The settings.yml file is split into four sections, one for each mode and notmuch-web will only load settings from the matching section of settings.yml. Using yaml references a collection of default settings are copied into each section of the configuration.

The default settings.yml file is well commented so I won't explain it here. The only required setting that must be edited before notmuch-web will run is "hashed-password", the hash of the password to access (see pwstore for the format). You can generate the hashed password by running "notmuch-web --make-password". Other settings like "from-address" and "approot" should be set as well for proper operation.

Running

To run, execute "notmuch-web Production". This will start the server listening on the configured port. notmuch-web accesses notmuch by launching the "notmuch" binary found in the PATH, so you must make sure the user running notmuch-web has notmuch in the PATH, is able to access the email directory, and has a valid notmuch configuration. You might need to set the NOTMUCH_CONFIG environment variable before launching notmuch-web.

I use a systemd unit to start notmuch-web as my login user at boot, having notmuch-web listen on port 3000. I then run nginx with SSL on port 443, and have nginx reverse proxy to notmuch-web.

SSL

Currently, notmuch-web does not implement SSL (although since Yesod/Warp supports SSL we could support it without too much work so it is on the TODO list). Therefore, you will want to reverse-proxy notmuch-web. I use nginx.