[Reportbug-maint] Bug#885959: reportbug: marks mime type of attachments as inode/symlink
control: tags -1 patch Thanks for the report! >From 77087cf7a1b16d0be199c301ece62f04f06d5b6f Mon Sep 17 00:00:00 2001 From: Nis MartensenDate: Mon, 1 Jan 2018 11:28:25 +0100 Subject: [PATCH] submit.py: dereference symbolic links when detecting file type --- reportbug/submit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reportbug/submit.py b/reportbug/submit.py index 4b72ceb..30cfdef 100644 --- a/reportbug/submit.py +++ b/reportbug/submit.py @@ -144,7 +144,7 @@ def mime_attach(body, attachments, charset, body_charset=None): continue ctype = None cset = charset -info = Popen(['file', '--mime', '--brief', attachment], +info = Popen(['file', '--mime', '--brief', '--dereference', attachment], stdout=PIPE, stderr=STDOUT).communicate()[0].decode('ascii') if info: match = re.match(r'([^;, ]*)(,[^;]+)?(?:; )?(.*)', info) -- 2.11.0 ___ Reportbug-maint mailing list Reportbug-maint@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint
[Reportbug-maint] Bug#885959: reportbug: marks mime type of attachments as inode/symlink
Package: reportbug Version: 7.1.8 Severity: normal Hi! Reportbug sends attachments with the following mime headers: Content-Type: inode/symlink MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="jcc_armhf.build" This confuses some mail clients, which don't want to display the attachment. The file's content is, as one would expect, what's in the symlink's target. [/srv/logs]$ file jcc_armhf.build jcc_armhf.build: symbolic link to jcc_armhf-2017-12-31T22:33:12Z.build [/srv/logs]$ file jcc_armhf-2017-12-31T22\:33\:12Z.build jcc_armhf-2017-12-31T22:33:12Z.build: UTF-8 Unicode text, with very long lines This particular bug is https://bugs.debian.org/885955 although obviously it happens elsewhere as well. Meow! -- Package-specific info: ** Environment settings: EDITOR="jstar" EMAIL="kilob...@angband.pl" INTERFACE="text" ** /home/kilobyte/.reportbugrc: reportbug_version "6.6.6" mode advanced ui text realname "Adam Borowski" -- System Information: Debian Release: buster/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: armhf (armv7l) Kernel: Linux 4.15.0-rc5-00024-g8358e4baaa66 (SMP w/4 CPU cores; PREEMPT) Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) Versions of packages reportbug depends on: ii apt1.6~alpha5 ii python33.6.4-1 ii python3-reportbug 7.1.8 ii sensible-utils 0.0.11 reportbug recommends no packages. Versions of packages reportbug suggests: pn claws-mail pn debconf-utils pn debsums pn dlocate pn emacs24-bin-common | emacs25-bin-common ii file 1:5.32-1 pn gir1.2-gtk-3.0 pn gir1.2-vte-2.91 ii gnupg2.2.3-1 pn python3-gi pn python3-gi-cairo pn python3-gtkspellcheck pn python3-urwid ii ssmtp [mail-transport-agent] 2.64-8+b2 pn xdg-utils Versions of packages python3-reportbug depends on: ii apt1.6~alpha5 ii file 1:5.32-1 ii python33.6.4-1 ii python3-debian 0.1.31 ii python3-debianbts 2.7.1 ii python3-requests 2.18.1-1 python3-reportbug suggests no packages. -- no debconf information ___ Reportbug-maint mailing list Reportbug-maint@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint