From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62349 Path: news.gmane.org!not-for-mail From: Dave Goldberg Newsgroups: gmane.emacs.gnus.general Subject: Problems with attachments in S/MIME encrypted messages from Outlook Date: Tue, 21 Mar 2006 23:04:06 -0500 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143000470 29716 80.91.229.2 (22 Mar 2006 04:07:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Mar 2006 04:07:50 +0000 (UTC) Original-X-From: ding-owner+m10876@lists.math.uh.edu Wed Mar 22 05:07:49 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FLudR-0004ZI-FX for ding-account@gmane.org; Wed, 22 Mar 2006 05:07:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FLudN-0007VY-00; Tue, 21 Mar 2006 22:07:45 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FLuZy-0007VQ-00 for ding@lists.math.uh.edu; Tue, 21 Mar 2006 22:04:14 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FLuZx-0007Yz-Hb for ding@lists.math.uh.edu; Tue, 21 Mar 2006 22:04:14 -0600 Original-Received: from vms046pub.verizon.net ([206.46.252.46]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FLuZw-0005Ps-00 for ; Wed, 22 Mar 2006 05:04:12 +0100 Original-Received: from davestoy.homelinux.org.verizon.net ([68.163.139.200]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IWI00FJ4GMVCGR3@vms046.mailsrvcs.net> for ding@gnus.org; Tue, 21 Mar 2006 22:04:11 -0600 (CST) X-Face: GUaHTH@nS>[7,ME@-gYZ4#Wl{z"99k@[[Y8AcP0x1paqu.,z9,XSV1WI>{q3f6^e5(zrit <4fV&VHhmE`uidRqtmG27;si9&r;#KSF~E#$%W8w(xdp)H4tW=\2XOk~3=@oGqqpj;m4xf Ow;y26396&,34@9#~4;@*S;E0cq"LM9N(us4P%F(Nxis'Vvfm9?KufH;:Q$dMa-QWGLR&K d0`LJZE8xb*>^yN>b]_NcU:E=Zn\1=#/(OS2 Original-To: ding@gnus.org User-Agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.19 (linux) X-Spam-Score: -0.8 (/) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62349 Archived-At: At work, we recently moved to an all Microsoft email solution (yuck!) from the corporate IT perspective. That is, the mail servers are Exchange but users are expected to use Outlook. Those of us who use other mail/calendar clients are on our own, though they did enable IMAP and iCal so we're not shut out. S/MIME is used for signing and encrypting as it was in our previous environment. Lately I've been receiving encrypted messages that contain attachments and Gnus is unable to deal with them. I get this error when attempting to save or view the attachment: Error while decoding: (error Illegal `=' character while decoding base64 22139) and the resulting file is corrupt. That last number is not always the same; it appears to be the position of the illegal character, though by my count it's off a bit (more on that below). Since I couldn't find that error message in any lisp code, I guessed it was built in to XEmacs. So I tried loading the base64 stuff from mail-lib but other than no error being reported, the results were the same - a corrupt file. Evolution and Thunderbird have no trouble with these attachments. Further, if I run openssl by hand to get the message into a textual format, I can extract the attachment's base64 block and successfully convert it so this appears to be an error parsing the MIME structure of the message and somehow embedding the Illegal '=' character into the base64 stream. Unfortunately I do not see any obvious way to debug this inside of XEmacs. The messages are encrypted and the initial decryption results in a single base64 encoded block with headers like this: Content-Type: application/x-pkcs7-mime; name=smime.p7m; smime-type=signed-data Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7m A subsequent run of openssl to verify the signature is required to get the message into readable form (well, at least that's how I've been doing it). In otherwords, I run openssl smime -decrypt -recip mykeyfile -in message | \ openssl smime -verify -noverify to get a MIME structure like this (text removed and attachment truncated) Content-Type: multipart/mixed; boundary="----=_NextPart_000_000F_01C5DAF3.7FAD2950" This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C5DAF3.7FAD2950 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit some text ------=_NextPart_000_000F_01C5DAF3.7FAD2950 Content-Type: application/vnd.ms-excel; name="test.xls" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.xls" [lots of stuff elided] AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ------=_NextPart_000_000F_01C5DAF3.7FAD2950-- Note the = at the end of the last line. I'm guessing those are the illegal characters yet they don't seem to cause me any grief when I process the file manually or, any grief to other clients. However, I really don't know whether the message I'm creating from my command line is the same as that created when Gnus runs openssl since I'm not certain exactly what command line it runs. I've attempted to use the debugger a bit, but I don't know where to break into it and all attempts have ended up with me spending too much time single stepping, and then missing the key event when I try to let some functions go. I'm happy to try to track this down (almost desperate to do so, in fact :-) but I'm hoping someone can give me some guidance on where to look. Thanks, -- Dave Goldberg david.goldberg6@verizon.net