On 2025-10-19, W. D. Sadeep wrote:

> Hello,
>
> I'm trying to send an encrypted email via a cron job. I can't get it to
> work. For instance, I tried the following command, but it opens up mutt
> for an interactive session:
>
> echo "encrypted msg" | gpg -e --armor -f <pub_key> | \ 
>     mutt -s "PGP test" \
>          -e "my_hdr MIME-Version: 1.0" \
>          -e "my_hdr Content-Type: application/pgp-encrypted" \
>          -e "my_hdr Content-Disposition: inline" [email protected]
>
> Also tried the following:
>
> echo "encrypted msg" | gpg -e --armor -f <pub_key> | \ 
>     mutt -s "PGP test" \
>          -e "my_hdr MIME-Version: 1.0" \
>          -e "my_hdr Content-Type: multipart/encrypted; 
> protocol='application/pgp-encrypted'" \
>          -e "my_hdr Content-Disposition: inline" [email protected]
>
> And I get the error: Error in command line:
> protocol=application/pgp-encrypted: unknown command
>
> Is there a way to accomplish this (ideally, without creating temporary
> files for the encrypted part)?

For the second invocation:

Any chance that you have to either enclose the Content-Type value in
quotes or escape the semicolon there?

-- 
Nuno Silva

Reply via email to