~ubuntu-branches/ubuntu/natty/signing-party/natty

« back to all changes in this revision

Viewing changes to gpg-mailkeys/gpg-mailkeys

  • Committer: Bazaar Package Importer
  • Author(s): Franck Joncourt
  • Date: 2009-09-24 19:29:07 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090924192907-2vk4ffjvc3070x6z
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# gpg-mailkeys: mail out just signed keys to their owners
4
4
#
5
 
# $Id: gpg-mailkeys 379 2008-04-30 19:20:21Z thijs $
 
5
# $Id: gpg-mailkeys 444 2009-09-10 22:19:28Z thialme-guest $
6
6
 
7
7
set -e
8
8
 
9
 
VERSION='$Rev: 379 $'
 
9
VERSION='$Rev: 444 $'
 
10
 
 
11
# Define the charset used in the text message of the mail
 
12
LOCAL_CHARSET=""
 
13
 
 
14
##
 
15
# Get the local charset.
 
16
#
 
17
# The local charset is deduced from the charset used by both ~/.gpg-mailkeysrc
 
18
# and ~/.signature. If none of these files exist, the local charset is assumed
 
19
# to be us-ascii.
 
20
 
 
21
get_local_charset ()
 
22
{
 
23
    local charset="us-ascii"
 
24
    local file_list="$HOME/.signature $HOME/.gpg-mailkeysrc"
 
25
 
 
26
    for filename in $file_list; do
 
27
 
 
28
        if [ -e $filename ]; then
 
29
            charset=`file --mime-encoding $filename | cut -d ' ' -f 2`
 
30
            break
 
31
        fi
 
32
 
 
33
    done;
 
34
 
 
35
    LOCAL_CHARSET=$charset
 
36
}
10
37
 
11
38
if [ -z "$*" ]; then
12
39
        printf "Send people their newly signed GPG key by mail.\n"
35
62
$NAME"
36
63
fi
37
64
 
 
65
get_local_charset
 
66
 
38
67
FAILKEYS=
39
68
 
40
69
while [ -n "$1" ]; do
66
95
 
67
96
 
68
97
--$BOUNDARY
69
 
Content-Type: text/plain; charset=us-ascii
 
98
Content-Type: text/plain; charset=$LOCAL_CHARSET
70
99
Content-Disposition: inline
71
100
Content-Transfer-Encoding: quoted-printable
72
101
 
73
102
 
74
 
$TEXT
 
103
`echo "$TEXT" | qprint -e`
75
104
 
76
105
EOM
77
106
 
78
107
if [ -f ~/.signature ]; 
79
108
        then printf -- "--=20\n" >> $TEMPFILE 
80
 
        cat ~/.signature >> $TEMPFILE
 
109
        qprint -e ~/.signature >> $TEMPFILE
81
110
fi
82
111
 
83
112
cat << EOM >> $TEMPFILE