From owner-freebsd-questions@FreeBSD.ORG Sat May 8 18:57:10 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 757F316A4CE for ; Sat, 8 May 2004 18:57:10 -0700 (PDT) Received: from mailout2.barnet.com.au (mailout2.barnet.com.au [218.185.88.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F2B543D3F for ; Sat, 8 May 2004 18:57:09 -0700 (PDT) (envelope-from edwin@mavetju.org) Received: by mailout2.barnet.com.au (Postfix, from userid 27) id ADDC6AA61E8; Sun, 9 May 2004 11:57:07 +1000 (EST) X-Viruscan-Id: <409D8FF3000117AF797C6E@BarNet> Received: from mail2-auth.barnet.com.au (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Authority" (verified OK)) by mail2.barnet.com.au (Postfix) with ESMTP id 7B488B29D01 for ; Sun, 9 May 2004 11:57:07 +1000 (EST) Received: from k7.mavetju (unknown [10.10.12.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Certificate Authority" (verified OK)) by mail2-auth.barnet.com.au (Postfix) with ESMTP id 043DB19312 for ; Sun, 9 May 2004 11:57:07 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id F1D4360E5; Sun, 9 May 2004 11:57:05 +1000 (EST) Date: Sun, 9 May 2004 11:57:05 +1000 From: Edwin Groothuis To: freebsd-questions@freebsd.org Message-ID: <20040509015705.GA48222@k7.mavetju> Mail-Followup-To: Edwin Groothuis , freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: 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 01:57:10 -0000 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. [~/openssl] edwin@k7>cat test.txt This is a test. This is a text. [~/openssl] edwin@k7>openssl smime -sign -text -signer mycert.pem -in test.txt > test.msg Enter pass phrase for mycert.pem: And then in vi: ============ 8< ==================== MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg =sha1; boundary="----259958A68922550377544CEFAD9013E9" This is an S/MIME signed message ------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. My questions are... has somebody else ever fought with signed emails like this and did they see the same behaviour? And how did you overcome this problem. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/