[Portland] Bug#574131: xdg-utils: xdg-email never launchs a mua if desktop is not gnome neither kde neither xfce

Jan Braun janbraun at gmx.de
Fri Oct 22 15:13:34 PDT 2010


Jonathan Nieder schrob:
> Interesting!  I like it.

Thanks!

> Nitpicks:

Also thanks! :)

>  - I think it would be good to call the envvar XDG_MAILER, because
>    (1) the mailer for use in the console may not be the mailer to
>    use on the desktop,

I considered that, but since there's no XDG_BROWSER and no XDG_EDITOR, I
figured there's no point in splitting MAILER/XDG_MAILER.
Particularly as switching MUAs is presumably more effort than switching
browsers or editors. ($PAGER is useless without a terminal, hence moot
here.)

Also, $BROWSER does (at least by some programs[1]) get parsed into a
list of colon-separated commands which are tried in order until the
first one succeeds, this we could do to $MAILER too. I didn't implement
that because:
a) My shell-fu is not good enough to survive the resulting quoting mess,
   I'd have to drop (jump?) to haskell/python for that.
b) If you really need that functionality, pointing MAILER at a shell
   script that iterates through the options isn't unreasonable IMHO.
But if someone feels the itch to implement it, I'd applaud that.

> and (2) it would be nice to leave open the
>    possibility of a MAILER variable along the lines of BROWSER with
>    more useful semantics in the future.

That's a good point, especially the "passing mail bodies via commandline
is a poor idea" argument.

But then again, there doesn't seem to be anyone likely to fight XDG over
standardization of such things, and my gut reaction was "It's an _old_
problem, no one has suggested anything substantially new for this for
over a decade, it just lies there waiting to be implemented, so just
give it the obvious name and be done with it."

Also, in the current proposal, the argument list of $MAILER necessarily
starts with "mailto:". If the programs being put in MAILER check that
and fail on unrecognized arguments, we have a way to introduce, up- and
downward-compatibly (by falling back to mailto: if necessary), any new
protocol we can find a unique name for.
(I realize that part was not a particularly compelling argument, and
wouldn't further object if you guys felt XDG_MAILER was the more
conservative/better approach and went with that. I'm just explaining why
I felt, and feel, that grabbing MAILER here and now is reasonable.)

>  - What happens if the mailer contains shell metacharacters?

I'd hope they get expanded, once, by a posix-compatible /bin/sh, but I'm
squeamish that way. Your
| eval "$XDG_MAILER" '"$@"'
looks as if it allows more evi^Wnifty quoting tricks than my mere
|  $XDG_MAILER "$1"
but I think the most important consideration would be to mimic existing
BROWSER/EDITOR behavior, assuming there's such a thing. Again, [1].

> See http://lists.freedesktop.org/archives/portland/2010-September/001135.html
> for a similar attempt (and please feel free to pick and choose what you
> like from it).

Thanks, and ditto for my code.

A quick sumary of the differences I see:
*) My approach prefers XDG_MAILER over the desktop environment's idea of
   a mailer. I feel that's the proper priority and important to get right.
*) Quoting, see above.
*) You wrote documentation. Awesome. :)

cheers,
    Jan

[1] Anyone know of a good documentation for BROWSER/EDITOR/VISUAL/PAGER?
A half-assed web search left me with the feeling that they're "well
known", i.e. not truly documented at all. Or possibly there's more info
in dead trees. Will have a look again tomorrow or sunday unless one of
you beats me to it. *crosses fingers*
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/portland/attachments/20101022/5f9296b3/attachment.pgp>


More information about the Portland mailing list