1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
set env(LIBDIR) [pwd]/../tkrat
set env(CONFIG_DIR) .
set env(COMPRESS) /usr/bin/gzip
set env(CSUFFIX) .gz
set env(SSH) /usr/bin/ssh
# This version of the tkrat file is only intended to be used in
# the development tree.
lappend auto_path [pwd]/..
lappend auto_path $env(LIBDIR)
package require ratatosk 2.2
proc InitTestmsgs {} {
global dir
uplevel #0 source $dir/../data.tcl
}
InitTestmsgs
# Stubs for commands the library expects to find
proc RatLog {level message time} {
global debug
if {1 == $debug || 3 <= $level} {
puts "Log: $level $time '$message'"
}
}
proc RatFormatDate {year month day hour min sec} {
puts "RatFormatDate $year $month $day $hour $min $sec"
return DATE
}
proc RatLogin {host trial user prot port} {
global env passwd
return [list $env(USER) $passwd 0]
}
proc RatWantSave {} {
return
}
proc RatEncodingCompat {wanted avail} {
set wanted [string tolower $wanted]
set avail [string tolower $avail]
if {![string compare $wanted $avail]} {
return 1
}
if {![string compare us-ascii $wanted] && [regexp iso-8859- $avail]} {
return 1
}
return 0
}
proc RatDSNRecieve {subject action recipient id} {
puts "RatDSNRecieve"
puts "\tSubject: $subject"
puts "\tAction: $action"
puts "\tRecipient: $recipient"
puts "\tId: $id"
r}
proc StartTest {name} {
global verbose currentTest
set currentTest $name
if {$verbose} {
puts "Test $name"
}
}
proc ReportError {msg} {
global currentTest LEAD errors verbose abortOnError
if {!$verbose} {
puts "$LEAD Test $currentTest"
}
puts "$LEAD $msg"
incr errors
if {$abortOnError} {
exit 1
}
}
proc CompareLists {expected got} {
set le [llength $expected]
set lg [llength $got]
for {set i 0} {$i < $le && $i < $lg} {incr i} {
if {[lindex $expected $i] != [lindex $got $i]} {
return "EXP: [lindex $expected $i]\nGOT: [lindex $got $i]"
}
}
if {$le != $lg} {
return "Got $lg elements while expecting $le"
}
return ""
}
set tkrat_version dev
set tkrat_version_date 20001217
set idCnt 0
set inbox ""
set expAfter {}
set logAfter {}
set statusBacklog {}
set currentColor {gray85 black}
set ratLogBottom 0
set ratLogTop 0
# For c-client based imap-server
set imap_serv uwash
#set imap_serv cyrus
source imap-${imap_serv}.tcl
set option(ratatosk_dir) $dir
source ../tkrat/options.tcl
OptionsInit
RatGenId # Force load of package
OptionsRead
InitMessages en t
InitCharsetAliases
source smtp_server.tcl
set option(debug_file) $dir/LOG
set option(folder_sort) natural
set vFolderOutgoing 42
set vFolderDef($vFolderOutgoing) \
[list Outgoing file {} $dir/outgoing-[pid]]
|