From owner-freebsd-questions@FreeBSD.ORG Sat May 8 22:14:24 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C3CA16A4CE for ; Sat, 8 May 2004 22:14:24 -0700 (PDT) Received: from terpsi.otenet.gr (terpsi.otenet.gr [195.170.0.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 949BB43D54 for ; Sat, 8 May 2004 22:14:22 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a071.otenet.gr [212.205.215.71]) by terpsi.otenet.gr (8.12.10/8.12.10) with ESMTP id i495E2DR023008; Sun, 9 May 2004 08:14:10 +0300 (EEST) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.11/8.12.11) with ESMTP id i495DlvM038637; Sun, 9 May 2004 08:13:47 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.11/8.12.11/Submit) id i493XvcB038282; Sun, 9 May 2004 06:33:57 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 9 May 2004 06:33:57 +0300 From: Giorgos Keramidas To: Edwin Groothuis , freebsd-questions@freebsd.org Message-ID: <20040509033356.GA38228@gothmog.gr> References: <20040509015705.GA48222@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040509015705.GA48222@k7.mavetju> Subject: Re: Problem transporting signed emails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2004 05:14:24 -0000 On 2004-05-09 11:57, Edwin Groothuis wrote: > Greetings, > > I've been playing with signed emails (S/MIME, OpenSSL etc) but am > running into an annoying problem: "openssl smime -sign" signs the > text, but it adds ^M's at the end of the lines of the original text. > When piping it through to the MTA, somewhere the ^M's are lost and > the signature of the file including becomes invalid. [snip] > ------259958A68922550377544CEFAD9013E9 > Content-Type: text/plain^M > ^M > This is a test.^M > This is a text.^M > > ------259958A68922550377544CEFAD9013E9 > ============ 8< ==================== > > Piping this through sendmail (postfix) for delivery on the same > machine gives me the same text with the ^M's. Piping this through > sendmail for delivery on a different machine gives me the text > without the ^M's, which invalidates the signature on the email. Try base64-encoding the signed message, instead of piping it through as text/plain. The ^M characters [ascii:13] at the end of lines terminated with ^J [ascii:10] can be intepreted by network servers and/or clients as part of EOL, the end of the line. A good explanation of why this might happen is found in [Richard Stevens, "TCP/IP Illustrated", Vol. I, pp. 401]: : NVT ASCII : : The term NVT ASCII refers to the 7-bit U.S. variant of the ASCII : character set used throughout the Internet protocol suite. Each 7-bit : character is sent as an 8-bit byte, with the high-order bit set to 0. : An end-of-line is transmitted as the 2-character sequence CR : (carriage return) followed by an LF (line feed). We show this as \r\n. : A carriage return is transmitted as the 2-character sequence CR followed : by a NUL (byte of 0). We show this as \r\0. Giorgos