[Portland] RE: xdg-email BCC

Bastian, Waldo waldo.bastian at intel.com
Tue Jun 6 23:42:31 PDT 2006


>> Yes.. I think there is no doubt about the required capabilities. It's
>> more an issue of how to expose those capabilities in the command line
>> interface. Which of the following three forms should be supported?
>>
>> 1) xdg-email 'mailto:jwhite at codeweavers.com?subject=Logo contest&' \
>>           'body=Attached you find the logo for the contest.&' \
>>           'attachment=/tmp/logo.png&bcc=bastian at kde.org'
>>
>> 2) xdg-email --attachment /tmp/logo.png -bcc bastian at kde.org \
>>           'mailto:jwhite at codeweavers.com?subject=Logo contest&' \
>>           'body=Attached you find the logo for the contest.'
>>
>> 3) xdg-email --attachment /tmp/logo.png -bcc bastian at kde.org \
>>           --subject 'Logo contest' \
>>           --body 'Attached you find the logo for the contest.' \
>>           jwhite at codeweavers.com
>
>I have thought about these options as well and while I personally think
>that
>explicit commandline options for each part would be nice, it gets us
into
>the
>business of encoding.
>
>IMHO it boils down to how many dependencies we want to drag into
xdg-utils.
>Right now they are relatively simple scripts, mostly forwarding their
input
>to
>the desktop environments commandline tools.
>
>Recoding any arbitrary input into an URI suitable for passing on might
not
>be
>possible within the limits of the currently used script
interpreter/tools.
>If someone knows a way to do this within our scope, I'm in favor of (3)
as
>it
>would allow things like
>
>xdg-email --to person1 at domain.com --to person2 at domain.com --cc
>someone_less_important at otherdomain.com

Seems awk is our friend...
See
http://webcvs.freedesktop.org/portland/portland/xdg-utils/scripts/xdg-em
ail?rev=1.9&view=markup

Still needs a bit of polish (and I am midway updating the manpage)

In particular I would like to parse the mailto URL and throw out
everything that isn't to, cc, subject or body

Something like: split on "?" into a mailto:<address> part and
key=val&key2=val2&key3=val4 and then split the latter on "&" and throw
out everything that doesn't start with "to=", "cc=", "subject=" or
"body=" and then glue everything together again.

Other polish issue: I need to get rid of the trailing "&"

Anyone with a distro that isn't using utf8 as locale already that can
test the -utf8 option?

Waldo Bastian
Linux Client Architect - Client Linux Foundation Technology
Channel Platform Solutions Group
Intel Corporation - http://www.intel.com/go/linux
OSDL DTL Tech Board Chairman


More information about the Portland mailing list