Can anyone offer any tips for tracing a GPG/PHP mail encryption problem?
I have a site that builds an email message containing customet information and CC details. I want to encrypt the message part prior to sending. I have tested GPG by encrypting files on the server, downloading and decrypting without a problem but when trying to adapt this process to email a message only a very short mail is recieved with garbage text. The GPA (V0.4.0) plugin for Outlook reports that the mail is neither signed nor encrypted and indeed it is less than half the size of a plain-text email. The same short text is displayed if the 'encrypted' string is echoed in PHP...
The code I'm using is as follows:-
$encrypted = base64_encode(shell_exec("echo $message | $gpg_path -e -a --always-trust --no-tty -r $mail_recipient 2>&1"));
The path is './usr/bin/gpg'.
The message is between 20 and 40 lines (approx 500 chars).
The mail recipient is myself and the keys etc are valid and encrypt in the shell.
Sorry but I have to use Outlook as this is what the client runs! ;-) I don't believe the problem is here anyway because an 'echo $encrypted' displays the same - about 15 chars!
Any debugging tips would be welcome as I've only been using PHP for about 4 weeks: It's called a baptism of fire!
Regards
R-)