Hi!

I need to send a sign message with .pdf file as attachment from Linux MTA server
(the message can be empty).
Do you know how to do it? Is openssl suitable tool for it?

I tried these steps:
-> /usr/bin/uuencode -m file.pdf file.pdf > codefile.code
-> openssl smime -sign -text -binary -in codefile.code -out smime.p7s -signer some.pem -inkey somekey.pem
-> I corrected smime.p7s file by vi editor - the MIME attachment header:

MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----87C3A5C3C
DB2C00CE1827FA76401CFB5"

This is an S/MIME signed message

------87C3A5C3CDB2C00CE1827FA76401CFB5
Content-Type: application/pdf; name="file.pdf"
Content-Transfer-Encoding: base64
Content-Description: file.pdf
Content-Disposition: attachment; filename="file.pdf"
<CRLF>
begin-base64 644 file.pdf
JVBERi0xLjQNCjEgMCBvYmoNCjw8DQovUHJvZHVjZXIgKCkNCi9BdXRob3Ig
KCkNCi9DcmVhdGlvbkRhdGUgKEQ6MjAwNzExMjMxMTM0NTcpDQovQ3JlYXRv
ciAoKQ0KL0tleXdvcmRzICgpDQovU3ViamVjdCAoKQ0KL1RpdGxlICgpDQov

etc.

-> And when I sent this file via script:

#!/bin/bash
ADR=/tmp
SOUBOR=$ADR/some.txt
#
/bin/echo "From: Pepa Dolni Lhota <[EMAIL PROTECTED]>" > $SOUBOR
/bin/echo "To: [EMAIL PROTECTED]" >> $SOUBOR
/bin/echo "Subject: Sign file file.pdf is in attachment" >> $SOUBOR
/bin/echo "Reply-to: [EMAIL PROTECTED]" >> $SOUBOR
/bin/echo "Errors-to: [EMAIL PROTECTED]" >> $SOUBOR
#
/bin/echo " " >> $SOUBOR
/bin/cat $ADR/smime.p7s >> $SOUBOR
/bin/echo " " >> $SOUBOR
#
/usr/sbin/sendmail.sendmail -t -F [EMAIL PROTECTED] < $SOUBOR
exit 0
#

-> MUA client (Thunderbird) obtained message O.K. Certificate is good
for reading, but reading of the attachment ended with error:
Failed to load document (error 3) 'file:///home/someone/file.pdf'
When I open e-mail via Ctrl+U all seems to be all right.

Be so kind and try to get me some help how sign and send ".pdf" attachment.
Thank you very much and best regards,

Sonenberk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to