[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
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c1
Dr. Werner Fink
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
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
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c
Dr. Werner Fink
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
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c5
Bastian Friedrich
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
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
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c8
--- Comment #8 from Bastian Friedrich
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c9
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c10
--- Comment #10 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c12
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c13
Swamp Workflow Management
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
https://bugzilla.novell.com/show_bug.cgi?id=827010
https://bugzilla.novell.com/show_bug.cgi?id=827010#c
Swamp Workflow Management
participants (1)
-
bugzilla_noreply@novell.com