wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes signing multipart email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "signing multipart email" Watch "signing multipart email" New topic
Author

signing multipart email

Tomas Vojtech
Greenhorn

Joined: Oct 17, 2008
Posts: 2
Hello,
I have problem with signing multipart mail. If I try send simple signed mail it is delivered and Thunderbird says its signed and correct. But if I send multipart mail it is delivered but Thunderbird says the mail was signed but the signature doesn't match the content. Where's problem? Is it possible to sign multipart mail?

Code that does sending:


//EDIT
libraries:
javamail-crypto-bouncycastle-smime_060622.jar
javamail-crypto_060622.jar
bcmail-jdk15-140.jar
bcprov-jdk15-140.jar
javamail 1.4
activation 1.1

message source:

From - Fri Oct 30 15:20:58 2009
X-Account-Key: account3
X-UIDL: M6635S6290T1256912282
X-Mozilla-Status: 0001
X-Mozilla-Status2: 10000000
X-Mozilla-Keys:
Reply-To: aaa@mail.cz
Received: (qmail 10092 invoked by uid 0); 30 Oct 2009 14:18:02 -0000
X-Spam-Checker-Version: szn-spamassassin 2009-06-26
X-Spam-Status: score=-5.9
Received: from smtp.casablanca.cz (smtp.casablanca.cz [217.11.225.65])
by email-smtpd7.go.seznam.cz (Seznam SMTPD 1.1.10@14229) with ESMTP;
Fri, 30 Oct 2009 15:18:02 +0100 (CET)
Received: from [81.0.211.200] (helo=tvojtech-laptop)
by smtp.casablanca.cz with esmtp (Exim 4.63)
(envelope-from <aaa@mail.cz>)
id 1N3sHo-0001nP-Vy
for tom.vojtech@seznam.cz; Fri, 30 Oct 2009 15:17:05 +0100
Message-Id: <20435088.31256912225035.JavaMail.tvojtech@tvojtech-laptop>
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1;
boundary="----=_Part_1_7896426.1256912224811"
Date: Fri, 30 Oct 2009 15:17:04 +0100 (CET)
From: taaa@mail.cz
To: tom.vojtech@seznam.cz
Subject: =?us-ascii?Q?Testovaci=20podepsany=20mail?=
X-Smtp-Casablanca-Cz-Mailscanner: Found to be clean
X-Smtp-Casablanca-Cz-Mailscanner-Spamcheck: not spam,
SpamAssassin (not cached, score=2.999, required 7,
autolearn=disabled, RDNS_NONE 0.10, TVD_SPACE_RATIO 2.90)
X-Smtp-Casablanca-Cz-Mailscanner-Spamscore: ss
X-Smtp-Casablanca-Cz-Mailscanner-From: aaa@mail.cz
X-Smtpd: 1.1.10@14229
X-Nod32result: clean (vdv=4556)


------=_Part_1_7896426.1256912224811
Date: Fri, 30 Oct 2009 15:17:04 +0100 (GMT+01:00)
From: aaa@mail.cz
To: tom.vojtech@seznam.cz
Subject: Testovaci podepsany mail
Content-Type: multipart/mixed;
boundary="----=_Part_0_26460367.1256912224625"


------=_Part_0_26460367.1256912224625
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Text testovaciho podepsaneho mailu
------=_Part_0_26460367.1256912224625
Content-Type: application/octet-stream; name=oracle_prereq.sh
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=oracle_prereq.sh

#!/bin/bash

zypper install gcc gcc-c++ glibc libaio libaio-devel make openmotif-libs ocfs2-tools ocfs2-tools-devel ocfs2console # instalace potrebnych balicku

# vytvoreni uzivatelu a skupin
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/useradd -m -u 501 -g oinstall -G dba oracle
passwd oracle # nastaveni hesla uzivateli oracle

###############################################################################
###### nastaveni parametru kernelu a limity uzivatele oracle ##################
###############################################################################

# Configure the Hangcheck Timer
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
cat >> /etc/init.d/boot.local << EOF
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
EOF

cat >> /etc/sysctl.conf << EOF
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 658576
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 1048536
net.core.wmem_max = 1048536
EOF

/sbin/sysctl -p

cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
EOF

cat >> /etc/profile.local << EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF

cat >> /etc/csh.login.local << EOF
if ( \$USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF



------=_Part_0_26460367.1256912224625--

------=_Part_1_7896426.1256912224811
Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIAwggOmMIID
D6ADAgECAgMQABEwDQYJKoZIhvcNAQEFBQAwgYMxCzAJBgNVBAYTAkNTMRcwFQYDVQQIEw5DemVj
aCBSZXB1YmxpYzElMCMGA1UEChMcTm92ZWxsIFByb2Zlc3Npb25hbCBTZXJ2aWNlczEgMB4GA1UE
CxMXQXBwbGljYXRpb24gRGV2ZWxvcG1lbnQxEjAQBgNVBAMTCU5vdmVsbCBDQTAeFw0wOTEwMjkx
NDUxMzNaFw0xMTEwMjkxNDUxMzNaMIGNMQswCQYDVQQGEwJDUzEXMBUGA1UECBMOQ3plY2ggUmVw
dWJsaWMxJTAjBgNVBAoTHE5vdmVsbCBQcm9mZXNzaW9uYWwgU2VydmljZXMxIDAeBgNVBAsTF0Fw
cGxpY2F0aW9uIERldmVsb3BtZW50MRwwGgYDVQQDFBN0dm9qdGVjaEBub3ZlbGwuY29tMI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wEwHAYJKoZIhvcNAQkF
MQ8XDTA5MTAzMDE0MTcwNVowIwYJKoZIhvcNAQkEMRYEFBCWYMC85GOwhCWvAk23Wu/r3bOuMDQG
CSqGSIb3DQEJDzEnMCUwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMAcGBSsOAwIHMIGeBgsq
hkiG9w0BCRACCzGBjqCBizCBgzELMAkGA1UEBhMCQ1MxFzAVBgNVBAgMDkN6ZWNoIFJlcHVibGlj
MSUwIwYDVQQKDBxOb3ZlbGwgUHJvZmVzc2lvbmFsIFNlcnZpY2VzMSAwHgYDVQQLDBdBcHBsaWNh
dGlvbiBEZXZlbG9wbWVudDESMBAGA1UEAwwJTm92ZWxsIENBAgMQABEwDQYJKoZIhvcNAQEBBQAE
gYAeA6+9KLXgdebXL1XoXV8CFdzK4Lb/w2dWWTFISmYd/nUE2snXA1n/jsdHvDNLPNXJPM7prVla
c6jaIdQcP28vsk0hvfAEXjX+PpnH2dmGVKnQro1CVi7qt3U6CdoxbGJz4GIF+SMEHGDRV/KkmBYF
t4r8QixXw+gUtSMeLqnxmwAAAAAAAA==
------=_Part_1_7896426.1256912224811--
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Moving to Other JSE / JEE APIs.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: signing multipart email
 
Similar Threads
problem with java mail attachment
Java Mail Problem
Java & Outlook integration - how to go about it
Attaching files using Java Mail API
JavaMail - Problem while sending file attachment