With my email hoster I have the ability to pipe incoming emails to a program (as opposed to immediately forwarding to another address) and what I would like to do is first pipe to gpg to encrypt the mail and then mail it on to another address.
so far what I've tried is ...
## /usr/bin/gpg -ea -r email@example.com -o - $1 | mail -s Test1 firstname.lastname@example.org
cat > /usr/bin/gpg -ea -r email@example.com > mail -s Test1 firstname.lastname@example.org
but I don't think I've got it quite right with the piping !! (my first attempted is commented out).
(I've tried http://marc.info/?l=gnupg-devel&m=99470875105469&w=2
but can't get it to work)
Can anyone suggest what the correct syntax should be please?
P.S. I can pipe to Perl or PHP but I don't know either. If it's better to use Perl or PHP for this then I'm happy to try...but can I have some hints pls.