9 date 95.12.06.21.00.46; author jromine; state Exp;
14 date 95.12.06.20.57.55; author jromine; state Exp;
25 @more pgp fixes from mtr
29 puts stderr "usage: ... headers-file body-file text-flag"
33 set textflag [lindex $argv 2]
35 set hdrsfile [open [lindex $argv 0] w]
38 foreach header [SafeTcl_getheaders] {
39 if {[set name [string tolower [set field [lindex $header 0]]]] \
43 if {[string first content- $name] == 0} {
44 append mime "$field: [lindex $header 1]\n"
48 puts $hdrsfile "$field: [lindex $header 1]"
50 puts $hdrsfile "MIME-Version: 1.0"
52 puts $hdrsfile "Content-Type: application/pgp; format=mime\n"
53 } elseif {$textflag == "T"} {
54 puts $hdrsfile "Content-Type: text/pgp\n"
56 puts $hdrsfile "Content-Type: application/pgp\n"
62 set bodyfile [open [lindex $argv 1] w]
65 puts $bodyfile "$mime"
67 puts -nonewline $bodyfile [SafeTcl_getbodyprop 1 value]
72 if {[SafeTcl_getheader Resent-To] != ""} {
79 foreach header [list Reply-To From Sender To cc Bcc Dcc From] {
80 foreach addr [SafeTcl_getaddrs [ SafeTcl_getheader $prefix$header]] {
81 catch { if {[string first @@ $addr] < 0} {
82 set addr [exec ali $addr]
84 set addr [SafeTcl_getaddrprop $addr address]
85 if {[lsearch -exact $addrs $addr] < 0} {
92 if {[set from [SafeTcl_getheader From]] == ""} {
93 set addr [id effective user]
95 set addr [lindex [SafeTcl_getaddrs $from] 0]
98 if {[string first @@ $addr] < 0} {
99 set addr [exec ali $addr]
101 set addr [SafeTcl_getaddrprop $addr address]
103 if {[lsearch -exact $addrs $addr] < 0} {
107 puts stdout "$addrs -u $addr"
119 puts stderr "usage: ... headers-file body-file"