| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hello Is there a better or easier way to send an gpg-encrypted e-mail with mutt and a shellscript? This solution works with an attached gpg-encrypted file. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ #!/bin/sh path=$(/bin/pwd) mail=$(echo "Hello\n\nGreetings") echo 'That is a test.' > "$path"/text.txt gpg -e -r 'User' "$path"/text.txt echo "$mail" | mutt -s 'Test' -a "text.txt.gpg" 'test@test.com' rm text.* exit 0 ################################################## ############ But I'd like to have a shellscript for sending gpg-encrypted e-mails with mutt without an attachment. I tested the... set pgp_autoencrypt=yes ....option in the ~/.muttrc, but it didn't work... Thanx for your help. Daniel Baumann |
|
#2
| |||
| |||
| Hello again > Daniel Baumann wrote: > > Hello > > Is there a better or easier way to send an gpg-encrypted e-mail > with mutt and a shellscript? > > This solution works with an attached gpg-encrypted file. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ > > #!/bin/sh > > path=$(/bin/pwd) > > mail=$(echo "Hello\n\nGreetings") > > echo 'That is a test.' > "$path"/text.txt > > gpg -e -r 'User' "$path"/text.txt > > echo "$mail" | mutt -s 'Test' -a "text.txt.gpg" 'test@test.com' > > rm text.* > > exit 0 > > ################################################## ############ > > But I'd like to have a shellscript for sending gpg-encrypted > e-mails with mutt without an attachment. I tested the... > > set pgp_autoencrypt=yes > > ...option in the ~/.muttrc, but it didn't work... I found and tested this solution and it is working now very well: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ #!/bin/sh path=$(/bin/pwd) echo 'That is a test.' > "$path"/text.txt gpg -e -a -o mail.txt -r 'User' "$path"/text.txt mail=$(cat mail.txt) echo "$mail" | mutt -s 'Test xy' 'test@test.com' rm text.txt mail.txt exit 0 ################################################## ############ With the "-a option" in the line... gpg -e -a -o mail.txt -r 'User' text.txt ....it is possible to create ASCII armored output and the "-o option" writes the output to a file. The result in the e-mail looks now like... halifax@laptop:~$ cat mail.txt -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) hQIOA9B7OutKGxTJEAgAtQ0/raSb5dcZs+rKaRM00/S+lPGLDmxZzNpMAShO68+8 BZbqY3GJjho+PvA0mtpWyYFLcwuVNl2cqIYXKTpTdOtxoLT2TA gR90xz10I5ddmo fKgQ3dnV7VTzwqRHhI8hREN4Pamyva5O2b85yO1iTQMxe4AKjZ 4k2+OkBx6CLo8C S6ubwAa5mKkU2aYEI0x+N20/j7x8GJGJ5omaCcElyOH6lVrm4NyIjAapQ8Q1gUwq lc+vNp/eULWCx47jTWd4goqrF3szsBmGWUnJhIIJaBsKnENah1iENjzc3 tGUYtDT gEgZOGs1pHhzJrqXvywguzgx/RzGBp0T0oalYGOEHggAwHnz2IABSwojnbPLtE1O Zt47VDygj1uXtDbX9ZimvMABtYs60NGTFwPCzYLHXszUmlzjuI hOJ0grz09qPe+t aUTIrw4HFUtPF8JA+bN6Lss7ao7rZrLzIrdt/vhgdWI0l0opSLqgTcSbyMlxXep9 U1J53l03pH8L8k463HZ3vmPdU0qNVWmLbzSYpzq4tE/B1CMUsw5LiEImZsIxQ3VJ pQTF5iV/MAuLX183jXj8CiI3xBCU9k0RPnQS2jDAj0bLsOeuNm2pfKt4s4 NZZPID sGp973rGhW1uxz25DS7JmqXDKm9OB5xTRGL1QjB3NMlob+Wux0 C1YT6fPnZKIX1k E9JzAXKo0zSbyOREZU1YtwObvgVHbn7loDua/Xdi2u27l/UDOhxQtzgh92PgVn3k vE6juq7cvLNjxu3ziTYJ8ne451OKKNtQ8Q93DKueDp6rE1OaVd uT32d8mCfNLvC6 JEXsZOm1ELGdxNlfCsCaxDupXprppQ== =hpZO -----END PGP MESSAGE----- halifax@laptop:~$ ....and that's it what I want. ;-) Greetings Daniel Baumann |
|
#3
| |||
| |||
| Hello again > Daniel Baumann wrote: > > Hello > > Is there a better or easier way to send an gpg-encrypted e-mail > with mutt and a shellscript? > > This solution works with an attached gpg-encrypted file. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ > > #!/bin/sh > > path=$(/bin/pwd) > > mail=$(echo "Hello\n\nGreetings") > > echo 'That is a test.' > "$path"/text.txt > > gpg -e -r 'User' "$path"/text.txt > > echo "$mail" | mutt -s 'Test' -a "text.txt.gpg" 'test@test.com' > > rm text.* > > exit 0 > > ################################################## ############ > > But I'd like to have a shellscript for sending gpg-encrypted > e-mails with mutt without an attachment. I tested the... > > set pgp_autoencrypt=yes > > ...option in the ~/.muttrc, but it didn't work... I found and tested this solution and it is working now very well: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ #!/bin/sh path=$(/bin/pwd) echo 'That is a test.' > "$path"/text.txt gpg -e -a -o mail.txt -r 'User' "$path"/text.txt mail=$(cat mail.txt) echo "$mail" | mutt -s 'Test xy' 'test@test.com' rm text.txt mail.txt exit 0 ################################################## ############ With the "-a option" in the line... gpg -e -a -o mail.txt -r 'User' text.txt ....it is possible to create ASCII armored output and the "-o option" writes the output to a file. The result in the e-mail looks now like... $ cat mail.txt -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) blablabla... -----END PGP MESSAGE----- halifax@laptop:~$ ....and that's it what I want. ;-) Greetings Daniel Baumann |
|
#4
| |||
| |||
| Hello again > Daniel Baumann wrote: > > Hello > > Is there a better or easier way to send an gpg-encrypted e-mail > with mutt and a shellscript? > > This solution works with an attached gpg-encrypted file. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ > > #!/bin/sh > > path=$(/bin/pwd) > > mail=$(echo "Hello\n\nGreetings") > > echo 'That is a test.' > "$path"/text.txt > > gpg -e -r 'User' "$path"/text.txt > > echo "$mail" | mutt -s 'Test' -a "text.txt.gpg" 'test@test.com' > > rm text.* > > exit 0 > > ################################################## ############ > > But I'd like to have a shellscript for sending gpg-encrypted > e-mails with mutt without an attachment. I tested the... > > set pgp_autoencrypt=yes > > ...option in the ~/.muttrc, but it didn't work... I found and tested this solution and it is working now very well: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ #!/bin/sh path=$(/bin/pwd) echo 'That is a test.' > "$path"/text.txt gpg -e -a -o mail.txt -r 'User' "$path"/text.txt mail=$(cat mail.txt) echo "$mail" | mutt -s 'Test xy' 'test@test.com' rm text.txt mail.txt exit 0 ################################################## ############ With the "-a option" in the line... gpg -e -a -o mail.txt -r 'User' text.txt ....it is possible to create ASCII armored output and the "-o option" writes the output to a file. The result in the e-mail looks now like... $ cat mail.txt #-----BEGIN PGP MESSAGE----- #Version: GnuPG v1.4.6 (GNU/Linux) #blablabla... #-----END PGP MESSAGE----- halifax@laptop:~$ ....and that's it what I want. ;-) Greetings Daniel Baumann |
|
#5
| |||
| |||
| Hello again > Daniel Baumann wrote: > > Hello > > Is there a better or easier way to send an gpg-encrypted e-mail > with mutt and a shellscript? > > This solution works with an attached gpg-encrypted file. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ > > #!/bin/sh > > path=$(/bin/pwd) > > mail=$(echo "Hello\n\nGreetings") > > echo 'That is a test.' > "$path"/text.txt > > gpg -e -r 'User' "$path"/text.txt > > echo "$mail" | mutt -s 'Test' -a "text.txt.gpg" 'test@test.com' > > rm text.* > > exit 0 > > ################################################## ############ > > But I'd like to have a shellscript for sending gpg-encrypted > e-mails with mutt without an attachment. I tested the... > > set pgp_autoencrypt=yes > > ...option in the ~/.muttrc, but it didn't work... I found and tested this solution and it is working now very well: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ #!/bin/sh path=$(/bin/pwd) echo 'That is a test.' > "$path"/text.txt gpg -e -a -o mail.txt -r 'User' "$path"/text.txt mail=$(cat mail.txt) echo "$mail" | mutt -s 'Test xy' 'test@test.com' rm text.txt mail.txt exit 0 ################################################## ############ With the "-a option" in the line... gpg -e -a -o mail.txt -r 'User' text.txt ....it is possible to create ASCII armored output and the "-o option" writes the output to a file. The result in the e-mail looks now like... $ cat mail.txt -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) blablabla... ....and that's it what I want. ;-) Greetings Daniel Baumann |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.