[Bug 827010] New: mailx does not set correct mime types
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c0 Summary: mailx does not set correct mime types Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: All OS/Version: openSUSE 12.3 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: bastian@bastian-friedrich.de QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0 When using "mailx" to send various file types, e.g. gif or jpeg, the files are sent as "application/octet-stream" instead of "image/<whatever>". The problem does NOT occur for mime types such as text/html. Reproducible: Always Steps to Reproduce: 1. mailx -a my-image.gif -s 'GIF test' your@address.com < /dev/null 2. View mail source after receiving Actual Results: Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Expected Results: Content-Type: image/gif Content-Transfer-Encoding: base64 The problem did NOT occur in OpenSUSE 12.1 and was introduced with patch "mailx-12.5-mime.dif" in OpenSUSE 12.2. The file mime type is determined correctly, but the (new) code resets it to octet-stream again: ------------- + if (isclean & MIME_LATIN) { + tcs = value("charset"); + if (tcs == NULL && wantcharset && wantcharset != (char *)-1) + tcs = wantcharset; + } + if (tcs == NULL) { + contenttype = "application/octet-stream"; + charset = NULL; + convert = CONV_TOB64; ------------- The problem also goes away when calling charset=utf-8 mailx -a my-image.gif -s 'GIF test' your@address.com < /dev/null -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c Ye Yuan <yyuan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yyuan@suse.com AssignedTo|bnc-team-screening@forge.pr |werner@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c1 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #1 from Dr. Werner Fink <werner@suse.com> 2013-07-02 07:21:30 UTC --- Thanks for spotting, I'll investigate -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c2 --- Comment #2 from Dr. Werner Fink <werner@suse.com> 2013-07-02 07:49:01 UTC --- Hmm ... send with mailx and after receiving viewed within mutt q:Exit s:Save |:Pipe p:Print ?:Help A 1 imortant.gif [image/gif, base64, 1.4K] What locale are you using, that is what does the command locale shows, here it is /suse/werner> locale | sed 's/^/ /' LANG=POSIX LC_CTYPE=de_DE.UTF-8 LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c3 --- Comment #3 from Dr. Werner Fink <werner@suse.com> 2013-07-02 07:50:44 UTC --- Even after an unsetenv LC_CTYPE and resending the gif file the mime type remains at image/gif -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |bastian@bastian-friedrich.d | |e -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c4 --- Comment #4 from Dr. Werner Fink <werner@suse.com> 2013-07-02 07:53:16 UTC --- Also using setenv LANG de_DE.ISO-8859-1 shows the same result after resending the gif file. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c5 Bastian Friedrich <bastian@bastian-friedrich.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED CC| |bastian@bastian-friedrich.d | |e InfoProvider|bastian@bastian-friedrich.d | |e | --- Comment #5 from Bastian Friedrich <bastian@bastian-friedrich.de> 2013-07-02 09:03:53 UTC --- (In reply to comment #2)
Hmm ... send with mailx and after receiving viewed within mutt
q:Exit s:Save |:Pipe p:Print ?:Help A 1 imortant.gif [image/gif, base64, 1.4K]
What locale are you using, that is what does the command locale shows, here it is
/suse/werner> locale | sed 's/^/ /' LANG=POSIX LC_CTYPE=de_DE.UTF-8 LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL=
The problem does not seem to be related to locale settings; my default locale is bastian@host:~> locale | sed 's/^/ /' LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE=C LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL= The behavior is the same after an "unset LANG": bastian@host:~> locale | sed 's/^/ /' LANG=POSIX LC_CTYPE=de_DE.UTF-8 LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE=C LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= I reckon you don't have a ".mailrc"? However, after your answer, I tried reproducing the issue on a different host, and found even stranger results: The problem was triggered with largish image files (the issue first occured to me with gifs in the range of 30kB, but was reproduced now with a 13kB file); sending smaller files -- such as your 1.4K file -- worked fine. Sending a mail with both of these images attached resulted in the small one with a correct MIME type, the large one with application/octet-stream. As sample images, I was using two files from the docbook-xsl-stylesheets-1.78.0-4.5.1.noarch package, /usr/share/xml/docbook/stylesheet/nwalsh/1.78.0/slides/s5/ui/default/bodybg.gif and /usr/share/xml/docbook/stylesheet/nwalsh/1.78.0/webhelp/template/common/jquery/treeview/images/plus.gif Resulting MIME headers (in a single mail with both images): -------------------- Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="plus.gif" -------------------- Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bodybg.gif" -------------------- Different behavior results from different return values from "mime_isclean" in mime.c. Duh?! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c6 --- Comment #6 from Dr. Werner Fink <werner@suse.com> 2013-07-02 09:21:03 UTC --- (In reply to comment #5)
I reckon you don't have a ".mailrc"?
suse/werner> ll .mailrc* -rw-r--r-- 1 werner suse 259 Aug 23 2006 .mailrc -rw-r--r-- 1 werner suse 275 Nov 21 1996 .mailrc.gz to make this clear I'm using mailx a long time. Also using nail and later on mailx from heirloom was done by me. ... but indeed with using the to gif files from nwalsh I'm able to reproduce -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c7 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |bastian@bastian-friedrich.d | |e --- Comment #7 from Dr. Werner Fink <werner@suse.com> 2013-07-02 12:06:17 UTC --- Now have look at https://build.opensuse.org/package/show/server:mail/mailx and give the latest packages of mailx at http://download.opensuse.org/repositories/server:/mail/openSUSE_12.3/ a try. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c8 --- Comment #8 from Bastian Friedrich <bastian@bastian-friedrich.de> 2013-07-02 12:59:23 UTC --- Thanks for your updates :) The MIME types are set correctly now. However, you still have a debug message in mailx-12.5-parentheses.dif and its sendout.c patch: +fprintf(stderr, "sendout %s\n", tcs ? tcs : "(null)"); -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c9 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |RESOLVED InfoProvider|bastian@bastian-friedrich.d | |e | Resolution| |FIXED --- Comment #9 from Dr. Werner Fink <werner@suse.com> 2013-07-02 13:53:45 UTC --- Thanks, just removed that and submitted as SR#181762 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c10 --- Comment #10 from Bernhard Wiedemann <bwiedemann@suse.com> 2013-07-02 16:00:21 CEST --- This is an autogenerated message for OBS integration: This bug (827010) was mentioned in https://build.opensuse.org/request/show/181762 Factory / mailx -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| |maint:running:55353:low -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c12 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|maint:running:55353:low |maint:running:55353:low | |maint:released:sle11-sp3:55 | |356 --- Comment #12 from Swamp Workflow Management <swamp@suse.de> 2014-01-20 17:49:24 UTC --- Update released for: mailx, mailx-debuginfo, mailx-debugsource Products: SLE-DEBUGINFO 11-SP3 (i386, ia64, ppc64, s390x, x86_64) SLE-DESKTOP 11-SP3 (i386, x86_64) SLE-SERVER 11-SP3 (i386, ia64, ppc64, s390x, x86_64) SLES4VMWARE 11-SP3 (i386, x86_64) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c13 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|maint:running:55353:low |maint:running:55353:low |maint:released:sle11-sp3:55 |maint:released:sle11-sp2:55 |356 |355 --- Comment #13 from Swamp Workflow Management <swamp@suse.de> 2014-01-20 17:53:25 UTC --- Update released for: mailx, mailx-debuginfo, mailx-debugsource Products: SLE-DEBUGINFO 11-SP2 (i386, ia64, ppc64, s390x, x86_64) SLE-DESKTOP 11-SP2 (i386, x86_64) SLE-SERVER 11-SP2 (i386, ia64, ppc64, s390x, x86_64) SLES4VMWARE 11-SP2 (i386, x86_64) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c14 --- Comment #14 from Swamp Workflow Management <swamp@suse.de> 2014-01-20 21:04:50 UTC --- SUSE-RU-2014:0103-1: An update that has two recommended fixes can now be installed. Category: recommended (low) Bug References: 827010,853246 CVE References: Sources used: SUSE Linux Enterprise Server 11 SP3 for VMware (src): mailx-12.5-1.5.1 SUSE Linux Enterprise Server 11 SP3 (src): mailx-12.5-1.5.1 SUSE Linux Enterprise Server 11 SP2 for VMware (src): mailx-12.5-1.5.1 SUSE Linux Enterprise Server 11 SP2 (src): mailx-12.5-1.5.1 SUSE Linux Enterprise Desktop 11 SP3 (src): mailx-12.5-1.5.1 SUSE Linux Enterprise Desktop 11 SP2 (src): mailx-12.5-1.5.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=827010 https://bugzilla.novell.com/show_bug.cgi?id=827010#c Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|maint:running:55353:low |maint:released:sle11-sp2:55 |maint:released:sle11-sp2:55 |355 |355 | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com