nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] whatnow: can't attach because no header field name was given.

2012-03-15 03:35:54
"Ronald F. Guilmette" writes:
In message 
<4f619a7c(_dot_)c2093c0a(_dot_)4c8b(_dot_)2f76(_at_)mx(_dot_)google(_dot_)com>,
 you wrote:

"Ronald F. Guilmette" writes:
Sorry.  I feel sure that this must be an FAQ, but how does one get this
message to go away, you know, so that I can actually send an attachment?

Try in .mh_profile:

send: -attach X-MH-Attachment
whatnow: -attach X-MH-Attachment

I actually only found out about this very recently by searching the lists.

Ummm... Well, now at least the failure message is different...

     What now? attach four-leaf.jpg
     
     What now? s
     mhbuild: draft shouldn't contain MIME-Version: field
     
     What now? 

You're probably mime-ifying the message somehow (maybe in your profile).
I get the same results if I manually mime-ify:


$ comp

What now? mime

What now? attach /tmp/foo

What now? send
mhbuild: draft shouldn't contain MIME-Version: field


If I don't run mime, it goes through fine.


P.S.  After trying your suggested fix, I realized that I wasn't sure if
you meant that I should put the "-attach X-MH-Attachment" option on the
send: or on the whatnow: or on both.

Both lines go in .mh_profile.

When the option is appended to only to the send: it seems to have no effect
and I still get the "can't attach because no header field name was given."
message.

Right. When you use "attach" in whatnow, this header gets added to the draft:

X-MH-Attachment: /tmp/foo

If you don't have "-attach X-MH-Attachment", whatnow doesn't know what
header to put in and errors out. This isn't documented in the whatnow(1)
manpage at all, unfortunately.

 When I attached it only to the whatnow: everything _seemed_ to
work, but the e-mail message, when delivered, actually had no attachment
whatsoever. :-(

Because send isn't told to look for a header, and thus doesn't perform the
replacement described in the man page. From send(1):

       If a header-field-name is supplied using the -attach option, the draft
       is scanned for a header whose field name matches the supplied header-
       field-name.  The draft is converted to a MIME message if one or more
       matches are found.  This conversion occurs before all other processing.

Full disclosure:  I am using NMH version 1.3.  Alas, version 1.4 has not
been ported to FreeBSD yet.  (Is this the real root of the problem?)

I'm on 1.4 (it's in OpenBSD ports), but I believe it works in previous
versions too. The mailing list posts were several years old...

--
Anthony J. Bentley

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>