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

Re: viewing attached mbox



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday, December  4 at 05:49 PM, quoth James:
> It works quite well except I have to save the attachment and run a 
> new mutt session on the resulting mbox.

M'kay, this should be relatively easy, provided that...

> mutt see the mbox attachment as type us-ascii.  It's usually 
> labelled 'search' or some such with no extension or anything 
> (presumably by whatever bit of lisp he's using to generate the 
> mbox).

Oop. That makes things more difficult. What you need is some way to 
determine that it's a unique type of file to which you can then add an 
entry to your mailcap file that says "run mutt on it".

For example, if his email complied with RFC 4155, that mbox should be 
labeled as type application/mbox. Then it's as easy as adding an entry 
to your ~/.mailcap file that looks like this:

    application/mbox; mutt -f %s; needsterminal; copiousoutput;

If it had an extension, all you'd have to do is add the above line to 
your mailcap and another line to your mime.types file that looks like 
this:

    application/mbox .mbox # or whatever extension you like

Other than kvetching to your boss and encouraging him to make it 
easier, one option is to use procmail (or some other sort of delivery 
filter) to automatically change his emails so that his attachments get 
properly labelled. That's probably more trouble (and harder) than it's 
worth, though.

In the absence of some sort of identification like that, your options 
are kinda limited. Probably the best you can do is create a special 
key that triggers a macro to do some reasonable things. For example:

macro browser V '<save-entry>/tmp/mboxfile<enter>\
    <shell-escape>mutt -f /tmp/mboxfile && rm /tmp/mboxfile<enter>'

> I'd like to just hit return to fire a new mutt instance to read the 
> mbox, just like I would with any other attachment.

Yeah... that's gonna be tricky. From what you describe, he's using a 
completely illegal mime-type "us-ascii" to begin with. Mime types are 
required to be "something/something". If you can talk him into at 
least providing *some* mime-type, you can add a line to your mailcap 
to make it launch mutt for that type. Beware if he sends it with the 
*wrong* type, though---adding incorrect entries to your mailcap file 
may make it difficult to view emails that are *correctly* written.

~Kyle
- -- 
Unthinking respect for authority is the greatest enemy of truth.
                                                    -- Albert Einstein
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFFdLe5BkIOoMqOI14RAof9AJwNl+P6b1G5qYhCBSeoeYALZFIGVACgmXdK
SOvEUbp4t0OCiBkQrFnarlM=
=4gjn
-----END PGP SIGNATURE-----