2 puts stderr
"usage: ... headers-file body-file text-flag"
6 set textflag
[lindex $argv 2]
8 set hdrsfile
[open [lindex $argv 0] w
]
11 foreach header
[SafeTcl_getheaders
] {
12 if {[set name
[string tolower
[set field
[lindex $header 0]]]] \
16 if {[string first content-
$name] == 0} {
17 append mime
"$field: [lindex $header 1]\n"
21 puts $hdrsfile "$field: [lindex $header 1]"
23 puts $hdrsfile "MIME-Version: 1.0"
25 puts $hdrsfile "Content-Type: application/pgp; format=mime\n"
26 } elseif
{$textflag == "T"} {
27 puts $hdrsfile "Content-Type: text/pgp\n"
29 puts $hdrsfile "Content-Type: application/pgp\n"
35 set bodyfile
[open [lindex $argv 1] w
]
38 puts $bodyfile "$mime"
40 puts -nonewline $bodyfile [SafeTcl_getbodyprop
1 value
]
45 if {[SafeTcl_getheader Resent-To
] != ""} {
52 foreach header
[list Reply-To From Sender To cc Bcc Dcc From
] {
53 foreach addr
[SafeTcl_getaddrs
[ SafeTcl_getheader
$prefix$header]] {
54 catch { if {[string first
@ $addr] < 0} {
55 set addr
[exec ali
$addr]
57 set addr
[SafeTcl_getaddrprop
$addr address
]
58 if {[lsearch -exact $addrs $addr] < 0} {
65 if {[set from
[SafeTcl_getheader From
]] == ""} {
66 set addr
[id effective user
]
68 set addr
[lindex [SafeTcl_getaddrs
$from] 0]
71 if {[string first
@ $addr] < 0} {
72 set addr
[exec ali
$addr]
74 set addr
[SafeTcl_getaddrprop
$addr address
]
76 if {[lsearch -exact $addrs $addr] < 0} {
80 puts stdout
"$addrs -u $addr"