Kevin Brubeck Unhammer writes: > Dmitry Alexandrov <321942@gmail.com> čálii: > >> Kevin Brubeck Unhammer writes: >> >>> I just tried using browse-url-mail as a mailto-handler with the below >>> script as my mail handler (set in XFCE settings): >>> >>> #!/bin/bash >>> mailto="${*//\"/}" >> >> ... >> >>> if [[ ! ${mailto} =~ ^mailto: ]]; then >>> mailto="mailto:${mailto}" >>> fi >> >> Does not xdg-email(1) already do that? > > No. Try 'echo "$@">/tmp/log' at the top of your mail script. I tried: --8<---------------cut here---------------start------------->8--- $ xdg-email --version xdg-email 1.1.0 rc1 $ cat /tmp/xdg-test #!/bin/bash echo "$@" > /tmp/xdg-test.log $ xdg-email foo@example.org $ cat /tmp/xdg-test.log mailto:foo@example.org --8<---------------cut here---------------end--------------->8--- >>> It seems to work with xdg-email, but when I use --attach to attach a >>> file, it just appears as an "Attach: /path/to/file" header instead of >>> the usual <#part thing. After sending, nothing is attached to the >>> received message that I can tell. Is there a way to make browse-url-mail >>> do the right thing, or to make message-mode treat that "Attach:" line >>> correctly? >> >> Try this: >> > > [...] > >> (Note, that I have virtually no experience with elisp, so use at your >> own risk. :-) > > That worked! And even handles multiple attachments correctly, even > though xdg-email uses multiple "attach" headers (which > https://tools.ietf.org/html/rfc6068#page-6 warns against). Maybe open a > bug report on this? It looks like an improvement to me. Hmm... Do you mean that I have to open a bug report? I am not familiar with GNU Emacs’ development customs, but a common sense suggests me that a feature request had better be filed by one who could ground its usefulness, while I hardy could. Anyway, I think it worth to change it a bit more in order to make it try to guess mime-type: