I'd like to use mutt to send and sign the email directly from command line like e.g.
mutt -s "MySubject" email@example.com < message OR echo " " | mutt -s "MySubject" -a message.txt -- firstname.lastname@example.org
but even I made a proper setup in muttrc and it actually works when I compose the email in mutt UI (agent interface) ["Security: Sign (PGP/MIME)" and "Sign as:Marcel" parameters are automtically assigned + activated and email is sent with signature] this I can't make functional within cli usage. It just send the email without any signature in it. I tried different setup in muttrc but it always send the mail without it.
Another unsuccesfull attempts- pgp key with and without passphrase to check if there is not a problem with entering it, also it did not work with key that was temporary unlocked by pgp agent.
GPG variables defined in my muttrc:
... source ~/.config/mutt/gpg.rc set pgp_use_gpg_agent="yes" set pgp_default_key="8624C27DB543F03D" set pgp_sign_as="Marcel" set crypt_autosign="yes"
You can see even if I pass the muttrc config file in argument it does not change the fact that mutt just send the email without using pgp. It seems to me it ignores the variables in the config because it's not launched in agent UI.
mutt -F ~/.config/mutt/muttrc -s "MySubject" -a message.txt -- email@example.com
Is there a way to sign the mail with mutt when using only command line? Thank you for your answers.