[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?
From: |
Jon Steinhart |
Subject: |
Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach? |
Date: |
Sun, 15 Dec 2013 09:12:08 -0800 |
David Levine writes:
> Paul F. wrote:
>
> > how do i use whatnow's attach to attach a file, like a mail
> > message, with a specific Content-Type? i.e., if i use this:
> > Nmh-Attachment: /home/pgf/Mail/inbox/2902
> > i get a Content-Type of text/plain rather than message/rfc822
>
> I've been thinking about this. It's possible, though maybe
> a bit tricky, to determine if the file is a message in the
> user's MH folders. If it is, should attach set the
> Content-Type for the part to message/rfc822?
>
> For that determination, one way might be based on the full
> path to the file, which attach already finds. We could
> iterate over the directory portion of that path, starting
> from the bottom and adding one level each time. If
> "mhpath +dir filename" succeeds and if the inodes of the
> files match, then that file is an MH message.
>
> David
Going from memory here (instead of the source code). The attach code
uses the "file" command to determine the content type. And, of course,
one of the reasons that I use nmh is that the messages are plain text
files.
Oh! Just looked at the file man page, and someone has added a --mime
option that does the right thing and recognizes messages in ascii text.
So I'd simply change the attach code to use file --mime and maybe get
rid of some of the stuff that I originally put in there to create mime
types from collected information.
Note that it even plugs in the charset. So maybe this is a simple
short-term solution to the whole discussion. Even though I'm swamped
at the moment I can probably find time to make this change if it's
agreeable.
Jon
- [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/15
- Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/15
- Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/15
- Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/22
- Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/22
- Re: [Nmh-workers] message/rfc822 C-T and whatnow's attach?, David Levine, 2013/12/22