[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mutt + gpg in bash script



Hello, I'm trying to send email from a bash script with mutt and sign a message of GPG.

I send mail as:
echo -e "${MSG}" | mutt -s "${SUB}" "${TO}" -a "attachment.tgz"
where
MSG - message
SUB - subject
TO - recipient
and attach a file.
This mail send fine.

I trying to sign this message so:

# cat .muttrc
set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f"
set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_encrypt_only_command="/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_import_command="gpg --no-verbose --import %f"
set pgp_export_command="gpg --no-verbose --export --armor %r"
set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r"
set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --list-keys %r"
set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --list-secret-keys %r"
set pgp_good_sign="^\\[GNUPG:\\] GOODSIG"

set from="FROM_MAIL"
set realname="FROM_NAME"

# specify the uid to use when encrypting/signing
set pgp_sign_as=0xMY_KEY_ID

# this set the number of seconds to keep in memory the passpharse used to encrypt/sign
# the more the less secure it will be
set pgp_timeout=60

# automatically sign all outgoing messages
set crypt_autosign

# automatically sign all outgoing messages setting
set pgp_autosign=yes

But I get the mail without signature!

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: