W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

RE: Sending e-mails from a pipeline...

From: Geert Josten <geert.josten@dayon.nl>
Date: Wed, 16 Nov 2011 13:34:42 +0100
Message-ID: <6e8bf496d85a340062425bb62ae04f22@mail.gmail.com>
To: Norman Walsh <ndw@nwalsh.com>, XProc Dev <xproc-dev@w3.org>
The em:content tag isn't suited for RTF nor HTML indeed, but if you would
come up with an xml syntax of your own, I am sure one would be able to fit
it in nicely. Or just as a c:data if necessary. Content-id's could be
derived from base-uri's perhaps?

PS: all those various namespaces, looks just too silly to me. Why not a
c:message syntax of our own? Anyone using em/rf will just have to
transform it.. ;-)

-----Oorspronkelijk bericht-----
Van: Norman Walsh [mailto:ndw@nwalsh.com]
Verzonden: woensdag 16 november 2011 13:19
Aan: XProc Dev
Onderwerp: Re: Sending e-mails from a pipeline...

Geert Josten <geert.josten@dayon.nl> writes:
> Is MIME something a user needs to care about? (i.e. isn't that something
> that can be shielded from the user?)

If you make the simplifying assumption that you only care about plain
text or HTML, single part messages, then it's fairly easy (leaving the
underlying configuration that David mentioned off the table for the

<cx:send-mail xmlns:em="URN:ietf:params:email-xml:"
  <p:input port="source">
    <p:inline exclude-inline-prefixes="em rf cx">
        <rf:subject>Sample Plain Text Email</rf:subject>
            <em:name>Norman Walsh</em:name>
            <em:name>Norman Walsh</em:name>
        <em:content>Hello World</em:content>

And Murray is right, maybe this is the 80/20 or even 90/10 case and we
could stop there. But the engineer in me can't resist at least
exploring 80-90 percent of the remaining 10-20 percent :-)

Consider this pipeline fragment:

<p:identity name="jpg">
  <p:input port="source">
    <p:data href="/Users/ndw/Documents/Graphics/Avatars/Avatar-16.jpg"/>

<p:identity name="log">
  <p:input port="source">
    <p:data href="/var/log/application/error.log"/>

<cx:send-mail xmlns:em="URN:ietf:params:email-xml:"
  <p:input port="source">
    <p:inline exclude-inline-prefixes="em rf cx">
        <rf:subject>Process failure</rf:subject>
Processing this image caused an error in operations.</em:content>
    <p:pipe step="jpg" port="result"/>
    <p:pipe step="log" port="result"/>

That's supposed to send the text email with two attachments.
the mail infrastructure needs to know (at least) the content-type and
content-disposition of each of the attachments.

Maybe 80-90 percent of the remaining 10-20 percent is simply to make a
best guess at the content type and send them as attachments. In this
case, that works out ok. Probably. The c:data element for the image
will include the content-type image/jpeg so that'll be ok. The log
file might or might not have a content-type, but if it doesn't
application/octet-stream is a plausible default.

If we wanted to go even further, I think we'd have to do content
inspection and transformation that I think is firmly in the last few
percent. (I'm thinking of the case where an HTML message is sent that
contains an img element; if you want the mail client to display the
image inline, you have to use content-id and do other things that must
be described in some spec I've never read.)

                                        Be seeing you,

Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 413 624 6676
Received on Wednesday, 16 November 2011 12:35:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:09 UTC