nmh-workers
[Top] [All Lists]

[Nmh-workers] Conflict between "mime" command and attach

2013-12-05 14:57:40
The final piece to making MIME encoding happen by default to simply run
it at send(1) time (really post(8)).  But as always, there's a slight wrinkle.

Right now we have two basic ways of doing attaching files; you can use
the attach command at the "What now?" prompt, or put in mhbuild(1) directives
and execute mhbuild via the "mime" command at the What now? prompt.  But
these two things don't place nicely together.

First off, I already know some people don't like attach, and some people
don't like writing mhbuild directives.  That's fine ... I think both
approaches are valid and each has their positives and negatives.  I can
probably already recite the arguments made by everyone here, so there's
no need to rehash them now :-)  I'm more concerned about technical details.

The way that attach works is that when you mark a file to be attached,
it ends up with a special header in the message.  post(8) sees this header
and constructs mhbuild directives and runs it for you.  That works fine.

The way the "mime" command works is that it just runs mhbuild for you; any
mhbuild directives in the draft end up being processed to build the
final draft.

As an additional wrinkle, we now always want to run mhbuild automatically,
which would (in theory) use a not-yet-written flag called "-auto" to
make it exit silently if the draft always has a MIME-Version header.

The basic problem today is that if you use "attach" it will interfere with
the "mime" command; the mhbuild invocation will run as part of the
"mime" command, and when post(8) goes to run mhbuild for the attach command
headers you'll get an error (because it will get an error because it's
already been MIME-ified).

So it seems to be the right approach is to lock out both "attach" and
"mime" at WhatNow? time; you can either do one or the other, but not
both.  That's relatively straightforward.  So the logic would be:

In WhatNow?

- If you run "mime", run mhbuild on the draft.  Do not run if there's
  a Nmh-Attachment header.
- If you "attach", add the appropriate header.  Do not do this if there
  is a MIME-Version header.

In post(8):

- If there's a Nmh-attachment header, construct the mhbuild directives and
  run mhbuild.
- Otherwise, run "mhbuild -auto -nodirectives".
  (-auto will cause it to silently exit if there's a MIME-Version header;
   -nodirectives will cause it to ignore directives by default unless they're
   explicitly enabled).

Thoughts?

--Ken

_______________________________________________
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>