AttachCheck

Author: Benjamin Mako Hill <mako@atdot.cc>
Date: Sun, 12 Apr 2009 17:51:04 -0400
Copyright: GNU General Public License version 3

How many times have you said, "I've attached the file below," and then failed to actually attach the file? It happens to even the best of us.

AtttachCheck is a program that seeks to end this forever. AttachCheck looks through all outgoing mail. If it expects an attachment and doesn't see one, it refuses to send it until you confirm that you really want to send the message sans attachment.

AttachCheck It was written in Benjamin Mako Hill. You can find the latest version of this program, more information, and some of Mako's sometime accidentally insightful or useful ideas at his eponymous homepage at: http://mako.cc

The AttachCheck website with the latest version of the program is always available here: http://mako.cc/projects/attachcheck/

The latest version of source code is kepted in a Git repository at http://projects.mako.cc/source/attachcheck and can be checked out or branched with the command:

git clone http://projects.mako.cc/source/attachcheck/.git

Prerequisites

If you use OutLook and Windows, I found a similar program for that setup: http://www.danevans.co.uk/vba/

How AttachCheck Works

AttachCheck monitors outgoing mail for keywords. It expects attachment if it finds a text-based attachment if it finds one of the following words:

If you can think of other words (in any language) that are indicative of attachments, please contact the author of the program so others can benefit as well.

AttachCheck is basically just a wrapper for your mail transfer agent (MTA). It takes mail on STDIN, checks it, and then passes it on to your real MTA or exits with an error if there is no attachment and it expects.

Sometimes you may talk about attachments when you don't include any. AttachCheck will stop you in these cases but you'll need to confirm/override it by hand. This can be one in one of two ways:

  1. Adding the word "CONFIRM" in all capital letters in the beginning of the subject line of your outgoing mail. AttachCheck will remove the word when the mail is sent.
  2. Adding a special header that like this: X-AttachCheck-Override: Yes

Enabling AttachCheck in Mutt

AttachCheck was written for and tested with Mutt and it works great under that client. I got AttachCheck working by adding the following two lines to my muttrc file:

set sendmail='~/bin/attachcheck'
macro compose \e0 ':set editor="~/bin/attachcheck_add_override"<enter>e:set editor=vim<enter>'

This will set up the sendmail wrapper so that attachcheck is used and then set up a macro bound to a key (in this case META-0) that will add the override line into your mail with a single keystroke.

You'll of course want to customize these lines to include your editor choice and to include the actual path of attachcheck and the attachcheck_add_override.

Copyright / Information

copyright (c) 2004-2009 Benjamin Mako Hill <mako@atdot.cc>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. It is also distributed in full with AttachCheck in the COPYING file.