<<< Date Index >>>     <<< Thread Index >>>

Re: Attachment reminders



On 30Nov2006 22:44, Todd Zullinger <tmz@xxxxxxxxx> wrote:
| As happens to me every so often, I sent out a message today where I
| meant to attach a file but after editing I was too quick hitting send.
| This doesn't happen frequently, but it still got me looking at ways to
| make it happen even less.
| To that end I poked on the wiki and found
| http://wiki.mutt.org/?ConfigTricks/CheckAttach.
| 
| I would implement something like this, but it wouldn't do me a lot of
| good when the message that I'm sending is encrypted as grepping for
| attach in the message body tends to fail for encrypted text. :)  [This
| was the case today that spurred my interest.]
| 
| My next thought was to do something similar except using $editor for
| the attachment checking script instead of $sendmail.  This too has
| limitations and I'm wondering if it's possible to overcome them.
| 
| I have editor set to a script that first calls my real editor and then
| greps the message after the editor exits.  If the message contains the
| regex '\battach' it will spit out a reminder to actually attach a
| file.
| 
| Is there a way to call the attach-file function automatically instead
| of just printing a nag?

Well, you can queue an attachment from _inside_ the editor.
If you have edit_headers=yes you can add a header. Adding an "Attach:"
header with a file pathname will cause mutt to attach it when you save
and exit the editor.

To make this convenient, I have ctrl-A in my editor (vi) mapped to:

1G}-:.r!exec </dev/tty 2>/dev/tty; readline 'Attach: '<CR>IAttach: <Esc>

Those are real Enter and Escape codes, BTW. This prepares an Attach:
header, calling readline to let you enter the filename with file
completion. "readline"'s a little bash script I have:

  http://www.cskk.ezoshosting.com/cs/css/bin/readline

Anyway, that lets you do an attachment conveniently before leaving the
editor.

| Is there a way to check if I've already attached a file and skip the
| nag and or attach-file call?

grep for a "Content-Type: multipart/mixed"? Or is this not available
post encryption?
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

When you say `I wrote a program that crashed Windows', people just stare at
you blankly and say `Hey, I got those with the system, *for free*'.
        - Linus Torvalds