h4ck3r+=boi v 2.0

  1. Search
  2. About
  3. Subscribe
  4. Archive
  5. Random
  1. Posts about Rails
  2. Posts about Python
  3. Posts about Agile
  4. Posts about development
  5. Posts about startups

h4ck3r+=boi v 2.0

Newer
Older
  • Attaching files to Mutt messages

    I moved to the Mutt email client in mid 2011. I wrote up some tips and tricks for using Mutt and OS X.

    The interesting and somewhat annoying thing about Mutt is that sometimes features are so well hidden you only hear whispers and rumors about them.

    This is one of those times.

    Goal: Attach files to an email message without using Mutt’s file browser

    Mutt’s has a built-in file browser which it uses to select mailboxes, save attachments, and attach files to the current outgoing message.

    The reality of email in 2012 is that we’re attaching files to messages a lot. Ok, maybe “several times a week”, but hey, we’re on OS X - I don’t want to select files using some console interface.

    Mutt has a solution: the Attach pseudo header

    One of the “whispers and rumors” features of Mutt is the Attach pseudo header.

    When it calls your editor of choice Mutt lets you edit the email headers of that message. This feature is the basis of the Attach pseudo header.

    First, to get this to work, you must have edit_headers set to yes.

    With edit_headers set, when you open your editor you’ll see From, To, Subject etc.

    Deep in the Mutt documentation (manual section 2 subsection 2.4, second sub-sub section it talks about the Attach: header.

    So, here’s how you use this:

    1. Create a new message or reply to an existing one in Mutt. This will trigger your editor
    2. If you want to attach a message, directly underneath the last header data you see, add a new new line that starts with Attach:. Insert the path to the file to attach to the message.

    Example of Attach in use

    From: Ryan Wilcox <ryan@example.com>
    To: bob@example.com
    Cc: 
    Bcc: 
    Subject: Hello world
    Reply-To: 
    Attach: ~/Documents/the.doc
    

    When you exit your editor the.doc will be attached to your message: you should see it in the attachment list in the Mutt outgoing message view.

    About whitespace

    Like pretty much every Unix utility, Mutt’s Attach feature doesn’t handle whitespace in filenames. You must escape this whitespace using the \ character.

    Tagged: mutt

    Posted on August 9, 2012

  • staff

Field Notes Theme. Designed by Manasto Jones. Powered by Tumblr.