Sending signed e-mail via shell script

Martin Gollowitzer gollo at
Wed Feb 22 17:13:08 CET 2012


I'm currently trying to do a smal script that sends automated e-mail
messages on a regular basis. I want to sign those e-mails and since mutt
does not allow to use it's OpenPGP features in non-interactive mode, I
try to at least have these messages signed using inline PGP.
For this, I use the following commands on a Debian squeeze machine:

cat $file | gpg --no-verbose --batch --quiet --output - --passphrase "<passphrase>" --armor --textmode --clearsign > $tmpfile
mail -s "<Subject>" $address < $tmpfile

The problem is that I get a "BAD SIGNATURE from …" when verifying the
signature in mutt. I'm not entirely sure, but I think the problem has to
do with the encoding. I'm not very talented in shell scripting, so any
help is highly appreciated. Of course if you know a way to send
automated PGP/MIME signed messages, that would be even better.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: </pipermail/attachments/20120222/a3960d6a/attachment.pgp>

More information about the Gnupg-users mailing list