Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mutt with gpg non-interactive

Status
Not open for further replies.

jaytco

Vendor
Dec 13, 2001
88
US
I am trying to create an automated process to send PGP encrypted emails from linux. I have found that mutt does this pretty well, except during non-interactive mode. During interactive mode everything works great. Also note, I am only sending PGP encrypted emails, not signing or expecting to read emails as these are only system generated messages. With that in mind, their may be a better tool that I have not found. It does have to encrypt the body and any attachments.

This command works as expected and as needed, except that it is interactive, thus does not work in a script.

Code:
mutt -s Subject -i BodyMessage.txt -a AttachedFile.txt email@email.com

In .muttrc I set pgp_autoencrypt="yes", so I thought that would be all that is needed. All interactive emails default to Encrypt PGP. However, this will prompt the user to confirm information. I would like to automate the command with a script.

Code:
mutt -s Subject -a AttachedFile.txt email@bob.com < BodyMessage.txt

The message is sent correctly, but no GPG. Not sure if it is not reading the .muttrc, GPG does not work non-interactive, or missing something.

Mutt 1.5.18 (2008-05-17) on CentOS upgraded from Mutt 1.4.2.2i (2006-07-14) to see if that would help. No luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top