From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18288 Path: news.gmane.org!not-for-mail From: Dmitry Alexandrov <321942@gmail.com> Newsgroups: gmane.emacs.gnus.user Subject: Re: xdg-email vs browse-url-mail Date: Fri, 15 Jul 2016 21:29:29 +0300 Message-ID: <87wpkmdaba.fsf@gmail.com> References: <874m7sfkne.fsf@fsfe.org> <87r3awc4fo.fsf@gmail.com> <87zipj8fpk.fsf@fsfe.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1468607386 23687 80.91.229.3 (15 Jul 2016 18:29:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2016 18:29:46 +0000 (UTC) Cc: info-gnus-english@gnu.org To: Kevin Brubeck Unhammer Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Jul 15 20:29:33 2016 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bO7rf-0001rV-D3 for gegu-info-gnus-english@m.gmane.org; Fri, 15 Jul 2016 20:29:31 +0200 Original-Received: from localhost ([::1]:34315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO7re-00069k-MF for gegu-info-gnus-english@m.gmane.org; Fri, 15 Jul 2016 14:29:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <321942@gmail.com>) id 1bO7rb-00061G-Q8 for info-gnus-english@gnu.org; Fri, 15 Jul 2016 14:29:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <321942@gmail.com>) id 1bO7rW-0004z2-O3 for info-gnus-english@gnu.org; Fri, 15 Jul 2016 14:29:26 -0400 Original-Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:35560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <321942@gmail.com>) id 1bO7rW-0004yy-AP for info-gnus-english@gnu.org; Fri, 15 Jul 2016 14:29:22 -0400 Original-Received: by mail-lf0-x233.google.com with SMTP id f93so93960333lfi.2 for ; Fri, 15 Jul 2016 11:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:mail-copies-to :date:message-id:mime-version; bh=eyyJSWKRLpL7J86KS0yYunTItg5ixv+apBt2DcHDY0M=; b=wBv+qkWdjZVjq5kbojgFSlQLySucdSj/A3R/l3Op8EuO3bLWkL8vkoLIRABnSuMedt 242Pkxy/5twQVzU6BAjfkxGeweQhgBUnCZ5yPJ99n+vezA0Bu527NtO+kCZjriI3mEGV SJaqZiX66IN0B8tti0gzBmSm53cxsfVdK168LvFsfZ+qxbhm8cFMhYFtqb4tVpgR0xUE SF3JRV/Ae/1JZZ7b5h96wlAzgNkdcz0YUJQsQwiwix1X8wB2SORINSSSJv6PmRllxorz 5sJP96uzTyCSwZqxv5rnXrOMbx+Q4r1v2Jpw79v2iktICP0K+G9CaI9PZg5F1e0sB08t gxPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:mail-copies-to:date:message-id:mime-version; bh=eyyJSWKRLpL7J86KS0yYunTItg5ixv+apBt2DcHDY0M=; b=gdwt7j33/cwHYXS3GXY1yHwiL8MlIww0A1FavY/C9JPv+nXFgJfgeUJCLMAleSlwDH yalarHMeAsaJzNwg8ZUVrZ+76BA+QhRimUNaMJ2ENEVgdHJ3uq/Gua0jXWz9SjUMTQia KWxFprdm5Asxh4FjUTLFrmf4eDEohPHIadlazwYXaG7puHxtBPElXq2CkfqVpsw17B1M NZCbscV0KVcUOmO6tjeOAcj4Y2a1mM0EMmV/Ur/hoC/S1HHM8NhjjE+cagHV4sjuxq+P 2LwMmuGRU4/sNgSvOf/NNmEFCKHyJLFGgnaSxDBpq4tMc/i9EtZ6S+EgPkEo2+KfQr6y M8Bw== X-Gm-Message-State: ALyK8tIOxObLh3GiYPNpGzUGLfsMchh2EUr365MXxFU8whYWC5bsZ9lvzqjtNKvsquuErw== X-Received: by 10.46.0.220 with SMTP id e89mr10764689lji.58.1468607361450; Fri, 15 Jul 2016 11:29:21 -0700 (PDT) Original-Received: from asus.local ([178.218.27.218]) by smtp.gmail.com with ESMTPSA id 26sm2114624lfp.38.2016.07.15.11.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 11:29:20 -0700 (PDT) In-Reply-To: <87zipj8fpk.fsf@fsfe.org> (Kevin Brubeck Unhammer's message of "Fri, 15 Jul 2016 10:31:51 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Mail-Copies-To: always X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::233 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18288 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=browse-url-mail.2.patch diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index a4d47f6..dca81fe 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1597,7 +1597,8 @@ used instead of `browse-url-new-window-flag'." (if (not mml-mode) (error "Enable MML mode if you want to attach files") (dolist (attach attaches) - (mml-attach-file attach nil nil "attachment")))))))) + (mml-attach-file attach (mm-default-file-encoding attach) + nil "attachment")))))))) ;; --- Random browser --- --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit > I don't know how attachments are handled by other mailto-users though – For instance, Icedove (Thunderbird) does not support attaches in ‘mailto:’ at all and this is considered a feature [0]. [0] https://bugzil.la/99055#c6 > multiple identical hfname's or some separator in the hfvalue like with > the "to" header? The former seems to be the only way if we want to use xdg-email(1), since it requires that argument of ‘--attach’ should be existing file, not an arbitrary string and in particular not a comma separated list of files. --8<---------------cut here---------------start------------->8--- $ xdg-email foo@example.org --attach hfsdg xdg-email: file 'hfsdg' does not exist --8<---------------cut here---------------end--------------->8--- --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline