To read signed message in base64 (not encrypted with priv&pub key):
You can just decode content by "base64_decode" or "imap_base64" functions and then erase by hand(regexp) sign from bottom of mail. Unfortunately in my case (mail from Outlook) that message (decoded by "base64_decode") has some additional special chars in some places (ie. before every attachment encoded base_64) what make message e-mail unable to parse.
After couple of hours I solved this:
It's needed to save single e-mail and use 2x "openssl_pkcs7_verify" function in row on original email (with headers and content in base64 ):
1st use - extract sign (certificate) from e-mail and save to file *.cert
2nd use - extract (with use that *.cert file) decoded message to file*.out
Code:
$handle = imap_open('mailbox.eml', '', '');
$msg = 'home/john/tmp/email1.eml';
imap_savebody($handle, $msg, 1);
openssl_pkcs7_verify($msg, 0, $msg . '.cert');
openssl_pkcs7_verify($msg, 0, $msg . '.cert', array(), $msg . '.cert', $msg.'.out');
$email_content = file_get_contents($msg . '.out');