From 094ca96844842928810f14844413109fc6cdd890 Mon Sep 17 00:00:00 2001
From: Eduardo Chappa
Date: Sun, 3 Feb 2013 00:59:38 -0700
Subject: Initial Alpine Version
---
web/cgi/.htaccess | 32 +
web/cgi/alpine.tcl | 1 +
web/cgi/alpine/1.0/addrbook.tcl | 583 ++++++
web/cgi/alpine/1.0/addredit.tcl | 224 +++
web/cgi/alpine/1.0/addrpick.tcl | 134 ++
web/cgi/alpine/1.0/addrsave.tcl | 244 +++
web/cgi/alpine/1.0/alpine.tcl | 1 +
web/cgi/alpine/1.0/attach.tcl | 96 +
web/cgi/alpine/1.0/cledit.tcl | 232 +++
web/cgi/alpine/1.0/cmdfunc.tcl | 639 ++++++
web/cgi/alpine/1.0/common.tcl | 289 +++
web/cgi/alpine/1.0/compose.tcl | 804 ++++++++
web/cgi/alpine/1.0/comview.tcl | 184 ++
web/cgi/alpine/1.0/conf_process.tcl | 1358 +++++++++++++
web/cgi/alpine/1.0/detach.tcl | 183 ++
web/cgi/alpine/1.0/do_help.tcl | 48 +
web/cgi/alpine/1.0/do_open.tcl | 126 ++
web/cgi/alpine/1.0/do_quit.tcl | 98 +
web/cgi/alpine/1.0/do_view.tcl | 190 ++
web/cgi/alpine/1.0/docancel.tcl | 56 +
web/cgi/alpine/1.0/dosend.tcl | 99 +
web/cgi/alpine/1.0/export.tcl | 165 ++
web/cgi/alpine/1.0/exporting.tcl | 187 ++
web/cgi/alpine/1.0/filtedit.tcl | 704 +++++++
web/cgi/alpine/1.0/filter.tcl | 63 +
web/cgi/alpine/1.0/flags.tcl | 112 ++
web/cgi/alpine/1.0/fldrbrowse.tcl | 335 ++++
web/cgi/alpine/1.0/fldrsavenew.tcl | 202 ++
web/cgi/alpine/1.0/folders.tcl | 727 +++++++
web/cgi/alpine/1.0/fr_addrbrowse.tcl | 66 +
web/cgi/alpine/1.0/fr_addredit.tcl | 86 +
web/cgi/alpine/1.0/fr_cledit.tcl | 79 +
web/cgi/alpine/1.0/fr_compose.tcl | 144 ++
web/cgi/alpine/1.0/fr_filtedit.tcl | 136 ++
web/cgi/alpine/1.0/fr_flags.tcl | 67 +
web/cgi/alpine/1.0/fr_fldrbrowse.tcl | 71 +
web/cgi/alpine/1.0/fr_fldrsavenew.tcl | 65 +
web/cgi/alpine/1.0/fr_help.tcl | 91 +
web/cgi/alpine/1.0/fr_index.tcl | 58 +
web/cgi/alpine/1.0/fr_ldapbrowse.tcl | 61 +
web/cgi/alpine/1.0/fr_ldapquery.tcl | 75 +
web/cgi/alpine/1.0/fr_main.tcl | 34 +
web/cgi/alpine/1.0/fr_promptsave.tcl | 68 +
web/cgi/alpine/1.0/fr_queryattach.tcl | 70 +
web/cgi/alpine/1.0/fr_queryauth.tcl | 71 +
web/cgi/alpine/1.0/fr_querycreate.tcl | 42 +
web/cgi/alpine/1.0/fr_querydelfldr.tcl | 43 +
web/cgi/alpine/1.0/fr_queryexpunge.tcl | 71 +
web/cgi/alpine/1.0/fr_queryimport.tcl | 44 +
web/cgi/alpine/1.0/fr_querynewdir.tcl | 43 +
web/cgi/alpine/1.0/fr_querynewfldr.tcl | 43 +
web/cgi/alpine/1.0/fr_querynewfoldir.tcl | 43 +
web/cgi/alpine/1.0/fr_queryprune.tcl | 66 +
web/cgi/alpine/1.0/fr_queryquit.tcl | 70 +
web/cgi/alpine/1.0/fr_queryrenfldr.tcl | 43 +
web/cgi/alpine/1.0/fr_querysave.tcl | 68 +
web/cgi/alpine/1.0/fr_resume.tcl | 104 +
web/cgi/alpine/1.0/fr_seldate.tcl | 70 +
web/cgi/alpine/1.0/fr_select.tcl | 71 +
web/cgi/alpine/1.0/fr_selstat.tcl | 71 +
web/cgi/alpine/1.0/fr_seltext.tcl | 71 +
web/cgi/alpine/1.0/fr_spellcheck.tcl | 71 +
web/cgi/alpine/1.0/fr_split.tcl | 58 +
web/cgi/alpine/1.0/fr_take.tcl | 70 +
web/cgi/alpine/1.0/fr_takeedit.tcl | 79 +
web/cgi/alpine/1.0/fr_takesame.tcl | 79 +
web/cgi/alpine/1.0/fr_tconfig.tcl | 69 +
web/cgi/alpine/1.0/fr_view.tcl | 30 +
web/cgi/alpine/1.0/genvars.tcl | 114 ++
web/cgi/alpine/1.0/header.tcl | 226 +++
web/cgi/alpine/1.0/help.tcl | 36 +
web/cgi/alpine/1.0/help/about.tcl | 30 +
web/cgi/alpine/1.0/help/addrbook.html | 61 +
web/cgi/alpine/1.0/help/addrbrowse.html | 27 +
web/cgi/alpine/1.0/help/addredit.html | 59 +
web/cgi/alpine/1.0/help/attach.html | 37 +
web/cgi/alpine/1.0/help/compose.html | 147 ++
web/cgi/alpine/1.0/help/create_save.tcl | 17 +
web/cgi/alpine/1.0/help/expunge.html | 20 +
web/cgi/alpine/1.0/help/filtconf.html | 62 +
web/cgi/alpine/1.0/help/filtedit.html | 240 +++
web/cgi/alpine/1.0/help/folders.html | 39 +
web/cgi/alpine/1.0/help/foldiradd.html | 30 +
web/cgi/alpine/1.0/help/forward.tcl | 16 +
web/cgi/alpine/1.0/help/index.html | 281 +++
web/cgi/alpine/1.0/help/index.tcl.1 | 301 +++
web/cgi/alpine/1.0/help/release.html | 83 +
web/cgi/alpine/1.0/help/reply.tcl | 17 +
web/cgi/alpine/1.0/help/resume.html | 28 +
web/cgi/alpine/1.0/help/secure.html | 119 ++
web/cgi/alpine/1.0/help/takeaddr.html | 34 +
web/cgi/alpine/1.0/help/takeedit.html | 63 +
web/cgi/alpine/1.0/help/tech-notes.html | 471 +++++
web/cgi/alpine/1.0/help/view.html | 195 ++
web/cgi/alpine/1.0/help/wpsys.jpeg | Bin 0 -> 17284 bytes
web/cgi/alpine/1.0/helpbody.tcl | 200 ++
web/cgi/alpine/1.0/helpindex.tcl | 102 +
web/cgi/alpine/1.0/index.tcl | 1972 ++++++++++++++++++
web/cgi/alpine/1.0/ldapbrowse.tcl | 220 +++
web/cgi/alpine/1.0/ldapentry.tcl | 315 +++
web/cgi/alpine/1.0/ldappick.tcl | 76 +
web/cgi/alpine/1.0/ldapquery.tcl | 144 ++
web/cgi/alpine/1.0/ldapresult.tcl | 375 ++++
web/cgi/alpine/1.0/main.tcl | 84 +
web/cgi/alpine/1.0/open.tcl | 33 +
web/cgi/alpine/1.0/post.tcl | 651 ++++++
web/cgi/alpine/1.0/promptsave.tcl | 149 ++
web/cgi/alpine/1.0/prune.tcl | 74 +
web/cgi/alpine/1.0/queryattach.tcl | 145 ++
web/cgi/alpine/1.0/querycreate.tcl | 114 ++
web/cgi/alpine/1.0/querydelfldr.tcl | 121 ++
web/cgi/alpine/1.0/queryexpunge.tcl | 203 ++
web/cgi/alpine/1.0/queryimport.tcl | 146 ++
web/cgi/alpine/1.0/querynewdir.tcl | 113 ++
web/cgi/alpine/1.0/querynewfldr.tcl | 112 ++
web/cgi/alpine/1.0/querynewfoldir.tcl | 131 ++
web/cgi/alpine/1.0/querynick.tcl | 171 ++
web/cgi/alpine/1.0/queryprune.tcl | 170 ++
web/cgi/alpine/1.0/queryquit.tcl | 196 ++
web/cgi/alpine/1.0/queryrenfldr.tcl | 109 +
web/cgi/alpine/1.0/querysave.tcl | 98 +
web/cgi/alpine/1.0/resume.tcl | 169 ++
web/cgi/alpine/1.0/ripcord.tcl | 64 +
web/cgi/alpine/1.0/seldate.tcl | 193 ++
web/cgi/alpine/1.0/select.tcl | 303 +++
web/cgi/alpine/1.0/select2.tcl | 318 +++
web/cgi/alpine/1.0/selstat.tcl | 156 ++
web/cgi/alpine/1.0/seltext.tcl | 181 ++
web/cgi/alpine/1.0/spellcheck.tcl | 399 ++++
web/cgi/alpine/1.0/takeaddr.tcl | 215 ++
web/cgi/alpine/1.0/tclsh | 1 +
web/cgi/alpine/1.0/tconfig.tcl | 1183 +++++++++++
web/cgi/alpine/1.0/view.tcl | 920 +++++++++
web/cgi/alpine/1.0/wp.tcl | 135 ++
web/cgi/alpine/2.0/.htaccess | 7 +
web/cgi/alpine/2.0/alpine.tcl | 1 +
web/cgi/alpine/2.0/browse | 336 ++++
web/cgi/alpine/2.0/common.tcl | 905 +++++++++
web/cgi/alpine/2.0/compose | 817 ++++++++
web/cgi/alpine/2.0/conduit/apply.tcl | 76 +
web/cgi/alpine/2.0/conduit/attach.tcl | 101 +
web/cgi/alpine/2.0/conduit/cert.tcl | 48 +
web/cgi/alpine/2.0/conduit/complete.tcl | 54 +
web/cgi/alpine/2.0/conduit/contactlist.tcl | 306 +++
web/cgi/alpine/2.0/conduit/empty.tcl | 73 +
web/cgi/alpine/2.0/conduit/exists.tcl | 65 +
web/cgi/alpine/2.0/conduit/expand.tcl | 84 +
web/cgi/alpine/2.0/conduit/export | 168 ++
web/cgi/alpine/2.0/conduit/flag.tcl | 77 +
web/cgi/alpine/2.0/conduit/folderlist.tcl | 255 +++
web/cgi/alpine/2.0/conduit/getcontact.tcl | 53 +
web/cgi/alpine/2.0/conduit/import | 73 +
web/cgi/alpine/2.0/conduit/mark.tcl | 77 +
web/cgi/alpine/2.0/conduit/newmail.tcl | 56 +
web/cgi/alpine/2.0/conduit/post.tcl | 333 ++++
web/cgi/alpine/2.0/conduit/query.tcl | 83 +
web/cgi/alpine/2.0/conduit/settings.tcl | 184 ++
web/cgi/alpine/2.0/conduit/storecontact.tcl | 67 +
web/cgi/alpine/2.0/conduit/take.tcl | 84 +
web/cgi/alpine/2.0/conduit/tclsh | 1 +
web/cgi/alpine/2.0/contacts | 201 ++
web/cgi/alpine/2.0/css/cbn/contactdialog.css | 108 +
web/cgi/alpine/2.0/css/cbn/contacts.css | 87 +
web/cgi/alpine/2.0/css/cbn/folderdialog.css | 96 +
web/cgi/alpine/2.0/css/cbn/folders.css | 99 +
web/cgi/alpine/2.0/css/cbn/screen.css | 2084 ++++++++++++++++++++
web/cgi/alpine/2.0/css/help.css | 119 ++
web/cgi/alpine/2.0/css/help_popup.css | 114 ++
web/cgi/alpine/2.0/css/menu.css | 71 +
web/cgi/alpine/2.0/css/print.css | 0
web/cgi/alpine/2.0/detach | 172 ++
web/cgi/alpine/2.0/foldercache.tcl | 177 ++
web/cgi/alpine/2.0/folders | 240 +++
web/cgi/alpine/2.0/forward | 1 +
web/cgi/alpine/2.0/help/alpha-index.html | 225 +++
web/cgi/alpine/2.0/help/compose.html | 102 +
web/cgi/alpine/2.0/help/contacts.html | 80 +
web/cgi/alpine/2.0/help/folders.html | 96 +
web/cgi/alpine/2.0/help/graphics/attach_sm.gif | Bin 0 -> 235 bytes
web/cgi/alpine/2.0/help/graphics/compose.gif | Bin 0 -> 14390 bytes
web/cgi/alpine/2.0/help/graphics/fwd.gif | Bin 0 -> 202 bytes
web/cgi/alpine/2.0/help/graphics/new.gif | Bin 0 -> 236 bytes
web/cgi/alpine/2.0/help/graphics/parts.gif | Bin 0 -> 19744 bytes
web/cgi/alpine/2.0/help/graphics/replied.gif | Bin 0 -> 207 bytes
.../alpine/2.0/help/graphics/replied_and_fwd.gif | Bin 0 -> 216 bytes
web/cgi/alpine/2.0/help/graphics/screen-header.gif | Bin 0 -> 8054 bytes
web/cgi/alpine/2.0/help/graphics/star.gif | Bin 0 -> 573 bytes
web/cgi/alpine/2.0/help/help_home.htm | 46 +
web/cgi/alpine/2.0/help/help_index.htm | 67 +
web/cgi/alpine/2.0/help/help_settings.htm | 66 +
web/cgi/alpine/2.0/help/inbox.html | 145 ++
web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml | 4 +
web/cgi/alpine/2.0/help/popup/help_set_display.htm | 36 +
web/cgi/alpine/2.0/help/quick-start.html | 136 ++
web/cgi/alpine/2.0/help/read.html | 145 ++
web/cgi/alpine/2.0/help/search.html | 77 +
web/cgi/alpine/2.0/help/settings.html | 124 ++
web/cgi/alpine/2.0/help/topic-list.html | 101 +
web/cgi/alpine/2.0/img/cbn/Thumbs.db | Bin 0 -> 147456 bytes
web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml | 91 +
web/cgi/alpine/2.0/img/cbn/addcontact_sm.gif | Bin 0 -> 1000 bytes
web/cgi/alpine/2.0/img/cbn/addfolder.gif | Bin 0 -> 384 bytes
web/cgi/alpine/2.0/img/cbn/alert.gif | Bin 0 -> 2139 bytes
web/cgi/alpine/2.0/img/cbn/alpinelogo.gif | Bin 0 -> 2306 bytes
web/cgi/alpine/2.0/img/cbn/attach.gif | Bin 0 -> 248 bytes
web/cgi/alpine/2.0/img/cbn/attach_sm.gif | Bin 0 -> 235 bytes
web/cgi/alpine/2.0/img/cbn/base.gif | Bin 0 -> 372 bytes
web/cgi/alpine/2.0/img/cbn/blank.gif | Bin 0 -> 43 bytes
web/cgi/alpine/2.0/img/cbn/border-bl.gif | Bin 0 -> 813 bytes
web/cgi/alpine/2.0/img/cbn/border-br.gif | Bin 0 -> 812 bytes
web/cgi/alpine/2.0/img/cbn/border-ft.gif | Bin 0 -> 815 bytes
web/cgi/alpine/2.0/img/cbn/border-lt-2.gif | Bin 0 -> 959 bytes
web/cgi/alpine/2.0/img/cbn/border-lt.gif | Bin 0 -> 426 bytes
web/cgi/alpine/2.0/img/cbn/border-rt-2.gif | Bin 0 -> 961 bytes
web/cgi/alpine/2.0/img/cbn/border-rt.gif | Bin 0 -> 426 bytes
web/cgi/alpine/2.0/img/cbn/border-tl.gif | Bin 0 -> 295 bytes
web/cgi/alpine/2.0/img/cbn/border-tr.gif | Bin 0 -> 295 bytes
web/cgi/alpine/2.0/img/cbn/btnbg.gif | Bin 0 -> 283 bytes
web/cgi/alpine/2.0/img/cbn/btnhi.gif | Bin 0 -> 283 bytes
web/cgi/alpine/2.0/img/cbn/but_back.gif | Bin 0 -> 151 bytes
web/cgi/alpine/2.0/img/cbn/ccme.gif | Bin 0 -> 112 bytes
web/cgi/alpine/2.0/img/cbn/check2.gif | Bin 0 -> 1151 bytes
web/cgi/alpine/2.0/img/cbn/checkmail.gif | Bin 0 -> 1249 bytes
web/cgi/alpine/2.0/img/cbn/close.gif | Bin 0 -> 177 bytes
web/cgi/alpine/2.0/img/cbn/close2.gif | Bin 0 -> 1013 bytes
web/cgi/alpine/2.0/img/cbn/close3.gif | Bin 0 -> 958 bytes
web/cgi/alpine/2.0/img/cbn/col.gif | Bin 0 -> 95 bytes
web/cgi/alpine/2.0/img/cbn/colsel.gif | Bin 0 -> 146 bytes
web/cgi/alpine/2.0/img/cbn/compose.gif | Bin 0 -> 642 bytes
web/cgi/alpine/2.0/img/cbn/contacts.gif | Bin 0 -> 1071 bytes
web/cgi/alpine/2.0/img/cbn/dawg.gif | Bin 0 -> 377 bytes
web/cgi/alpine/2.0/img/cbn/dbar.gif | Bin 0 -> 825 bytes
web/cgi/alpine/2.0/img/cbn/delete.gif | Bin 0 -> 256 bytes
web/cgi/alpine/2.0/img/cbn/detach.gif | Bin 0 -> 417 bytes
web/cgi/alpine/2.0/img/cbn/div.gif | Bin 0 -> 45 bytes
web/cgi/alpine/2.0/img/cbn/div2.gif | Bin 0 -> 45 bytes
web/cgi/alpine/2.0/img/cbn/dn.gif | Bin 0 -> 59 bytes
web/cgi/alpine/2.0/img/cbn/edit.gif | Bin 0 -> 564 bytes
web/cgi/alpine/2.0/img/cbn/exclaim.gif | Bin 0 -> 90 bytes
web/cgi/alpine/2.0/img/cbn/f_contacts.gif | Bin 0 -> 1046 bytes
web/cgi/alpine/2.0/img/cbn/f_delete.gif | Bin 0 -> 244 bytes
web/cgi/alpine/2.0/img/cbn/f_drafts.gif | Bin 0 -> 349 bytes
web/cgi/alpine/2.0/img/cbn/f_folder.gif | Bin 0 -> 212 bytes
web/cgi/alpine/2.0/img/cbn/f_inbox.gif | Bin 0 -> 237 bytes
web/cgi/alpine/2.0/img/cbn/f_manage.gif | Bin 0 -> 241 bytes
web/cgi/alpine/2.0/img/cbn/f_minus.gif | Bin 0 -> 201 bytes
web/cgi/alpine/2.0/img/cbn/f_plus.gif | Bin 0 -> 204 bytes
web/cgi/alpine/2.0/img/cbn/f_search.gif | Bin 0 -> 242 bytes
web/cgi/alpine/2.0/img/cbn/f_sent.gif | Bin 0 -> 348 bytes
web/cgi/alpine/2.0/img/cbn/f_spam.gif | Bin 0 -> 364 bytes
web/cgi/alpine/2.0/img/cbn/fldsel.gif | Bin 0 -> 149 bytes
web/cgi/alpine/2.0/img/cbn/folder.gif | Bin 0 -> 372 bytes
web/cgi/alpine/2.0/img/cbn/folderopen.gif | Bin 0 -> 376 bytes
web/cgi/alpine/2.0/img/cbn/foldersopen.gif | Bin 0 -> 400 bytes
web/cgi/alpine/2.0/img/cbn/forward.gif | Bin 0 -> 652 bytes
web/cgi/alpine/2.0/img/cbn/fwd.gif | Bin 0 -> 202 bytes
web/cgi/alpine/2.0/img/cbn/group_contact.gif | Bin 0 -> 1121 bytes
web/cgi/alpine/2.0/img/cbn/help.gif | Bin 0 -> 1037 bytes
web/cgi/alpine/2.0/img/cbn/help_sm.gif | Bin 0 -> 631 bytes
web/cgi/alpine/2.0/img/cbn/high.gif | Bin 0 -> 906 bytes
web/cgi/alpine/2.0/img/cbn/highest.gif | Bin 0 -> 938 bytes
web/cgi/alpine/2.0/img/cbn/inbox.gif | Bin 0 -> 1169 bytes
web/cgi/alpine/2.0/img/cbn/info.gif | Bin 0 -> 111 bytes
web/cgi/alpine/2.0/img/cbn/infomsg.gif | Bin 0 -> 1044 bytes
web/cgi/alpine/2.0/img/cbn/lo.gif | Bin 0 -> 150 bytes
web/cgi/alpine/2.0/img/cbn/logo.gif | Bin 0 -> 4117 bytes
web/cgi/alpine/2.0/img/cbn/logo.png | Bin 0 -> 9271 bytes
web/cgi/alpine/2.0/img/cbn/logoff.gif | Bin 0 -> 1092 bytes
web/cgi/alpine/2.0/img/cbn/lookup.gif | Bin 0 -> 413 bytes
web/cgi/alpine/2.0/img/cbn/low.gif | Bin 0 -> 99 bytes
web/cgi/alpine/2.0/img/cbn/menu.gif | Bin 0 -> 81 bytes
web/cgi/alpine/2.0/img/cbn/msglist.gif | Bin 0 -> 413 bytes
web/cgi/alpine/2.0/img/cbn/msglist.gif.bak | Bin 0 -> 413 bytes
web/cgi/alpine/2.0/img/cbn/musicfolder.gif | Bin 0 -> 633 bytes
web/cgi/alpine/2.0/img/cbn/navbg.gif | Bin 0 -> 283 bytes
web/cgi/alpine/2.0/img/cbn/new.gif | Bin 0 -> 236 bytes
web/cgi/alpine/2.0/img/cbn/page.gif | Bin 0 -> 582 bytes
web/cgi/alpine/2.0/img/cbn/parent.gif | Bin 0 -> 374 bytes
web/cgi/alpine/2.0/img/cbn/partly.gif | Bin 0 -> 371 bytes
web/cgi/alpine/2.0/img/cbn/pg_down.gif | Bin 0 -> 133 bytes
web/cgi/alpine/2.0/img/cbn/pg_first.gif | Bin 0 -> 213 bytes
web/cgi/alpine/2.0/img/cbn/pg_last.gif | Bin 0 -> 217 bytes
web/cgi/alpine/2.0/img/cbn/pg_next.gif | Bin 0 -> 144 bytes
web/cgi/alpine/2.0/img/cbn/pg_prev.gif | Bin 0 -> 139 bytes
web/cgi/alpine/2.0/img/cbn/pg_up.gif | Bin 0 -> 136 bytes
web/cgi/alpine/2.0/img/cbn/print.gif | Bin 0 -> 252 bytes
web/cgi/alpine/2.0/img/cbn/question.gif | Bin 0 -> 1538 bytes
web/cgi/alpine/2.0/img/cbn/question.jpg | Bin 0 -> 1278 bytes
web/cgi/alpine/2.0/img/cbn/question.png | Bin 0 -> 3304 bytes
web/cgi/alpine/2.0/img/cbn/question2.jpg | Bin 0 -> 1599 bytes
web/cgi/alpine/2.0/img/cbn/remove.gif | Bin 0 -> 1031 bytes
web/cgi/alpine/2.0/img/cbn/rename.gif | Bin 0 -> 161 bytes
web/cgi/alpine/2.0/img/cbn/replied.gif | Bin 0 -> 207 bytes
web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gif | Bin 0 -> 216 bytes
web/cgi/alpine/2.0/img/cbn/reply.gif | Bin 0 -> 669 bytes
web/cgi/alpine/2.0/img/cbn/replyall.gif | Bin 0 -> 671 bytes
web/cgi/alpine/2.0/img/cbn/return.gif | Bin 0 -> 75 bytes
web/cgi/alpine/2.0/img/cbn/rt.gif | Bin 0 -> 71 bytes
web/cgi/alpine/2.0/img/cbn/save.gif | Bin 0 -> 259 bytes
web/cgi/alpine/2.0/img/cbn/search.gif | Bin 0 -> 718 bytes
web/cgi/alpine/2.0/img/cbn/send.gif | Bin 0 -> 407 bytes
web/cgi/alpine/2.0/img/cbn/settings.gif | Bin 0 -> 996 bytes
web/cgi/alpine/2.0/img/cbn/sound.gif | Bin 0 -> 1014 bytes
web/cgi/alpine/2.0/img/cbn/spam.gif | Bin 0 -> 623 bytes
web/cgi/alpine/2.0/img/cbn/spam2.gif | Bin 0 -> 1426 bytes
web/cgi/alpine/2.0/img/cbn/spell.gif | Bin 0 -> 166 bytes
web/cgi/alpine/2.0/img/cbn/spritelib.gif | Bin 0 -> 10907 bytes
web/cgi/alpine/2.0/img/cbn/spritelib.png | Bin 0 -> 24911 bytes
web/cgi/alpine/2.0/img/cbn/star.gif | Bin 0 -> 573 bytes
web/cgi/alpine/2.0/img/cbn/starred.gif | Bin 0 -> 541 bytes
web/cgi/alpine/2.0/img/cbn/statbak.gif | Bin 0 -> 145 bytes
web/cgi/alpine/2.0/img/cbn/statbakend.gif | Bin 0 -> 89 bytes
web/cgi/alpine/2.0/img/cbn/statbakl.gif | Bin 0 -> 93 bytes
web/cgi/alpine/2.0/img/cbn/statbakr.gif | Bin 0 -> 93 bytes
web/cgi/alpine/2.0/img/cbn/sunny.gif | Bin 0 -> 360 bytes
web/cgi/alpine/2.0/img/cbn/tome.gif | Bin 0 -> 122 bytes
web/cgi/alpine/2.0/img/cbn/trans.gif | Bin 0 -> 55 bytes
web/cgi/alpine/2.0/img/cbn/up.gif | Bin 0 -> 59 bytes
web/cgi/alpine/2.0/img/cbn/uw.gif | Bin 0 -> 1569 bytes
web/cgi/alpine/2.0/img/cbn/uwlogo.gif | Bin 0 -> 2458 bytes
web/cgi/alpine/2.0/img/cbn/wbar.gif | Bin 0 -> 94 bytes
web/cgi/alpine/2.0/lib/INSTALL | 3 +
web/cgi/alpine/2.0/lib/common.js | 1586 +++++++++++++++
web/cgi/alpine/2.0/lib/compose.js | 833 ++++++++
web/cgi/alpine/2.0/lib/contacts.js | 121 ++
web/cgi/alpine/2.0/lib/folders.js | 258 +++
web/cgi/alpine/2.0/lib/mailbox.js | 1076 ++++++++++
web/cgi/alpine/2.0/lib/settings.js | 183 ++
web/cgi/alpine/2.0/lib/yui | 1 +
web/cgi/alpine/2.0/mailto | 1 +
web/cgi/alpine/2.0/messagelist.tcl | 622 ++++++
web/cgi/alpine/2.0/messageview.tcl | 731 +++++++
web/cgi/alpine/2.0/newlist.tcl | 477 +++++
web/cgi/alpine/2.0/newview.tcl | 306 +++
web/cgi/alpine/2.0/reply | 1 +
web/cgi/alpine/2.0/replyall | 1 +
web/cgi/alpine/2.0/resume | 1 +
web/cgi/alpine/2.0/settings | 734 +++++++
web/cgi/alpine/2.0/tclsh | 1 +
web/cgi/alpine/2.0/view | 237 +++
web/cgi/alpine/alpine.tcl | 1 +
web/cgi/alpine/farewell.tcl | 40 +
web/cgi/alpine/tclsh | 1 +
web/cgi/alpine/whackatch.tcl | 46 +
web/cgi/detach | 1 +
web/cgi/favicon.ico | Bin 0 -> 5694 bytes
web/cgi/greeting.tcl | 21 +
web/cgi/images/Lavender_Chiffon.gif | Bin 0 -> 2578 bytes
web/cgi/images/b_minus.gif | Bin 0 -> 64 bytes
web/cgi/images/b_plus.gif | Bin 0 -> 81 bytes
web/cgi/images/barblank.gif | Bin 0 -> 57 bytes
web/cgi/images/barclose.gif | Bin 0 -> 96 bytes
web/cgi/images/barclose_mid.gif | Bin 0 -> 65 bytes
web/cgi/images/barmsg.gif | Bin 0 -> 71 bytes
web/cgi/images/baropen.gif | Bin 0 -> 91 bytes
web/cgi/images/baropen_mid.gif | Bin 0 -> 65 bytes
web/cgi/images/barvert.gif | Bin 0 -> 73 bytes
web/cgi/images/barvertmsg.gif | Bin 0 -> 76 bytes
web/cgi/images/bg_index.gif | Bin 0 -> 46 bytes
web/cgi/images/blackdot.gif | Bin 0 -> 35 bytes
web/cgi/images/book.gif | Bin 0 -> 279 bytes
web/cgi/images/but_abook.gif | Bin 0 -> 265 bytes
web/cgi/images/but_cancel.gif | Bin 0 -> 213 bytes
web/cgi/images/but_create.gif | Bin 0 -> 211 bytes
web/cgi/images/but_folddel.gif | Bin 0 -> 269 bytes
web/cgi/images/but_foldexp.gif | Bin 0 -> 279 bytes
web/cgi/images/but_foldren.gif | Bin 0 -> 302 bytes
web/cgi/images/but_remove.gif | Bin 0 -> 145 bytes
web/cgi/images/but_resume.gif | Bin 0 -> 218 bytes
web/cgi/images/but_rnd_block.gif | Bin 0 -> 2067 bytes
web/cgi/images/but_rnd_first3.gif | Bin 0 -> 911 bytes
web/cgi/images/but_rnd_last3.gif | Bin 0 -> 905 bytes
web/cgi/images/but_rnd_next3.gif | Bin 0 -> 908 bytes
web/cgi/images/but_rnd_prev3.gif | Bin 0 -> 923 bytes
web/cgi/images/but_s_do.gif | Bin 0 -> 158 bytes
web/cgi/images/but_save.gif | Bin 0 -> 197 bytes
web/cgi/images/buttons/silver/allmsgs.gif | Bin 0 -> 2882 bytes
web/cgi/images/buttons/silver/attach.gif | Bin 0 -> 2805 bytes
web/cgi/images/buttons/silver/cancel.gif | Bin 0 -> 2807 bytes
web/cgi/images/buttons/silver/compose.gif | Bin 0 -> 2893 bytes
web/cgi/images/buttons/silver/compose8.gif | Bin 0 -> 680 bytes
web/cgi/images/buttons/silver/config.gif | Bin 0 -> 2889 bytes
web/cgi/images/buttons/silver/delete.gif | Bin 0 -> 2807 bytes
web/cgi/images/buttons/silver/delete2.gif | Bin 0 -> 2076 bytes
web/cgi/images/buttons/silver/done.gif | Bin 0 -> 2722 bytes
web/cgi/images/buttons/silver/exit.gif | Bin 0 -> 2896 bytes
web/cgi/images/buttons/silver/expunge.gif | Bin 0 -> 2863 bytes
web/cgi/images/buttons/silver/firstpage.gif | Bin 0 -> 2575 bytes
web/cgi/images/buttons/silver/firstpage2.gif | Bin 0 -> 1706 bytes
web/cgi/images/buttons/silver/firstpage4.gif | Bin 0 -> 1703 bytes
web/cgi/images/buttons/silver/folders.gif | Bin 0 -> 2903 bytes
web/cgi/images/buttons/silver/forward.gif | Bin 0 -> 2908 bytes
web/cgi/images/buttons/silver/lastpage.gif | Bin 0 -> 2595 bytes
web/cgi/images/buttons/silver/lastpage2.gif | Bin 0 -> 1717 bytes
web/cgi/images/buttons/silver/lastpage4.gif | Bin 0 -> 1691 bytes
web/cgi/images/buttons/silver/logout.gif | Bin 0 -> 2832 bytes
web/cgi/images/buttons/silver/messages.gif | Bin 0 -> 2894 bytes
web/cgi/images/buttons/silver/nextpage.gif | Bin 0 -> 2520 bytes
web/cgi/images/buttons/silver/nextpage2.gif | Bin 0 -> 2611 bytes
web/cgi/images/buttons/silver/ok.gif | Bin 0 -> 2640 bytes
web/cgi/images/buttons/silver/prevpage.gif | Bin 0 -> 2485 bytes
web/cgi/images/buttons/silver/prevpage2.gif | Bin 0 -> 1672 bytes
web/cgi/images/buttons/silver/quit.gif | Bin 0 -> 2689 bytes
web/cgi/images/buttons/silver/reply.gif | Bin 0 -> 2805 bytes
web/cgi/images/buttons/silver/replyall.gif | Bin 0 -> 2932 bytes
web/cgi/images/buttons/silver/save.gif | Bin 0 -> 2733 bytes
web/cgi/images/buttons/silver/send.gif | Bin 0 -> 2738 bytes
web/cgi/images/buttons/silver/undelete.gif | Bin 0 -> 2864 bytes
web/cgi/images/caution.gif | Bin 0 -> 134 bytes
web/cgi/images/cf_add.gif | Bin 0 -> 150 bytes
web/cgi/images/cf_delete.gif | Bin 0 -> 166 bytes
web/cgi/images/cf_edit.gif | Bin 0 -> 148 bytes
web/cgi/images/cf_help.gif | Bin 0 -> 65 bytes
web/cgi/images/cf_shdown.gif | Bin 0 -> 102 bytes
web/cgi/images/cf_shup.gif | Bin 0 -> 103 bytes
web/cgi/images/decreas4.gif | Bin 0 -> 900 bytes
web/cgi/images/dot.gif | Bin 0 -> 49 bytes
web/cgi/images/dot2.gif | Bin 0 -> 43 bytes
web/cgi/images/dotblink.gif | Bin 0 -> 261 bytes
web/cgi/images/dstripe.gif | Bin 0 -> 73 bytes
web/cgi/images/env/d_new.gif | Bin 0 -> 142 bytes
web/cgi/images/env/d_newans.gif | Bin 0 -> 157 bytes
web/cgi/images/env/d_newansdel.gif | Bin 0 -> 209 bytes
web/cgi/images/env/d_newdel.gif | Bin 0 -> 235 bytes
web/cgi/images/env/d_newimp.gif | Bin 0 -> 169 bytes
web/cgi/images/env/d_newimpans.gif | Bin 0 -> 219 bytes
web/cgi/images/env/d_newimpansdel.gif | Bin 0 -> 241 bytes
web/cgi/images/env/d_newimpdel.gif | Bin 0 -> 222 bytes
web/cgi/images/env/d_newyou.gif | Bin 0 -> 156 bytes
web/cgi/images/env/d_newyouans.gif | Bin 0 -> 173 bytes
web/cgi/images/env/d_newyouansdel.gif | Bin 0 -> 225 bytes
web/cgi/images/env/d_newyoudel.gif | Bin 0 -> 177 bytes
web/cgi/images/env/d_read.gif | Bin 0 -> 159 bytes
web/cgi/images/env/d_readans.gif | Bin 0 -> 203 bytes
web/cgi/images/env/d_readansdel.gif | Bin 0 -> 221 bytes
web/cgi/images/env/d_readdel.gif | Bin 0 -> 282 bytes
web/cgi/images/env/d_readimp.gif | Bin 0 -> 187 bytes
web/cgi/images/env/d_readimpans.gif | Bin 0 -> 234 bytes
web/cgi/images/env/d_readimpansdel.gif | Bin 0 -> 250 bytes
web/cgi/images/env/d_readimpdel.gif | Bin 0 -> 310 bytes
web/cgi/images/env/d_readyou.gif | Bin 0 -> 171 bytes
web/cgi/images/env/d_readyouans.gif | Bin 0 -> 218 bytes
web/cgi/images/env/d_readyouansdel.gif | Bin 0 -> 236 bytes
web/cgi/images/env/d_readyoudel.gif | Bin 0 -> 292 bytes
web/cgi/images/env/new.gif | Bin 0 -> 144 bytes
web/cgi/images/env/newans.gif | Bin 0 -> 196 bytes
web/cgi/images/env/newansdel.gif | Bin 0 -> 216 bytes
web/cgi/images/env/newdel.gif | Bin 0 -> 162 bytes
web/cgi/images/env/newimp.gif | Bin 0 -> 174 bytes
web/cgi/images/env/newimpans.gif | Bin 0 -> 200 bytes
web/cgi/images/env/newimpansdel.gif | Bin 0 -> 245 bytes
web/cgi/images/env/newimpdel.gif | Bin 0 -> 220 bytes
web/cgi/images/env/newyou.gif | Bin 0 -> 161 bytes
web/cgi/images/env/newyouans.gif | Bin 0 -> 208 bytes
web/cgi/images/env/newyouansdel.gif | Bin 0 -> 231 bytes
web/cgi/images/env/newyoudel.gif | Bin 0 -> 204 bytes
web/cgi/images/env/read.gif | Bin 0 -> 165 bytes
web/cgi/images/env/readans.gif | Bin 0 -> 182 bytes
web/cgi/images/env/readansdel.gif | Bin 0 -> 229 bytes
web/cgi/images/env/readdel.gif | Bin 0 -> 184 bytes
web/cgi/images/env/readimp.gif | Bin 0 -> 192 bytes
web/cgi/images/env/readimpans.gif | Bin 0 -> 212 bytes
web/cgi/images/env/readimpansdel.gif | Bin 0 -> 256 bytes
web/cgi/images/env/readimpdel.gif | Bin 0 -> 235 bytes
web/cgi/images/env/readyou.border.gif | Bin 0 -> 209 bytes
web/cgi/images/env/readyou.gif | Bin 0 -> 173 bytes
web/cgi/images/env/readyouans.gif | Bin 0 -> 196 bytes
web/cgi/images/env/readyouansdel.gif | Bin 0 -> 238 bytes
web/cgi/images/env/readyoudel.gif | Bin 0 -> 217 bytes
web/cgi/images/hdr.gif | Bin 0 -> 95 bytes
web/cgi/images/hdrless.gif | Bin 0 -> 164 bytes
web/cgi/images/hdrmore.gif | Bin 0 -> 170 bytes
web/cgi/images/hdrnon.gif | Bin 0 -> 108 bytes
web/cgi/images/help_trans.gif | Bin 0 -> 125 bytes
web/cgi/images/ibarmsg.gif | Bin 0 -> 137 bytes
web/cgi/images/ibarvertmsg.gif | Bin 0 -> 76 bytes
web/cgi/images/if_blank.gif | Bin 0 -> 325 bytes
web/cgi/images/if_left.gif | Bin 0 -> 329 bytes
web/cgi/images/if_narrow.gif | Bin 0 -> 408 bytes
web/cgi/images/if_narrow2.gif | Bin 0 -> 328 bytes
web/cgi/images/if_remove.gif | Bin 0 -> 318 bytes
web/cgi/images/if_right.gif | Bin 0 -> 330 bytes
web/cgi/images/if_widen.gif | Bin 0 -> 412 bytes
web/cgi/images/if_wider.gif | Bin 0 -> 328 bytes
web/cgi/images/increas4.gif | Bin 0 -> 838 bytes
web/cgi/images/indexhdr.gif | Bin 0 -> 143 bytes
web/cgi/images/logo/alpine/back.gif | Bin 0 -> 251 bytes
web/cgi/images/logo/alpine/big.gif | Bin 0 -> 9059 bytes
web/cgi/images/logo/alpine/small-blank.gif | Bin 0 -> 3352 bytes
web/cgi/images/logo/alpine/small.gif | Bin 0 -> 3067 bytes
web/cgi/images/markall3.gif | Bin 0 -> 189 bytes
web/cgi/images/marknone3.gif | Bin 0 -> 165 bytes
web/cgi/images/minus2.gif | Bin 0 -> 64 bytes
web/cgi/images/nondither10x10.gif | Bin 0 -> 6829 bytes
web/cgi/images/plus2.gif | Bin 0 -> 73 bytes
web/cgi/images/postmark.gif | Bin 0 -> 562 bytes
web/cgi/images/printer2.gif | Bin 0 -> 145 bytes
web/cgi/images/slidein.gif | Bin 0 -> 126 bytes
web/cgi/images/slideout.gif | Bin 0 -> 125 bytes
web/cgi/images/tabless.gif | Bin 0 -> 90 bytes
web/cgi/images/tabmore.gif | Bin 0 -> 102 bytes
web/cgi/images/tabs/abdtab.gif | Bin 0 -> 550 bytes
web/cgi/images/tabs/abtab.gif | Bin 0 -> 265 bytes
web/cgi/images/tabs/blank.gif | Bin 0 -> 130 bytes
web/cgi/images/tabs/cdtab.gif | Bin 0 -> 493 bytes
web/cgi/images/tabs/ctab.gif | Bin 0 -> 214 bytes
web/cgi/images/tabs/fdtab.gif | Bin 0 -> 461 bytes
web/cgi/images/tabs/ftab.gif | Bin 0 -> 190 bytes
web/cgi/images/tabs/gdtab.gif | Bin 0 -> 471 bytes
web/cgi/images/tabs/gtab.gif | Bin 0 -> 196 bytes
web/cgi/images/tabs/mldtab.gif | Bin 0 -> 529 bytes
web/cgi/images/tabs/mltab.gif | Bin 0 -> 251 bytes
web/cgi/images/tabs/mvdtab.gif | Bin 0 -> 540 bytes
web/cgi/images/tabs/mvtab.gif | Bin 0 -> 255 bytes
web/cgi/images/tabs/rdtab.gif | Bin 0 -> 437 bytes
web/cgi/images/tabs/rtab.gif | Bin 0 -> 173 bytes
web/cgi/images/tabs/tabbg.gif | Bin 0 -> 236 bytes
web/cgi/images/tabs/tabmid.gif | Bin 0 -> 64 bytes
web/cgi/motd.sample | 5 +
web/cgi/pub/alpine.tcl | 1 +
web/cgi/pub/getach.tcl | 87 +
web/cgi/pub/standard.css | 45 +
web/cgi/pub/standard.js | 414 ++++
web/cgi/pub/tclsh | 1 +
web/cgi/session/.htaccess | 28 +
web/cgi/session/_htaccess | 28 +
web/cgi/session/alpine.tcl | 1 +
web/cgi/session/greeting.tcl | 395 ++++
web/cgi/session/init.tcl | 218 ++
web/cgi/session/logon.tcl | 169 ++
web/cgi/session/logout.tcl | 67 +
web/cgi/session/logout/alpine.tcl | 1 +
web/cgi/session/logout/logout.tcl | 51 +
web/cgi/session/logout/tclsh | 1 +
web/cgi/session/monitor.tcl | 282 +++
web/cgi/session/queryauth.tcl | 120 ++
web/cgi/session/setauth.tcl | 68 +
web/cgi/session/setauth2.tcl | 58 +
web/cgi/session/setpassphrase.tcl | 52 +
web/cgi/session/startup.tcl | 33 +
web/cgi/session/tclsh | 1 +
web/cgi/sounds/ding.wav | Bin 0 -> 11598 bytes
web/cgi/sounds/mail_msg.wav | Bin 0 -> 23022 bytes
web/cgi/tclsh | 1 +
544 files changed, 42895 insertions(+)
create mode 100644 web/cgi/.htaccess
create mode 120000 web/cgi/alpine.tcl
create mode 100755 web/cgi/alpine/1.0/addrbook.tcl
create mode 100755 web/cgi/alpine/1.0/addredit.tcl
create mode 100755 web/cgi/alpine/1.0/addrpick.tcl
create mode 100755 web/cgi/alpine/1.0/addrsave.tcl
create mode 120000 web/cgi/alpine/1.0/alpine.tcl
create mode 100755 web/cgi/alpine/1.0/attach.tcl
create mode 100755 web/cgi/alpine/1.0/cledit.tcl
create mode 100755 web/cgi/alpine/1.0/cmdfunc.tcl
create mode 100755 web/cgi/alpine/1.0/common.tcl
create mode 100755 web/cgi/alpine/1.0/compose.tcl
create mode 100755 web/cgi/alpine/1.0/comview.tcl
create mode 100755 web/cgi/alpine/1.0/conf_process.tcl
create mode 100755 web/cgi/alpine/1.0/detach.tcl
create mode 100644 web/cgi/alpine/1.0/do_help.tcl
create mode 100755 web/cgi/alpine/1.0/do_open.tcl
create mode 100755 web/cgi/alpine/1.0/do_quit.tcl
create mode 100755 web/cgi/alpine/1.0/do_view.tcl
create mode 100755 web/cgi/alpine/1.0/docancel.tcl
create mode 100755 web/cgi/alpine/1.0/dosend.tcl
create mode 100755 web/cgi/alpine/1.0/export.tcl
create mode 100644 web/cgi/alpine/1.0/exporting.tcl
create mode 100755 web/cgi/alpine/1.0/filtedit.tcl
create mode 100755 web/cgi/alpine/1.0/filter.tcl
create mode 100755 web/cgi/alpine/1.0/flags.tcl
create mode 100755 web/cgi/alpine/1.0/fldrbrowse.tcl
create mode 100755 web/cgi/alpine/1.0/fldrsavenew.tcl
create mode 100755 web/cgi/alpine/1.0/folders.tcl
create mode 100755 web/cgi/alpine/1.0/fr_addrbrowse.tcl
create mode 100644 web/cgi/alpine/1.0/fr_addredit.tcl
create mode 100755 web/cgi/alpine/1.0/fr_cledit.tcl
create mode 100755 web/cgi/alpine/1.0/fr_compose.tcl
create mode 100755 web/cgi/alpine/1.0/fr_filtedit.tcl
create mode 100755 web/cgi/alpine/1.0/fr_flags.tcl
create mode 100644 web/cgi/alpine/1.0/fr_fldrbrowse.tcl
create mode 100644 web/cgi/alpine/1.0/fr_fldrsavenew.tcl
create mode 100755 web/cgi/alpine/1.0/fr_help.tcl
create mode 100755 web/cgi/alpine/1.0/fr_index.tcl
create mode 100755 web/cgi/alpine/1.0/fr_ldapbrowse.tcl
create mode 100644 web/cgi/alpine/1.0/fr_ldapquery.tcl
create mode 100755 web/cgi/alpine/1.0/fr_main.tcl
create mode 100755 web/cgi/alpine/1.0/fr_promptsave.tcl
create mode 100755 web/cgi/alpine/1.0/fr_queryattach.tcl
create mode 100755 web/cgi/alpine/1.0/fr_queryauth.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querycreate.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querydelfldr.tcl
create mode 100755 web/cgi/alpine/1.0/fr_queryexpunge.tcl
create mode 100644 web/cgi/alpine/1.0/fr_queryimport.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querynewdir.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querynewfldr.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querynewfoldir.tcl
create mode 100644 web/cgi/alpine/1.0/fr_queryprune.tcl
create mode 100644 web/cgi/alpine/1.0/fr_queryquit.tcl
create mode 100755 web/cgi/alpine/1.0/fr_queryrenfldr.tcl
create mode 100755 web/cgi/alpine/1.0/fr_querysave.tcl
create mode 100755 web/cgi/alpine/1.0/fr_resume.tcl
create mode 100755 web/cgi/alpine/1.0/fr_seldate.tcl
create mode 100755 web/cgi/alpine/1.0/fr_select.tcl
create mode 100755 web/cgi/alpine/1.0/fr_selstat.tcl
create mode 100755 web/cgi/alpine/1.0/fr_seltext.tcl
create mode 100755 web/cgi/alpine/1.0/fr_spellcheck.tcl
create mode 100644 web/cgi/alpine/1.0/fr_split.tcl
create mode 100644 web/cgi/alpine/1.0/fr_take.tcl
create mode 100644 web/cgi/alpine/1.0/fr_takeedit.tcl
create mode 100644 web/cgi/alpine/1.0/fr_takesame.tcl
create mode 100755 web/cgi/alpine/1.0/fr_tconfig.tcl
create mode 100755 web/cgi/alpine/1.0/fr_view.tcl
create mode 100755 web/cgi/alpine/1.0/genvars.tcl
create mode 100755 web/cgi/alpine/1.0/header.tcl
create mode 100755 web/cgi/alpine/1.0/help.tcl
create mode 100644 web/cgi/alpine/1.0/help/about.tcl
create mode 100644 web/cgi/alpine/1.0/help/addrbook.html
create mode 100644 web/cgi/alpine/1.0/help/addrbrowse.html
create mode 100644 web/cgi/alpine/1.0/help/addredit.html
create mode 100644 web/cgi/alpine/1.0/help/attach.html
create mode 100644 web/cgi/alpine/1.0/help/compose.html
create mode 100644 web/cgi/alpine/1.0/help/create_save.tcl
create mode 100644 web/cgi/alpine/1.0/help/expunge.html
create mode 100644 web/cgi/alpine/1.0/help/filtconf.html
create mode 100644 web/cgi/alpine/1.0/help/filtedit.html
create mode 100644 web/cgi/alpine/1.0/help/folders.html
create mode 100644 web/cgi/alpine/1.0/help/foldiradd.html
create mode 100644 web/cgi/alpine/1.0/help/forward.tcl
create mode 100644 web/cgi/alpine/1.0/help/index.html
create mode 100644 web/cgi/alpine/1.0/help/index.tcl.1
create mode 100644 web/cgi/alpine/1.0/help/release.html
create mode 100644 web/cgi/alpine/1.0/help/reply.tcl
create mode 100644 web/cgi/alpine/1.0/help/resume.html
create mode 100644 web/cgi/alpine/1.0/help/secure.html
create mode 100644 web/cgi/alpine/1.0/help/takeaddr.html
create mode 100644 web/cgi/alpine/1.0/help/takeedit.html
create mode 100644 web/cgi/alpine/1.0/help/tech-notes.html
create mode 100644 web/cgi/alpine/1.0/help/view.html
create mode 100644 web/cgi/alpine/1.0/help/wpsys.jpeg
create mode 100755 web/cgi/alpine/1.0/helpbody.tcl
create mode 100755 web/cgi/alpine/1.0/helpindex.tcl
create mode 100755 web/cgi/alpine/1.0/index.tcl
create mode 100755 web/cgi/alpine/1.0/ldapbrowse.tcl
create mode 100755 web/cgi/alpine/1.0/ldapentry.tcl
create mode 100755 web/cgi/alpine/1.0/ldappick.tcl
create mode 100755 web/cgi/alpine/1.0/ldapquery.tcl
create mode 100755 web/cgi/alpine/1.0/ldapresult.tcl
create mode 100755 web/cgi/alpine/1.0/main.tcl
create mode 100755 web/cgi/alpine/1.0/open.tcl
create mode 100755 web/cgi/alpine/1.0/post.tcl
create mode 100755 web/cgi/alpine/1.0/promptsave.tcl
create mode 100755 web/cgi/alpine/1.0/prune.tcl
create mode 100755 web/cgi/alpine/1.0/queryattach.tcl
create mode 100755 web/cgi/alpine/1.0/querycreate.tcl
create mode 100755 web/cgi/alpine/1.0/querydelfldr.tcl
create mode 100755 web/cgi/alpine/1.0/queryexpunge.tcl
create mode 100755 web/cgi/alpine/1.0/queryimport.tcl
create mode 100755 web/cgi/alpine/1.0/querynewdir.tcl
create mode 100755 web/cgi/alpine/1.0/querynewfldr.tcl
create mode 100755 web/cgi/alpine/1.0/querynewfoldir.tcl
create mode 100755 web/cgi/alpine/1.0/querynick.tcl
create mode 100755 web/cgi/alpine/1.0/queryprune.tcl
create mode 100755 web/cgi/alpine/1.0/queryquit.tcl
create mode 100755 web/cgi/alpine/1.0/queryrenfldr.tcl
create mode 100755 web/cgi/alpine/1.0/querysave.tcl
create mode 100755 web/cgi/alpine/1.0/resume.tcl
create mode 100755 web/cgi/alpine/1.0/ripcord.tcl
create mode 100755 web/cgi/alpine/1.0/seldate.tcl
create mode 100755 web/cgi/alpine/1.0/select.tcl
create mode 100755 web/cgi/alpine/1.0/select2.tcl
create mode 100755 web/cgi/alpine/1.0/selstat.tcl
create mode 100755 web/cgi/alpine/1.0/seltext.tcl
create mode 100755 web/cgi/alpine/1.0/spellcheck.tcl
create mode 100755 web/cgi/alpine/1.0/takeaddr.tcl
create mode 120000 web/cgi/alpine/1.0/tclsh
create mode 100755 web/cgi/alpine/1.0/tconfig.tcl
create mode 100755 web/cgi/alpine/1.0/view.tcl
create mode 100755 web/cgi/alpine/1.0/wp.tcl
create mode 100644 web/cgi/alpine/2.0/.htaccess
create mode 120000 web/cgi/alpine/2.0/alpine.tcl
create mode 100755 web/cgi/alpine/2.0/browse
create mode 100644 web/cgi/alpine/2.0/common.tcl
create mode 100755 web/cgi/alpine/2.0/compose
create mode 100755 web/cgi/alpine/2.0/conduit/apply.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/attach.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/cert.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/complete.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/contactlist.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/empty.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/exists.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/expand.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/export
create mode 100755 web/cgi/alpine/2.0/conduit/flag.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/folderlist.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/getcontact.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/import
create mode 100755 web/cgi/alpine/2.0/conduit/mark.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/newmail.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/post.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/query.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/settings.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/storecontact.tcl
create mode 100755 web/cgi/alpine/2.0/conduit/take.tcl
create mode 120000 web/cgi/alpine/2.0/conduit/tclsh
create mode 100755 web/cgi/alpine/2.0/contacts
create mode 100644 web/cgi/alpine/2.0/css/cbn/contactdialog.css
create mode 100644 web/cgi/alpine/2.0/css/cbn/contacts.css
create mode 100644 web/cgi/alpine/2.0/css/cbn/folderdialog.css
create mode 100644 web/cgi/alpine/2.0/css/cbn/folders.css
create mode 100644 web/cgi/alpine/2.0/css/cbn/screen.css
create mode 100644 web/cgi/alpine/2.0/css/help.css
create mode 100644 web/cgi/alpine/2.0/css/help_popup.css
create mode 100644 web/cgi/alpine/2.0/css/menu.css
create mode 100644 web/cgi/alpine/2.0/css/print.css
create mode 100755 web/cgi/alpine/2.0/detach
create mode 100644 web/cgi/alpine/2.0/foldercache.tcl
create mode 100755 web/cgi/alpine/2.0/folders
create mode 120000 web/cgi/alpine/2.0/forward
create mode 100644 web/cgi/alpine/2.0/help/alpha-index.html
create mode 100644 web/cgi/alpine/2.0/help/compose.html
create mode 100644 web/cgi/alpine/2.0/help/contacts.html
create mode 100644 web/cgi/alpine/2.0/help/folders.html
create mode 100644 web/cgi/alpine/2.0/help/graphics/attach_sm.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/compose.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/fwd.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/new.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/parts.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/replied.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/replied_and_fwd.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/screen-header.gif
create mode 100644 web/cgi/alpine/2.0/help/graphics/star.gif
create mode 100644 web/cgi/alpine/2.0/help/help_home.htm
create mode 100644 web/cgi/alpine/2.0/help/help_index.htm
create mode 100644 web/cgi/alpine/2.0/help/help_settings.htm
create mode 100644 web/cgi/alpine/2.0/help/inbox.html
create mode 100644 web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml
create mode 100644 web/cgi/alpine/2.0/help/popup/help_set_display.htm
create mode 100644 web/cgi/alpine/2.0/help/quick-start.html
create mode 100644 web/cgi/alpine/2.0/help/read.html
create mode 100644 web/cgi/alpine/2.0/help/search.html
create mode 100644 web/cgi/alpine/2.0/help/settings.html
create mode 100644 web/cgi/alpine/2.0/help/topic-list.html
create mode 100644 web/cgi/alpine/2.0/img/cbn/Thumbs.db
create mode 100644 web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml
create mode 100644 web/cgi/alpine/2.0/img/cbn/addcontact_sm.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/addfolder.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/alert.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/alpinelogo.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/attach.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/attach_sm.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/base.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/blank.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-bl.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-br.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-ft.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-lt-2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-lt.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-rt-2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-rt.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-tl.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/border-tr.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/btnbg.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/btnhi.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/but_back.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/ccme.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/check2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/checkmail.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/close.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/close2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/close3.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/col.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/colsel.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/compose.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/contacts.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/dawg.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/dbar.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/delete.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/detach.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/div.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/div2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/dn.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/edit.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/exclaim.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_contacts.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_delete.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_drafts.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_folder.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_inbox.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_manage.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_minus.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_plus.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_search.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_sent.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/f_spam.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/fldsel.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/folder.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/folderopen.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/foldersopen.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/forward.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/fwd.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/group_contact.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/help.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/help_sm.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/high.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/highest.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/inbox.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/info.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/infomsg.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/lo.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/logo.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/logo.png
create mode 100644 web/cgi/alpine/2.0/img/cbn/logoff.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/lookup.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/low.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/menu.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/msglist.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/msglist.gif.bak
create mode 100644 web/cgi/alpine/2.0/img/cbn/musicfolder.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/navbg.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/new.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/page.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/parent.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/partly.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_down.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_first.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_last.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_next.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_prev.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/pg_up.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/print.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/question.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/question.jpg
create mode 100644 web/cgi/alpine/2.0/img/cbn/question.png
create mode 100644 web/cgi/alpine/2.0/img/cbn/question2.jpg
create mode 100644 web/cgi/alpine/2.0/img/cbn/remove.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/rename.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/replied.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/reply.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/replyall.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/return.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/rt.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/save.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/search.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/send.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/settings.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/sound.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/spam.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/spam2.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/spell.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/spritelib.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/spritelib.png
create mode 100644 web/cgi/alpine/2.0/img/cbn/star.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/starred.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/statbak.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/statbakend.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/statbakl.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/statbakr.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/sunny.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/tome.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/trans.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/up.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/uw.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/uwlogo.gif
create mode 100644 web/cgi/alpine/2.0/img/cbn/wbar.gif
create mode 100644 web/cgi/alpine/2.0/lib/INSTALL
create mode 100644 web/cgi/alpine/2.0/lib/common.js
create mode 100644 web/cgi/alpine/2.0/lib/compose.js
create mode 100644 web/cgi/alpine/2.0/lib/contacts.js
create mode 100644 web/cgi/alpine/2.0/lib/folders.js
create mode 100644 web/cgi/alpine/2.0/lib/mailbox.js
create mode 100644 web/cgi/alpine/2.0/lib/settings.js
create mode 120000 web/cgi/alpine/2.0/lib/yui
create mode 120000 web/cgi/alpine/2.0/mailto
create mode 100644 web/cgi/alpine/2.0/messagelist.tcl
create mode 100644 web/cgi/alpine/2.0/messageview.tcl
create mode 100755 web/cgi/alpine/2.0/newlist.tcl
create mode 100755 web/cgi/alpine/2.0/newview.tcl
create mode 120000 web/cgi/alpine/2.0/reply
create mode 120000 web/cgi/alpine/2.0/replyall
create mode 120000 web/cgi/alpine/2.0/resume
create mode 100755 web/cgi/alpine/2.0/settings
create mode 120000 web/cgi/alpine/2.0/tclsh
create mode 100755 web/cgi/alpine/2.0/view
create mode 120000 web/cgi/alpine/alpine.tcl
create mode 100755 web/cgi/alpine/farewell.tcl
create mode 120000 web/cgi/alpine/tclsh
create mode 100755 web/cgi/alpine/whackatch.tcl
create mode 120000 web/cgi/detach
create mode 100755 web/cgi/favicon.ico
create mode 100755 web/cgi/greeting.tcl
create mode 100644 web/cgi/images/Lavender_Chiffon.gif
create mode 100644 web/cgi/images/b_minus.gif
create mode 100644 web/cgi/images/b_plus.gif
create mode 100644 web/cgi/images/barblank.gif
create mode 100644 web/cgi/images/barclose.gif
create mode 100644 web/cgi/images/barclose_mid.gif
create mode 100644 web/cgi/images/barmsg.gif
create mode 100644 web/cgi/images/baropen.gif
create mode 100644 web/cgi/images/baropen_mid.gif
create mode 100644 web/cgi/images/barvert.gif
create mode 100644 web/cgi/images/barvertmsg.gif
create mode 100644 web/cgi/images/bg_index.gif
create mode 100644 web/cgi/images/blackdot.gif
create mode 100644 web/cgi/images/book.gif
create mode 100644 web/cgi/images/but_abook.gif
create mode 100644 web/cgi/images/but_cancel.gif
create mode 100644 web/cgi/images/but_create.gif
create mode 100644 web/cgi/images/but_folddel.gif
create mode 100644 web/cgi/images/but_foldexp.gif
create mode 100644 web/cgi/images/but_foldren.gif
create mode 100644 web/cgi/images/but_remove.gif
create mode 100644 web/cgi/images/but_resume.gif
create mode 100644 web/cgi/images/but_rnd_block.gif
create mode 100644 web/cgi/images/but_rnd_first3.gif
create mode 100644 web/cgi/images/but_rnd_last3.gif
create mode 100644 web/cgi/images/but_rnd_next3.gif
create mode 100644 web/cgi/images/but_rnd_prev3.gif
create mode 100644 web/cgi/images/but_s_do.gif
create mode 100644 web/cgi/images/but_save.gif
create mode 100644 web/cgi/images/buttons/silver/allmsgs.gif
create mode 100644 web/cgi/images/buttons/silver/attach.gif
create mode 100644 web/cgi/images/buttons/silver/cancel.gif
create mode 100644 web/cgi/images/buttons/silver/compose.gif
create mode 100644 web/cgi/images/buttons/silver/compose8.gif
create mode 100644 web/cgi/images/buttons/silver/config.gif
create mode 100644 web/cgi/images/buttons/silver/delete.gif
create mode 100644 web/cgi/images/buttons/silver/delete2.gif
create mode 100644 web/cgi/images/buttons/silver/done.gif
create mode 100644 web/cgi/images/buttons/silver/exit.gif
create mode 100644 web/cgi/images/buttons/silver/expunge.gif
create mode 100644 web/cgi/images/buttons/silver/firstpage.gif
create mode 100644 web/cgi/images/buttons/silver/firstpage2.gif
create mode 100644 web/cgi/images/buttons/silver/firstpage4.gif
create mode 100644 web/cgi/images/buttons/silver/folders.gif
create mode 100644 web/cgi/images/buttons/silver/forward.gif
create mode 100644 web/cgi/images/buttons/silver/lastpage.gif
create mode 100644 web/cgi/images/buttons/silver/lastpage2.gif
create mode 100644 web/cgi/images/buttons/silver/lastpage4.gif
create mode 100644 web/cgi/images/buttons/silver/logout.gif
create mode 100644 web/cgi/images/buttons/silver/messages.gif
create mode 100644 web/cgi/images/buttons/silver/nextpage.gif
create mode 100644 web/cgi/images/buttons/silver/nextpage2.gif
create mode 100644 web/cgi/images/buttons/silver/ok.gif
create mode 100644 web/cgi/images/buttons/silver/prevpage.gif
create mode 100644 web/cgi/images/buttons/silver/prevpage2.gif
create mode 100644 web/cgi/images/buttons/silver/quit.gif
create mode 100644 web/cgi/images/buttons/silver/reply.gif
create mode 100644 web/cgi/images/buttons/silver/replyall.gif
create mode 100644 web/cgi/images/buttons/silver/save.gif
create mode 100644 web/cgi/images/buttons/silver/send.gif
create mode 100644 web/cgi/images/buttons/silver/undelete.gif
create mode 100644 web/cgi/images/caution.gif
create mode 100644 web/cgi/images/cf_add.gif
create mode 100644 web/cgi/images/cf_delete.gif
create mode 100644 web/cgi/images/cf_edit.gif
create mode 100644 web/cgi/images/cf_help.gif
create mode 100644 web/cgi/images/cf_shdown.gif
create mode 100644 web/cgi/images/cf_shup.gif
create mode 100644 web/cgi/images/decreas4.gif
create mode 100644 web/cgi/images/dot.gif
create mode 100644 web/cgi/images/dot2.gif
create mode 100644 web/cgi/images/dotblink.gif
create mode 100644 web/cgi/images/dstripe.gif
create mode 100644 web/cgi/images/env/d_new.gif
create mode 100644 web/cgi/images/env/d_newans.gif
create mode 100644 web/cgi/images/env/d_newansdel.gif
create mode 100644 web/cgi/images/env/d_newdel.gif
create mode 100644 web/cgi/images/env/d_newimp.gif
create mode 100644 web/cgi/images/env/d_newimpans.gif
create mode 100644 web/cgi/images/env/d_newimpansdel.gif
create mode 100644 web/cgi/images/env/d_newimpdel.gif
create mode 100644 web/cgi/images/env/d_newyou.gif
create mode 100644 web/cgi/images/env/d_newyouans.gif
create mode 100644 web/cgi/images/env/d_newyouansdel.gif
create mode 100644 web/cgi/images/env/d_newyoudel.gif
create mode 100644 web/cgi/images/env/d_read.gif
create mode 100644 web/cgi/images/env/d_readans.gif
create mode 100644 web/cgi/images/env/d_readansdel.gif
create mode 100644 web/cgi/images/env/d_readdel.gif
create mode 100644 web/cgi/images/env/d_readimp.gif
create mode 100644 web/cgi/images/env/d_readimpans.gif
create mode 100644 web/cgi/images/env/d_readimpansdel.gif
create mode 100644 web/cgi/images/env/d_readimpdel.gif
create mode 100644 web/cgi/images/env/d_readyou.gif
create mode 100644 web/cgi/images/env/d_readyouans.gif
create mode 100644 web/cgi/images/env/d_readyouansdel.gif
create mode 100644 web/cgi/images/env/d_readyoudel.gif
create mode 100644 web/cgi/images/env/new.gif
create mode 100644 web/cgi/images/env/newans.gif
create mode 100644 web/cgi/images/env/newansdel.gif
create mode 100644 web/cgi/images/env/newdel.gif
create mode 100644 web/cgi/images/env/newimp.gif
create mode 100644 web/cgi/images/env/newimpans.gif
create mode 100644 web/cgi/images/env/newimpansdel.gif
create mode 100644 web/cgi/images/env/newimpdel.gif
create mode 100644 web/cgi/images/env/newyou.gif
create mode 100644 web/cgi/images/env/newyouans.gif
create mode 100644 web/cgi/images/env/newyouansdel.gif
create mode 100644 web/cgi/images/env/newyoudel.gif
create mode 100644 web/cgi/images/env/read.gif
create mode 100644 web/cgi/images/env/readans.gif
create mode 100644 web/cgi/images/env/readansdel.gif
create mode 100644 web/cgi/images/env/readdel.gif
create mode 100644 web/cgi/images/env/readimp.gif
create mode 100644 web/cgi/images/env/readimpans.gif
create mode 100644 web/cgi/images/env/readimpansdel.gif
create mode 100644 web/cgi/images/env/readimpdel.gif
create mode 100644 web/cgi/images/env/readyou.border.gif
create mode 100644 web/cgi/images/env/readyou.gif
create mode 100644 web/cgi/images/env/readyouans.gif
create mode 100644 web/cgi/images/env/readyouansdel.gif
create mode 100644 web/cgi/images/env/readyoudel.gif
create mode 100644 web/cgi/images/hdr.gif
create mode 100644 web/cgi/images/hdrless.gif
create mode 100644 web/cgi/images/hdrmore.gif
create mode 100644 web/cgi/images/hdrnon.gif
create mode 100644 web/cgi/images/help_trans.gif
create mode 100644 web/cgi/images/ibarmsg.gif
create mode 100644 web/cgi/images/ibarvertmsg.gif
create mode 100644 web/cgi/images/if_blank.gif
create mode 100644 web/cgi/images/if_left.gif
create mode 100644 web/cgi/images/if_narrow.gif
create mode 100644 web/cgi/images/if_narrow2.gif
create mode 100644 web/cgi/images/if_remove.gif
create mode 100644 web/cgi/images/if_right.gif
create mode 100644 web/cgi/images/if_widen.gif
create mode 100644 web/cgi/images/if_wider.gif
create mode 100644 web/cgi/images/increas4.gif
create mode 100644 web/cgi/images/indexhdr.gif
create mode 100644 web/cgi/images/logo/alpine/back.gif
create mode 100644 web/cgi/images/logo/alpine/big.gif
create mode 100644 web/cgi/images/logo/alpine/small-blank.gif
create mode 100644 web/cgi/images/logo/alpine/small.gif
create mode 100644 web/cgi/images/markall3.gif
create mode 100644 web/cgi/images/marknone3.gif
create mode 100644 web/cgi/images/minus2.gif
create mode 100644 web/cgi/images/nondither10x10.gif
create mode 100644 web/cgi/images/plus2.gif
create mode 100644 web/cgi/images/postmark.gif
create mode 100644 web/cgi/images/printer2.gif
create mode 100644 web/cgi/images/slidein.gif
create mode 100644 web/cgi/images/slideout.gif
create mode 100644 web/cgi/images/tabless.gif
create mode 100644 web/cgi/images/tabmore.gif
create mode 100644 web/cgi/images/tabs/abdtab.gif
create mode 100644 web/cgi/images/tabs/abtab.gif
create mode 100644 web/cgi/images/tabs/blank.gif
create mode 100644 web/cgi/images/tabs/cdtab.gif
create mode 100644 web/cgi/images/tabs/ctab.gif
create mode 100644 web/cgi/images/tabs/fdtab.gif
create mode 100644 web/cgi/images/tabs/ftab.gif
create mode 100644 web/cgi/images/tabs/gdtab.gif
create mode 100644 web/cgi/images/tabs/gtab.gif
create mode 100644 web/cgi/images/tabs/mldtab.gif
create mode 100644 web/cgi/images/tabs/mltab.gif
create mode 100644 web/cgi/images/tabs/mvdtab.gif
create mode 100644 web/cgi/images/tabs/mvtab.gif
create mode 100644 web/cgi/images/tabs/rdtab.gif
create mode 100644 web/cgi/images/tabs/rtab.gif
create mode 100644 web/cgi/images/tabs/tabbg.gif
create mode 100644 web/cgi/images/tabs/tabmid.gif
create mode 100644 web/cgi/motd.sample
create mode 120000 web/cgi/pub/alpine.tcl
create mode 100755 web/cgi/pub/getach.tcl
create mode 100644 web/cgi/pub/standard.css
create mode 100644 web/cgi/pub/standard.js
create mode 120000 web/cgi/pub/tclsh
create mode 100644 web/cgi/session/.htaccess
create mode 100644 web/cgi/session/_htaccess
create mode 120000 web/cgi/session/alpine.tcl
create mode 100755 web/cgi/session/greeting.tcl
create mode 100755 web/cgi/session/init.tcl
create mode 100755 web/cgi/session/logon.tcl
create mode 100755 web/cgi/session/logout.tcl
create mode 120000 web/cgi/session/logout/alpine.tcl
create mode 100755 web/cgi/session/logout/logout.tcl
create mode 120000 web/cgi/session/logout/tclsh
create mode 100755 web/cgi/session/monitor.tcl
create mode 100755 web/cgi/session/queryauth.tcl
create mode 100755 web/cgi/session/setauth.tcl
create mode 100755 web/cgi/session/setauth2.tcl
create mode 100755 web/cgi/session/setpassphrase.tcl
create mode 100755 web/cgi/session/startup.tcl
create mode 120000 web/cgi/session/tclsh
create mode 100644 web/cgi/sounds/ding.wav
create mode 100644 web/cgi/sounds/mail_msg.wav
create mode 120000 web/cgi/tclsh
(limited to 'web/cgi')
diff --git a/web/cgi/.htaccess b/web/cgi/.htaccess
new file mode 100644
index 00000000..b59de05b
--- /dev/null
+++ b/web/cgi/.htaccess
@@ -0,0 +1,32 @@
+#
+# Tweek server to encourage caching and set appropriate type for icons
+#
+DirectoryIndex greeting.tcl
+
+AddType image/x-icon .ico
+
+AddHandler cgi-script tcl
+
+
+
+
+Header append Cache-Control "public"
+
+
+
+Header append Cache-Control "public"
+
+
+
+Header append Cache-Control "public"
+
+
+
+Header append Cache-Control "public"
+
+
+
+Header append Cache-Control "public"
+
+
+
diff --git a/web/cgi/alpine.tcl b/web/cgi/alpine.tcl
new file mode 120000
index 00000000..976166f1
--- /dev/null
+++ b/web/cgi/alpine.tcl
@@ -0,0 +1 @@
+../config/alpine.tcl
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/addrbook.tcl b/web/cgi/alpine/1.0/addrbook.tcl
new file mode 100755
index 00000000..fcaf4f04
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrbook.tcl
@@ -0,0 +1,583 @@
+# $Id: addrbook.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrbook.tcl
+#
+# Purpose: CGI script to generate html output associated with address
+# book entry and collection management
+#
+# Input:
+set abook_vars {
+ {op {} "view"}
+ {field {} "none"}
+ {uid "" 0}
+ {oncancel "" "fr_main.tcl"}
+ {reload}
+}
+
+# Output:
+#
+# HTML/CSS data representing the address book
+
+
+# Command Menu definition for Message View Screen
+set addr_menu {
+}
+
+set common_menu {
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$browse}}
+ {
+ {
+ # * * * * USE ADDRESSES * * * *
+ cgi_submit_button "address=Address" class="navtext"
+ }
+ }
+ }
+ {
+ {expr {$browse}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button "cancel=Cancel" class="navtext"
+ }
+ }
+ }
+ {
+ {expr {0 && $browse}}
+ {
+ {
+ # * * * * Address/Cancel * * * *
+ cgi_submit_button doit=Done class="navbar"
+ cgi_br
+ cgi_select addrop class=navtext {
+ cgi_option "Action..." value=null
+ cgi_option Address value=address
+ cgi_option Cancel value=cancel
+ }
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $abook_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+set cid [WPCmd PEInfo key]
+WPCmd PEAddress safecheck
+
+set view [expr {[string compare $op "view"] == 0}]
+set browse [expr {[string compare $op "browse"] == 0}]
+
+if {$view} {
+ if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+ }
+
+ if {[WPCmd PEInfo ldapenabled] == 1} {
+ if {[catch {WPCmd PELdap directories} directories] || [llength $directories] <= 0} {
+ catch {unset directories}
+ } else {
+ for {set i 0} {$i < [llength $directories]} {incr i} {
+ lappend exclusions document.ldapsearch${i}.srchstr
+ }
+ }
+ }
+}
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ set onload "onLoad="
+ set onunload "onUnload="
+
+ if {[info exists _wp(exitonclose)] && $view} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ if {$view} {
+ set normalreload [cgi_buffer {WPHtmlHdrReload "[file join $_wp(appdir) $_wp(ui1dir) wp.tcl?page=addrbook]"}]
+ if {[info exists _wp(exitonclose)]} {
+ WPStdHtmlHdr "Address Book View"
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function indexReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=addrbook&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "indexReloadTimer($_wp(refresh));"
+
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+ }
+
+ WPStyleSheets
+ cgi_puts ""
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=addrbook'}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=addrbook&cid=$cid'"]
+
+ if {![info exists exclusions]} {
+ set exclusions ""
+ }
+
+ append onload [WPTFKeyEquiv $kequiv $exclusions]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ if {$view} {
+ catch {WPCmd PEInfo set help_context addrbook}
+ } else {
+ catch {WPCmd PEInfo set help_context addrbrowse}
+ }
+
+ set books [WPCmd PEAddress books]
+ set entrylist {}
+ set entryexists 0
+ foreach book $books {
+ set entries [WPCmd PEAddress list [lindex $book 0]]
+ if {[llength $entries] > 0} {
+ incr entryexists
+ }
+ lappend entrylist $entries
+ }
+
+ if {$view} {
+ WPTFTitle "Address Books" $newmail 0 addrbook
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ if {$browse} {
+ cgi_puts ""
+ }
+
+ if {[info exists directories]} {
+ cgi_table border=0 cellspacing=0 cellpadding=4 width="100%" "style=\"padding-top:10\"" {
+ for {set i 0} {$i < [llength $directories]} {incr i} {
+ set directory [lindex $directories $i]
+ set nick [lindex $directory 0]
+ set server [lindex $directory 1]
+ if {[string length $nick]} {
+ set ref $nick
+ } elseif {[string length $server]} {
+ set ref "<$server>"
+ } else {
+ set ref "some server"
+ }
+
+ cgi_table_row {
+ cgi_table_data colspan=3 valign=middle nowrap {
+ cgi_puts "[cgi_font size=+1 [cgi_bold "Directory server [cgi_quote_html $ref]"]]"
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=ldapsearch${i} {
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "page=ldapquery" type=hidden notab
+
+ cgi_text "searchtype=0" type=hidden notab
+ cgi_text "op=view" type=hidden notab
+ cgi_text "dir=$i" type=hidden notab
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center valign=middle "style=\"background-color:white\"" {
+ cgi_puts "Search Directory :"
+ cgi_text "srchstr=" size=35
+ cgi_submit_button "search=Search"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data height=200 class=dialog {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/addredit.tcl b/web/cgi/alpine/1.0/addredit.tcl
new file mode 100755
index 00000000..8aecda2e
--- /dev/null
+++ b/web/cgi/alpine/1.0/addredit.tcl
@@ -0,0 +1,224 @@
+#!./tclsh
+# $Id: addredit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addredit.tcl
+#
+# Purpose: CGI script to generate html form used to view/set
+# individual addressbook entries
+#
+# Input:
+set ae_vars {
+ {book {} -1}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+set ae_fields {
+ {0 "newnick" "Nickname*"}
+ {1 "fn" "Full Name "}
+ {2 "addrs" "Addresses*"}
+ {3 "fcc" "Fcc "}
+ {4 "comment" "Comments "}
+}
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Output:
+#
+#
+
+set ae_menu {
+ {
+ {}
+ {
+ {
+ cgi_image_button help=[WPimg help_trans] border=0 alt="Help"
+ }
+ }
+ }
+}
+
+WPEval $ae_vars {
+
+ if {$book < 0} {
+ if {[catch {WPCmd PEInfo set ae_help_state} ae_help_state] == 0} {
+ foreach v $ae_help_state {
+ eval set [lindex $v 0] [list [lindex $v 1]]
+ }
+
+ set addrinfo [list "$newnick" "$fn" [list "$addrs"] "$fcc" "$comment"]
+ WPCmd PEInfo unset ae_help_state
+ } else {
+ return [list _action "Web Alpine" "Unspecified Address Book"]
+ }
+ }
+
+ catch {WPCmd PEInfo unset ae_help_state}
+
+ if {![info exists addrinfo]} {
+ if {$take != 0} {
+ set addrinfo [list "$newnick" "$fn" [list "$addrs"] "$fcc" "$comment"]
+ } elseif {$add == 0} {
+ if {[catch {WPCmd PEAddress fullentry $book $nick $ai} addrinfo]} {
+ if {[string length $addrinfo]} {
+ set entryerror "Address Error: $addrinfo"
+ } else {
+ set entryerror "Nickname $nick does not exist"
+ }
+
+ set addrinfo [list "" "" [list ""] "" ""]
+ }
+ } else {
+ set addrinfo [list "" "" [list ""] "" ""]
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Addressbook Update"
+ WPStyleSheets
+ }
+
+ if {$take == 1} {
+ set onload "onLoad=document.addredit.newnick.focus()"
+ } else {
+ set onload ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" $onload {
+ set books [WPCmd PEAddress books]
+ set readwrite [lindex [lindex $books $book] 3]
+
+ catch {WPCmd PEInfo set help_context addredit}
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=addredit target=_top {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=1000 {
+ WPTFCommandMenu ae_menu {}
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {[info exists entryerror]} {
+ cgi_division class=notice align=center {
+ cgi_puts $entryerror
+ }
+ }
+
+
+ if {$take == 1} {
+ lappend tmptxt "Edit the new entry below as neccessary (note, some are required). To create a list entry, simply add each desired address to the [cgi_italic Addresses] field separated by a comma."
+ lappend tmptxt "When finished, click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to the message view."
+ } elseif {$add == 1} {
+ lappend tmptxt "The address book entry editor is used to create a new address book entry. Fill in the fields as desired below (note, some are required). To create a list entry, simply add each desired address to the [cgi_italic Addresses] field separated by a comma."
+ lappend tmptxt "When finished, click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to your unchanged address book."
+ } elseif {$readwrite == 0} {
+ set tmptxt "These are the current settings for the selected entry"
+ } else {
+ lappend tmptxt "The address book entry editor is used to edit an existing address book entry. Edit the fields as desired below (note, some are required)."
+ lappend tmptxt " then click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to your unchanged address book."
+ }
+
+ cgi_table align=center width=75% cellpadding=10 border=0 {
+ foreach t $tmptxt {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts $t
+ }
+ }
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=5 align=center {
+ cgi_text "page=addrsave" type=hidden notab
+
+ if {$take == 1} {
+ cgi_text "oncancel=main" type=hidden notab
+ cgi_text "take=1" type=hidden notab
+ } else {
+ cgi_text "oncancel=addrbook" type=hidden notab
+ }
+
+ cgi_text "book=$book" type=hidden notab
+ if {$add == 0} {cgi_text "nick=$nick" type=hidden notab}
+ if {$add != 0} {cgi_text "add=1" type=hidden notab}
+ cgi_text "ai=${ai}" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ foreach fieldval $ae_fields {
+ cgi_table_row {
+ cgi_table_data valign=top align=right width="30%" class=dialog {
+ # cgi_puts [cgi_font face=tahoma,verdana,geneva size=+1 "[lindex $fieldval 2]:"]
+ cgi_puts [cgi_bold "[lindex $fieldval 2]:"]
+ }
+ cgi_table_data align=left {
+ switch -regexp [lindex $fieldval 1] {
+ ^addrs$ {
+ set addrvals [lindex $addrinfo [lindex $fieldval 0]]
+ set line [join $addrvals ", "]
+ cgi_text "[lindex $fieldval 1]=${line}" size=50
+ }
+ default {
+ cgi_text "[lindex $fieldval 1]=[lindex $addrinfo [lindex $fieldval 0]]" size=50
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts [cgi_font class=notice size=-1 "* Required field"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 {
+ if {$readwrite} {
+ cgi_submit_button "save=Save Entry"
+ cgi_put [cgi_img [WPimg dot2] border=0 alt="" width=10]
+ }
+
+ if {$readwrite && $add == 0 && $take == 0} {
+ cgi_submit_button "delete=Delete Entry"
+ cgi_put [cgi_img [WPimg dot2] border=0 alt="" width=10]
+ }
+
+ cgi_submit_button "cancel=Cancel"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/addrpick.tcl b/web/cgi/alpine/1.0/addrpick.tcl
new file mode 100755
index 00000000..a71f55d6
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrpick.tcl
@@ -0,0 +1,134 @@
+# $Id: addrpick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrpick.tcl
+#
+# Purpose: CGI script to handle address book choices from the
+# via the addrbook browser generated form
+#
+# Input:
+set pick_vars {
+ {cid "Missing Command ID"}
+ {field "Missing Field Name"}
+ {addrop {} ""}
+ {cancel {} 0}
+}
+
+# Output:
+
+
+# read vars
+foreach item $pick_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+WPLoadCGIVarAs nickList listonicks
+set usenewfcc 0
+
+if {$cancel == 1 || [string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $addrop]] == 0} {
+} elseif {[string length $listonicks] > 0} {
+ foreach nick $listonicks {
+ # determine which book
+ if {[regexp {^([0-9]+)\.([0-9]+)\.(.*)$} $nick dummy book ai nick]} {
+ if {[catch {WPCmd PEAddress entry $book $nick $ai} result]} {
+ regsub -all "'" $result "\\'" result
+ WPCmd PEInfo statmsg $result
+ } else {
+ set resaddr [lindex $result 0]
+ regsub -all "'" $resaddr "\\'" resaddr
+ if {[info exists newaddrs]} {
+ append newaddrs ", "
+ }
+ if {[string compare $field "to"] == 0 && [string length [lindex $result 1]]} {
+ # arbitrarily the last returned entry with an fcc wins
+ set fcc [lindex $result 1]
+ if {[string compare $fcc "\"\""] == 0} {
+ set fcc ""
+ }
+ regsub -all "'" $fcc "\\'" fcc
+ set usenewfcc 1
+ }
+
+ append newaddrs $resaddr
+ }
+ } else {
+ WPCmd PEInfo statmsg "Malformed entry request: $addr"
+ }
+ }
+
+ if {[info exists newaddrs]} {
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata] == 0} {
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string compare [string tolower [lindex [lindex $msgdata $i] 0]] $field] == 0} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set newfield [list $field "[lindex [lindex $msgdata $i] 1], $newaddrs"]
+ } else {
+ set newfield [list $field $newaddrs]
+ }
+ break
+ }
+ }
+
+ if {$usenewfcc} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [string tolower [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set savedef [WPTFSaveDefault 0]
+ set colid [lindex $savedef 0]
+ if {[info exists fcc_index]} {
+ if {[string compare $fcc [lindex [lindex [lindex $msgdata $fcc_index] 1] 1]]} {
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $fcc]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $fcc]]
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+ }
+
+ if {[info exists newfield]} {
+ set msgdata2 [lreplace $msgdata $i $i $newfield]
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata2} result] == 0} {
+ unset result
+ }
+ } else {
+ lappend msgdata [list $field $newaddrs]
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} result] == 0} {
+ unset result
+ }
+ }
+
+ if {[info exists result]} {
+ WPCmd PEInfo statmsg "Cannot Update $field field: $result"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot change Message Data: $msgdata"
+ }
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/addrsave.tcl b/web/cgi/alpine/1.0/addrsave.tcl
new file mode 100755
index 00000000..37a70ebe
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrsave.tcl
@@ -0,0 +1,244 @@
+# $Id: addrsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrsave.tcl
+#
+# Purpose: CGI script to handle address book change/save
+# via addredit generated form
+#
+# Input:
+set abs_vars {
+ {cid "Missing Command ID"}
+ {save {} 0}
+ {delete {} 0}
+ {replace {} 0}
+ {compose {} 0}
+ {take {} 0}
+ {help {} 0}
+ {cancel {} 0}
+ {oncancel {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $abs_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+if {$help != 0} {
+ set save_vars {
+ {book {} 0}
+ {newnick {} ""}
+ {nick {} ""}
+ {ai {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {add {} 0}
+ {take {} 0}
+ }
+
+ foreach i $abs_vars {
+ lappend ae_help_state [list [lindex $i 0] [subst $[lindex $i 0]]]
+ }
+
+ foreach i $save_vars {
+ eval WPImport $i
+ lappend ae_help_state [list [lindex $i 0] [subst $[lindex $i 0]]]
+ }
+
+ WPCmd PEInfo set ae_help_state $ae_help_state
+
+ set _cgi_uservar(topic) takeedit
+ set _cgi_uservar(oncancel) addredit
+ if {$take} {
+ set _cgi_uservar(index) none
+ }
+
+ set src help
+
+} elseif {$save == 1 || [string compare [string tolower $save] "save entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {!$take || [catch {WPCmd PEAddress entry $book $newnick $ai} result] || ![llength $result]} {
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $addrs $fcc $comment $add $nick} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure: $result"}
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry changed: $adderr"
+ } else {
+ WPCmd PEInfo statmsg "New address book entry \"$newnick\" created."
+ }
+ }
+ } else {
+ set src takesame
+ }
+
+ if {$take == 1 && ![info exists src]} {
+ set src $oncancel
+ }
+ }
+} elseif {$delete == 1 || [string compare [string tolower $delete] "delete entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar nick
+ WPLoadCGIVar ai
+
+ set result ""
+ if {[catch {WPCmd PEAddress delete $book $nick $ai} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure $result"}
+ } elseif {[string compare $result ""]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ }
+} elseif {[string compare [string tolower $replace] "replace entry"] == 0} {
+
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {[catch {WPCmd PEAddress delete $book $newnick $ai} result]} {
+ set adderr $result
+ } else {
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $addrs $fcc $comment $add $nick} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure result"}
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry changed: $adderr."
+ } else {
+ WPCmd PEInfo statmsg "Address book entry \"$newnick\" replaced."
+ }
+
+ if {![info exists src]} {
+ set src $oncancel
+ }
+ }
+ }
+} elseif {[string compare [string tolower $replace] "add to entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {[catch {WPCmd PEAddress fullentry $book $newnick $ai} result] || ![llength $result]} {
+ if {[string length $result]} {
+ set adderr $result
+ } else {
+ set adderr "No pre-existing entry"
+ }
+ } else {
+ set fn [lindex $result 1]
+ set newaddrs [join [lindex $result 2] ","]
+ append newaddrs ", $addrs"
+ set fcc [lindex $result 3]
+ set comment [lindex $result 4]
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $newaddrs $fcc $comment 0 $newnick} result]} {
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry created: $adderr."
+ } else {
+ WPCmd PEInfo statmsg "Address book entry \"$newnick\" appended"
+ }
+
+ if {![info exists src]} {
+ set src $oncancel
+ }
+ }
+ }
+} elseif {[string compare [string tolower $replace] edit] == 0} {
+ set src takeedit
+} elseif {$compose == 1} {
+ set oncancel addrbook
+ set src compose
+} elseif {$cancel == 1 || [string compare [string tolower $cancel] cancel] == 0} {
+ if {$take == 1} {
+ set act "Take Address"
+ } else {
+ set act "Address Edit"
+ }
+
+ catch {WPCmd PEInfo statmsg "$act cancelled. Address book unchanged."}
+ set src $oncancel
+} else {
+ catch {WPCmd PEInfo statmsg "Unknown Address Book Operation"}
+}
+
+if {![info exists src]} {
+ set src addrbook
+}
+
+source [WPTFScript $src]
diff --git a/web/cgi/alpine/1.0/alpine.tcl b/web/cgi/alpine/1.0/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/alpine/1.0/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/attach.tcl b/web/cgi/alpine/1.0/attach.tcl
new file mode 100755
index 00000000..e0423171
--- /dev/null
+++ b/web/cgi/alpine/1.0/attach.tcl
@@ -0,0 +1,96 @@
+# $Id: attach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# attach.tcl
+#
+# Purpose: CGI script to handle attaching attachment
+# to composition via queryattach generated form
+#
+# Input:
+set attach_vars {
+ {cid "Missing Command ID"}
+ {file "Missing File Upload Data"}
+ {attachop "" ""}
+ {cancel "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $attach_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cancel == 1 || [string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $attachop]] == 0} {
+} else {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+ }
+
+ if {[string length [lindex $file 1]]} {
+ if {[catch {cgi_import description}]} {
+ set description ""
+ }
+
+ # "file" is a list: local_file remote_file content-type/content-subtype
+ # trim path from file name on remote system
+ # since we can't be certain what the delimiter is,
+ # try the usual suspects
+ set delims [list "\\" "/" ":"]
+ set native [lindex $file 1]
+ if {[string length $native]} {
+ foreach delim $delims {
+ if {[set crop [string last $delim $native]] >= 0} {
+ set native [string range $native [expr {$crop + 1}] [string length $native]]
+ break;
+ }
+ }
+
+ regsub -all "'" $native "\\'" jsnative
+
+ if {0 == [string length [lindex $file 2]]} {
+ set conttype [list text plain]
+ } else {
+ set conttype [split [lindex $file 2] "/"]
+ }
+
+ set id [WPCmd PECompose attach [lindex $file 0] [lindex $conttype 0] [lindex $conttype 1] $native $description]
+
+ catch {unset style}
+ set restore 1
+
+ if {[catch {WPCmd PEInfo lappend suspended_composition [list attach $id]} result]} {
+ WPCmd PEInfo statmsg "Cannot append attachment info, nothing attached"
+ }
+
+ set fsize [file size [lindex $file 0]]
+ if {$fsize <= 0} {
+ WPCmd PEInfo statmsg "Attachment $jsnative empty or nonexistant"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Requested attachment does not exist"
+ }
+ } else {
+ catch {file delete [lindex $file 0]}
+ WPCmd PEInfo statmsg "Empty file name, nothing attached"
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/cledit.tcl b/web/cgi/alpine/1.0/cledit.tcl
new file mode 100755
index 00000000..dabf6044
--- /dev/null
+++ b/web/cgi/alpine/1.0/cledit.tcl
@@ -0,0 +1,232 @@
+#!./tclsh
+# $Id: cledit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+#
+# cledit.tcl
+#
+# Purpose: CGI script to generate html form editing of a single collection
+
+# read config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set cledit_vars {
+ {cid "Missing Command ID"}
+ {oncancel "Missing oncancel"}
+ {cl {} 0}
+ {add {} 0}
+ {errtext {} 0}
+ {nick {} ""}
+ {server {} ""}
+ {ssl {} 1}
+ {user {} ""}
+ {stype {} "imap"}
+ {path {} ""}
+ {view {} ""}
+ {onclecancel {} ""}
+}
+
+## read vars
+foreach item $cledit_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+set cledit_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ if {$add} {
+ cgi_image_button cle_save=[WPimg but_save] border=0 alt="Save Config"
+ } else {
+ cgi_image_button cle_save=[WPimg but_save] border=0 alt="Save Config"
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ if {[string length $onclecancel]} {
+ cgi_puts [WPMenuURL "wp.tcl?page=$onclecancel&cid=$cid&oncancel=$oncancel" "" [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] "" target=_top]
+ } else {
+ cgi_puts [WPMenuURL "wp.tcl?page=$oncancel&cid=$cid" "" [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] "" target=_top]
+ }
+ }
+ }
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Collection List Configuration"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=clconfig target=_top {
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "page=conf_process" type=hidden notab
+ cgi_text "cp_op=clconfig" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_text "cl=$cl" type=hidden notab
+ cgi_text "add=$add" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu cledit_menu {}
+ }
+ }
+ }
+
+ #
+ # In main body of screen goe confg list
+ #
+ cgi_table_row {
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {$add == 0 && $errtext == 0} {
+ set item [WPCmd PEConfig clextended $cl]
+ set nick [lindex $item 0]
+ set server [lindex $item 2]
+ set path [lindex $item 3]
+ set view [lindex $item 4]
+ set user ""
+ set stype "imap"
+ set ssl 0
+ }
+ set server_flags {
+ ssl
+ user
+ imap
+ }
+ # jpf: took out nntp, service, and pop3
+ foreach flag $server_flags {
+ if {[regexp -nocase "^\[^/\]*(/\[^/\]*)*(/$flag\[^/\]*)(/\[^/\]*)*" $server match junk1 flagset junk2]} {
+ set regprob 1
+ if {[regexp -nocase "^/$flag\$" $flagset]} {
+ set regprob 0
+ if {[string compare [string tolower $flag] "ssl"] == 0} {
+ set ssl 1
+ } elseif {[regexp -nocase "(imap|nntp|pop3)" $flag]} {
+ set stype "$flag"
+ } else {
+ set regprob 1
+ }
+ } elseif {[regexp -nocase "^/user=(.*)\$" $flagset match tuser]} {
+ set user "$tuser"
+ set regprob 0
+ } elseif {[regexp -nocase "^/service=(.*)\$" $flagset match tuser]} {
+ if {[regexp -nocase "(imap|nntp|pop3)" $tuser]} {
+ set stype "$stype"
+ } else {set regprob 1}
+ } else {
+ set regprob 1
+ }
+ if {$regprob == 0} {
+ regsub -nocase "^(\[^/\]*)(/\[^/\]*)*(/$flag\[^/\]*)(/\[^/\]*)*" $server "\\1\\2\\4" server
+ }
+ }
+ }
+ cgi_table border=0 cellspacing=0 cellpadding=5 {
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "Nickname[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_text "nick=$nick" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right valign=top {
+ cgi_puts "[cgi_font size=+1 "Server[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_text "server=$server" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts "[cgi_font size=-1 "SSL"]"
+ if {$ssl == 1} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+ cgi_checkbox "ssl" style=background-color:$_wp(dialogcolor) $checked
+ }
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=-1 "User:[cgi_nbspace]"]"
+ cgi_text "user=$user" size=10 notab
+ }
+ cgi_text "stype=imap" type=hidden notab
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "Path[cgi_nbspace]: "]"
+ }
+ if {[string compare "nntp" $stype] == 0 && [regexp -nocase {^#news\.(.*)$} $path match rempath]} {
+ set path "$rempath"
+ }
+ cgi_table_data align=left {
+ cgi_text "path=$path" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "View[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_text "view=$view" size=40 notab
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=200 class=dialog {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/cmdfunc.tcl b/web/cgi/alpine/1.0/cmdfunc.tcl
new file mode 100755
index 00000000..949baf0f
--- /dev/null
+++ b/web/cgi/alpine/1.0/cmdfunc.tcl
@@ -0,0 +1,639 @@
+#!./tclsh
+# $Id: cmdfunc.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# cmdfunc.tcl
+#
+# Purpose: CGI script to serve as single location for menu/command
+# function definitions
+#
+# OPTIMIZE: have servlet interpreter grok/exec these?
+#
+# Input:
+
+# Output:
+#
+
+proc WPTFTitle {{context {some page}} {newmail {}} {nologo 0} {aboutcancel {}}} {
+ global _wp
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=title {
+ cgi_table_row {
+ if {!$nologo} {
+ cgi_table_data valign=top align=left height=$_wp(titleheight) {
+
+ if {[string length $aboutcancel]} {
+ cgi_put [cgi_url [cgi_imglink smalllogo] wp.tcl?page=help&topic=about&oncancel=$aboutcancel class=navbar target=_top]
+ } else {
+ cgi_put [cgi_imglink smalllogo]
+ }
+ }
+ }
+
+ # work in new mail here
+ if {[llength $newmail]} {
+ cgi_table_data align=center {
+ WPTFStatusTable $newmail
+ }
+ }
+
+ cgi_table_data align=right valign=middle height=$_wp(titleheight) {
+ cgi_put [cgi_span "style=margin-right: 8; color: $_wp(titlecolor)" "$context"]
+ }
+ }
+ }
+}
+
+proc WPTFStatusTable {msgs {iconlink {0}} {style {}}} {
+ global _wp
+
+ cgi_table width=100% border=0 cellpadding=0 cellspacing=0 $style {
+ cgi_table_row align=right {
+
+ if {[info exists _wp(statusicons)] && $_wp(statusicons)} {
+ set img [cgi_imglink bang]
+ set snd ""
+ foreach m $msgs {
+ if {[string length [lindex $m 1]]} {
+ set img [cgi_imglink [lindex $m 1]]
+ if {$iconlink && [string length [lindex $m 2]]} {
+ set img [cgi_url $img wp.tcl?page=view&uid=[lindex $m 2] target=body]
+ }
+
+ set snd [lindex $m 3]
+ break
+ }
+ }
+
+ cgi_table_data {
+ cgi_puts ${img}${snd}
+ }
+ }
+
+ cgi_table_data align=center class="statustext" {
+ set i 0
+
+ foreach m $msgs {
+
+ if {[array exists lastmsg] && [info exists lastmsg([lindex $m 0])]} {
+ incr lastmsg([lindex $m 0])
+ continue
+ }
+
+ if {0 == [string compare [string range [lindex $m 0] 0 20] "Alert received while "]} {
+ set style "style=border: 1px solid red ; background-color: pink; padding: 2; width: 80%;"
+ } elseif {!([info exists _wp(statusicons)] && $_wp(statusicons))} {
+ set style "style=color: white ; background-color: $_wp(menucolor); padding-left:8px; padding-right:8px; white-space: nowrap;"
+ } else {
+ set style
+ }
+
+ if {$iconlink && [string length [lindex $m 2]] && !([info exists _wp(statusicons)] && $_wp(statusicons))} {
+ set txt [cgi_url [lindex $m 0] wp.tcl?page=fr_view&uid=[lindex $m 2] target=body "style=text-decoration: none; color: white"]
+ } else {
+ set txt [lindex $m 0]
+ }
+
+ cgi_division "style=\"padding-bottom: 1px\"" {
+ cgi_puts [cgi_span $style $txt]
+ }
+
+ set lastmsg([lindex $m 0]) 1
+ }
+ }
+
+ if {[info exists _wp(statusicons)] && $_wp(statusicons)} {
+ cgi_table_data align=left {
+ cgi_puts $img
+ }
+ }
+ }
+ }
+}
+
+
+proc WPTFImageButton {args} {
+ return [cgi_buffer {eval cgi_image_button $args border=0}]
+}
+
+proc WPTFCommandMenu {s_menu c_menu} {
+ global _wp
+
+ set clist {}
+ if {[string length $s_menu]} {
+ upvar $s_menu specificmenu
+ if {[llength $specificmenu]} {
+ lappend clist $specificmenu
+ }
+ }
+
+ if {[string length $c_menu]} {
+ upvar $c_menu commonmenu
+ if {[llength $commonmenu]} {
+ if {[llength $clist]} {
+ lappend clist {}
+ }
+ lappend clist $commonmenu
+ }
+ }
+
+ cgi_table border=0 bgcolor=$_wp(menucolor) cellpadding=0 cellspacing=0 width=112 "style=\"padding: 8 0 8 4\"" {
+ foreach menulist $clist {
+ switch [llength $menulist] {
+ 0 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_hr "width=75%"
+ }
+ }
+ }
+ default {
+ foreach item $menulist {
+ if {[llength $item] == 0} {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_hr "width=75%"
+ }
+ }
+ continue
+ }
+ if {[llength $item] == 1} {
+ cgi_table_row {
+ cgi_table_data {
+ eval [lindex $item 0]
+ }
+ }
+ continue
+ }
+ if {[string length [lindex $item 0]]} {
+ if {[uplevel [lindex $item 0]] == 0} {
+ continue
+ }
+ }
+
+ cgi_table_row {
+ foreach l [lindex $item 1] {
+ cgi_table_data align=left valign=middle class=navbar {
+ uplevel $l
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+proc WPTFScript {scrpt {dflt ""}} {
+ global _wp
+
+ switch -- $scrpt {
+ main {
+ set src main.tcl
+ }
+ index {
+ set src index.tcl
+ WPCmd PEInfo set wp_body_script $src
+ }
+ view {
+ set src view.tcl
+ WPCmd PEInfo set wp_body_script $src
+ }
+ body {
+ if {[catch {WPCmd PEInfo set wp_body_script} src]} {
+ set src index.tcl
+ catch {WPCmd PEInfo set wp_body_script $src}
+ }
+ }
+ fr_view {
+ set src do_view.tcl
+ }
+ quit {
+ set src fr_queryquit.tcl
+ }
+ folders {
+ set src folders.tcl
+ }
+ fldrbrowse {
+ set src fldrbrowse.tcl
+ }
+ fldrsavenew {
+ set src fldrsavenew.tcl
+ }
+ fldrdel {
+ set src fr_querydelfldr.tcl
+ }
+ compose {
+ set src fr_compose.tcl
+ }
+ addrbrowse {
+ set src fr_addrbrowse.tcl
+ }
+ savebrowse {
+ set src fr_fldrbrowse.tcl
+ }
+ savecreate {
+ set src fr_fldrsavenew.tcl
+ }
+ take {
+ set src fr_take.tcl
+ }
+ takeedit {
+ set src fr_takeedit.tcl
+ }
+ takesame {
+ set src fr_takesame.tcl
+ }
+ ldapbrowse {
+ set src fr_ldapbrowse.tcl
+ }
+ addrbook {
+ set src addrbook.tcl
+ }
+ tconfig {
+ set src tconfig.tcl
+ }
+ cledit {
+ set src cledit.tcl
+ }
+ filtedit {
+ set src filtedit.tcl
+ }
+ conf_process {
+ set src conf_process.tcl
+ }
+ resume {
+ set src fr_resume.tcl
+ }
+ spell {
+ set src fr_spellcheck.tcl
+ }
+ auth {
+ set src fr_queryauth.tcl
+ }
+ expunge {
+ set src fr_queryexpunge.tcl
+ }
+ askattach {
+ set src fr_queryattach.tcl
+ }
+ ldapquery {
+ set src fr_ldapquery.tcl
+ }
+ querycreate {
+ set src fr_querycreate.tcl
+ }
+ queryprune {
+ set src fr_queryprune.tcl
+ }
+ attach {
+ set src attach.tcl
+ }
+ dosend {
+ set src dosend.tcl
+ }
+ docancel {
+ set src docancel.tcl
+ }
+ help {
+ set src fr_help.tcl
+ }
+ split {
+ set src fr_split.tcl
+ }
+ default {
+ if {[regexp {.*\.tcl$} $scrpt s]} {
+ set src $scrpt
+ } elseif {[string length $dflt]} {
+ set src $dflt
+ } else {
+ error "Unrecognized script abbreviation: $scrpt"
+ }
+ }
+ }
+
+ return [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $src]
+}
+
+proc WPTFSaveDefault {{uid 0}} {
+ # "size" rather than "number" to work around temporary alpined bug
+ if {$uid == 0
+ || [catch {WPCmd PEMessage $uid size} n]
+ || $n == 0
+ || [catch {WPCmd PEMessage $uid savedefault} savedefault]} {
+ if {[WPCmd PEFolder isincoming 0]} {
+ set colid 1
+ } else {
+ set colid 0
+ }
+
+ return [list $colid "saved-messages"]
+ }
+
+ return $savedefault
+}
+
+if {$_wp(keybindings)} {
+ proc WPTFKeyEquiv {kl {exclusions {}} {frame window}} {
+ if {[llength $kl] > 0} {
+ WPStdScripts
+
+ append js "function bindListener(o,f)\{"
+ if {[isW3C]} {
+ append js "o.addEventListener('keypress',f, false);\n"
+ set cancelkeystroke "e.preventDefault(); return false;"
+ } elseif {[isIE]} {
+ append js "o.onkeydown = f;\n"
+ set cancelkeystroke "return false;"
+ } else {
+ append js "o.onkeydown = f;"
+ append js "o.captureEvents(Event.KEYDOWN);\n"
+ set cancelkeystroke "return false;"
+ }
+ append js "\}\n"
+
+ append js "function nobubble(e)\{"
+ if {[isW3C]} {
+ append js " e.stopPropagation();"
+ } elseif {[isIE]} {
+ append js " event.cancelBubble = true;"
+ }
+ append js "\}\n"
+
+ append js "function keyed(e)\{"
+ if {[isW3C] && [llength $exclusions]} {
+ set ex ""
+ foreach o $exclusions {
+ if {[string length $ex]} {
+ append ex " || "
+ }
+
+ append ex "e.target == $o"
+ }
+ append js "if (e.target && ($ex)) return true;"
+ }
+ append js " var c = getKeyStr(e);"
+ append js " if(getControlKey(e))\{"
+ append js " switch(c)\{"
+ append js " case 'n' : window.status = 'New window creation disabled in WebPine.' ; $cancelkeystroke"
+ append js " \}"
+ append js " \}"
+ append js " else"
+ append js " switch(c)\{"
+ foreach kb $kl {
+ append js " case '[lindex $kb 0]' : ${frame}.webpinelink = 1; [lindex $kb 1] ; $cancelkeystroke"
+ }
+
+ append js " \}\}\n"
+
+ set onload "bindListener(document,keyed);"
+
+ if {![isW3C]} {
+ foreach o $exclusions {
+ append onload "bindListener($o,nobubble);"
+ }
+ }
+
+ cgi_javascript {
+ cgi_puts $js
+ }
+
+ return $onload
+ }
+ }
+}
+
+# add given folder name to the cache of saved-to folders
+proc WPTFAddSaveCache {f_name} {
+ global _wp
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ if {[set i [lsearch -exact $flist $f_name]] < 0} {
+ set flist [lrange $flist 0 [expr {$_wp(save_cache_max) - 2}]]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 $f_name]
+ } else {
+ set flist [list $f_name]
+ }
+
+ catch {WPSessionState save_cache $flist}
+}
+
+# return the list of cached saved-to folders and make sure given
+# default is somewhere in the list
+proc WPTFGetSaveCache {{def_name ""}} {
+
+ if {![string length $def_name]} {
+ set savedef [WPTFSaveDefault 0]
+ set def_name [lindex $savedef 1]
+ }
+
+ set seen ""
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ foreach f $flist {
+ if {[string compare $def_name $f] == 0} {
+ set def_listed 1
+ }
+
+ if {[string length $f] && [lsearch -exact $seen $f] < 0} {
+ lappend options $f
+ lappend options $f
+ lappend seen $f
+ }
+ }
+ }
+
+ if {!([info exists options] && [info exists def_listed])} {
+ lappend options $def_name
+ lappend options $def_name
+ }
+
+ if {[catch {WPCmd set wp_cache_folder} wp_cache_folder]
+ || [string compare $wp_cache_folder [WPCmd PEMailbox mailboxname]]} {
+ # move default to top on new folder
+ switch -- [set x [lsearch -exact $options $def_name]] {
+ 0 { }
+ default {
+ if {$x > 0} {
+ set options [lreplace $options $x [expr {$x + 1}]]
+ }
+
+ set options [linsert $options 0 $def_name]
+ set options [linsert $options 0 $def_name]
+ }
+ }
+
+ catch {WPCmd set wp_cache_folder [WPCmd PEMailbox mailboxname]}
+ }
+
+ lappend options "\[ folder I type in \]"
+ lappend options "__folder__prompt__"
+
+ lappend options "\[ folder in my folder list \]"
+ lappend options "__folder__list__"
+
+ return $options
+}
+
+# add given folder name to the visited folder cache
+proc WPTFAddFolderCache {f_col f_name} {
+ global _wp
+
+ if {$f_col != 0 || [string compare [string tolower $f_name] inbox]} {
+ if {0 == [catch {WPSessionState folder_cache} flist]} {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ for {set i 0} {$i < [llength $flist]} {incr i} {
+ set f [lindex $flist $i]
+ if {$f_col == [lindex $f 0] && 0 == [string compare [lindex $f 1] $f_name]} {
+ break
+ }
+ }
+
+ if {$i >= [llength $flist]} {
+ set flist [lrange $flist 0 $fln]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 [list $f_col $f_name]]
+ # let users of data know it's changed (cheaper than hash)
+ WPScriptVersion common 1
+ } else {
+ catch {unset flist}
+ lappend flist [list $f_col $f_name] [list [WPTFSaveDefault 0]]
+ # ditto
+ WPScriptVersion common 1
+ }
+
+ catch {WPSessionState folder_cache $flist}
+ }
+}
+
+# return the list of cached visited folders and make sure given
+# default is somewhere in the list
+proc WPTFGetFolderCache {} {
+ if {[catch {WPSessionState folder_cache} flist]} {
+ catch {unset flist}
+ lappend flist [WPTFSaveDefault 0]
+ catch {WPSessionState folder_cache $flist}
+ }
+
+ return $flist
+}
+
+proc WPExitOnClose {{frame window}} {
+ global _wp
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function wpLink(){"
+ cgi_put " ${frame}.webpinelink = 1;"
+ cgi_put " return true;"
+ cgi_puts "}"
+ cgi_put "function wpLoad(){"
+ cgi_put " ${frame}.webpinelink = 0;"
+ cgi_puts "}"
+ cgi_put "function wpUnLoad(){"
+ cgi_put " if(!${frame}.webpinelink){"
+ cgi_put " window.open('[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/ripcord.tcl?t=10&cid=[WPCmd PEInfo key]','Depart','width=350,height=200');"
+ cgi_put " }"
+ cgi_puts "}"
+ }
+
+ uplevel 1 {
+
+ # tweak some cgi_* procs for global effect
+ if {0 == [catch {rename cgi_url _wp_orig_cgi_url}]} {
+ proc cgi_url {args} {
+ lappend newargs [lindex $args 0]
+ foreach a [lrange $args 1 end] {
+ if {[regexp "^(onClick)=(.*)" $a dummy attr str]} {
+ set onclicked 1
+ lappend newargs "${attr}=wpLink();${str}"
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onclicked]} {
+ lappend newargs "onClick=wpLink();"
+ }
+
+ return [eval "_wp_orig_cgi_url $newargs"]
+ }
+ }
+
+ if {0 == [catch {rename cgi_area _wp_orig_cgi_area}]} {
+ proc cgi_area {args} {
+ lappend newargs [lindex $args 0]
+ foreach a [lrange $args 1 end] {
+ if {[regexp "^(onClick)=(.*)" $a dummy attr str]} {
+ set onclicked 1
+ lappend newargs "${attr}=\"wpLink();${str}\""
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onclicked]} {
+ lappend newargs "onClick=\"return wpLink();\""
+ }
+
+ return [eval "_wp_orig_cgi_area $newargs"]
+ }
+ }
+
+ if {0 == [catch {rename cgi_form _wp_orig_cgi_form}]} {
+ proc cgi_form {args} {
+ foreach a [lrange $args 0 [expr [llength $args]-2]] {
+ if {[regexp "^onSubmit=(.*)" $a dummy str]} {
+ set onsubmitted 1
+ lappend newargs "onSubmit=wpLink(); ${str}"
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onsubmitted]} {
+ lappend newargs "onSubmit=return wpLink();"
+ }
+
+ lappend newargs [lindex $args end]
+
+ uplevel 1 "_wp_orig_cgi_form $newargs"
+ }
+ }
+ }
+}
+
+proc WPTFIndexWidthRatio {fields field} {
+ # should be formula based on total fields
+ # and number of "wider" fields
+ switch [string toupper $field] {
+ TO -
+ FROM -
+ FROMORTO -
+ FROMORTONOTNEWS -
+ RECIPS -
+ SENDER -
+ SUBJECT { return 1.25 }
+ default { return 1 }
+ }
+}
diff --git a/web/cgi/alpine/1.0/common.tcl b/web/cgi/alpine/1.0/common.tcl
new file mode 100755
index 00000000..4a540cc8
--- /dev/null
+++ b/web/cgi/alpine/1.0/common.tcl
@@ -0,0 +1,289 @@
+#!./tclsh
+# $Id: common.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# common.tcl
+#
+# Purpose: CGI script snippet to generate html output associated
+# with the WebPine message view/index ops frame
+#
+# Input:
+set ops_vars {
+}
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set padleft 3px
+
+#
+# Command Menu definition for Message View Screen
+#
+set view_menu {
+}
+
+set common_menu {
+ {
+ {expr {0}}
+ {
+ {
+ # * * * * UBIQUITOUS INBOX LINK * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_index.tcl target=spec class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {expr {0}}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ops_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose top.spec.body
+ }
+
+ WPStyleSheets
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "function flip(n){"
+ cgi_put " var d = top.spec.body.document;"
+ cgi_put " var f = d.index;"
+ cgi_put " if(f && document.implementation){"
+ cgi_put " var e = d.createElement('input');"
+ cgi_put " var ver = navigator.appVersion;"
+ cgi_put " if(!((ver.indexOf('MSIE')+1) && (ver.indexOf('Macintosh')+1))) e.type = 'hidden';"
+ cgi_put " e.name = 'bod_'+n;"
+ cgi_put " e.value = '1';"
+ cgi_put " f.appendChild(e);"
+ cgi_put " f.submit();"
+ cgi_put " return false;"
+ cgi_puts " }"
+ cgi_puts " return true;"
+ cgi_puts "}"
+ }
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{n} {if(flip('next')) top.spec.body.location = 'wp.tcl?page=body&bod_next=1'}}
+ {{p} {if(flip('prev')) top.spec.body.location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{i} {if(top.spec.cmds) top.spec.location = 'fr_index.tcl'}}
+ {{s} {if(top.spec.cmds) top.spec.cmds.document.saveform.f_name.focus()}}
+ {{d} {if(top.spec.cmds) top.spec.cmds.document.delform.op[0].click()}}
+ {{u} {if(top.spec.cmds) top.spec.cmds.document.delform.op[1].click()}}
+ {{r} {if(top.spec.cmds) top.spec.cmds.document.replform.op.click()}}
+ {{f} {if(top.spec.cmds) top.spec.cmds.document.forwform.op.click()}}
+ {{ } {if(top.spec.body.document.index && flip('next')) top.spec.body.location = 'wp.tcl?page=body&bod_next=1'}}
+ {{-} {if(top.spec.body.document.index && flip('prev')) top.spec.body.location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{z} {if(top.spec.body.document.index && top.spec.body.document.index.zoom) top.spec.body.document.index.zoom.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ lappend kequiv [list {h} "if(top.spec.cmds.document.saveform) top.spec.body.location = 'wp.tcl?page=view&fullhdr=flip'"]
+ }
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv {} top.spec.body] top.gen.focus();"
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) $onload {
+
+ cgi_put [cgi_url [cgi_imglink smalllogo] wp.tcl?page=help&topic=about class=navbar target=_top]
+
+ cgi_br
+
+ cgi_division class=navbar "style=\"background-color: $_wp(menucolor)\"" {
+ cgi_division "style=\"padding: 8px 0 2px $padleft\"" {
+ cgi_puts [cgi_span "style=font-weight: bold" "Current Folder"]
+ }
+
+ set mbn [WPCmd PEMailbox mailboxname]
+ if {[string length $mbn] > 16} {
+ set mbn "[string range $mbn 0 14]..."
+ }
+
+ cgi_division align=center {
+ cgi_put [cgi_url $mbn fr_index.tcl target=spec class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: yellow; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: yellow; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+ }
+
+ cgi_hr "width=75%" "style=\"margin-top:8px\""
+
+ # Common Navigation controls
+ cgi_division align=center "style=\"padding-bottom: 4px\"" {
+ cgi_put [cgi_img [WPimg but_rnd_block] border=0 "usemap=#nav" "alt=Navigation Controls"]
+ cgi_map nav {
+ cgi_area shape=rect coords=0,0,37,38 "href=wp.tcl?page=body&bod_prev=1" target=body "onClick=\"return flip('prev')\"" "alt=Previous"
+ cgi_area shape=rect coords=0,40,32,74 "href=wp.tcl?page=body&bod_next=1" target=body "onClick=\"return flip('next')\"" "alt=Next"
+ cgi_area shape=rect coords=50,0,82,38 "href=wp.tcl?page=body&bod_first=1" target=body "onClick=\"return flip('first')\"" "alt=First"
+ cgi_area shape=rect coords=50,40,82,74 "href=wp.tcl?page=body&bod_last=1" target=body "onClick=\"return flip('last')\"" "alt=Last"
+ }
+
+ # Jump option
+ if {[WPCmd PEInfo feature enable-jump-cmd]} {
+ cgi_br
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body name=goform "style=margin-top:6" {
+ cgi_text "page=body" type=hidden notab
+ cgi_text gonum= class=navtext size=4 maxlength=6 "onClick=this.select()"
+ if {0} {
+ cgi_br
+ cgi_submit_button "goto=Jump to Msg \#" class=navtext "style=margin-right:2;margin-top:6"
+ } else {
+ cgi_submit_button "goto=Jump" class=navtext "style=margin-right:2"
+ }
+ }
+ }
+ }
+
+ cgi_hr "width=75%"
+
+ cgi_division "style=\"padding: 0 0 6px $padleft\"" {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ if {$fln > 0} {
+ cgi_puts [cgi_span "style=font-weight: bold" "Folders"]
+ cgi_division "style=\"padding-left: 4px\"" {
+ # UBIQUITOUS INBOX LINK
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_index.tcl target=spec class=navbar]
+ }
+
+ set n 0
+ set fc [WPTFGetFolderCache]
+ for {set i 0} {$i < [llength $fc] && $i < $fln} {incr i} {
+ set f [lindex $fc $i]
+
+ if {0 == [catch {WPCmd PEFolder exists [lindex $f 0] [lindex $f 1]} result] && $result} {
+ cgi_br
+
+ set fn [lindex $f 1]
+ if {[string length $fn] > 15} {
+ set fn "...[string range $fn end-15 end]"
+ }
+
+ if {[string compare [lindex $f 1] [WPCmd PEMailbox mailboxname]]} {
+ cgi_put [cgi_url $fn "open.tcl?folder=[lindex $f 1]&colid=[lindex $f 0]&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url $fn fr_index.tcl target=spec class=navbar]
+ }
+
+ if {[incr n] >= $fln} {
+ break
+ }
+ }
+ }
+
+ cgi_br
+ cgi_puts [cgi_url "More Folders..." "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ } else {
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+
+ cgi_hr "width=75%"
+
+ # Common Operations
+ cgi_division "style=\"padding: 0 0 0 $padleft\"" {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ cgi_br
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ cgi_br
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+
+ cgi_division "style=\"padding: 12px 0 0 $padleft\"" {
+ cgi_put [cgi_url "Configure" wp.tcl?page=conf_process&newconf=1&oncancel=main.tcl&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ cgi_br
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help class=navbar target=_top]
+ }
+
+ cgi_division "style=\"padding: 12px 0 10px $padleft\"" {
+ if {[WPCmd PEInfo feature quit-without-confirm]} {
+ cgi_puts [cgi_url "Quit $_wp(appname)" $_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid target=_top class=navbar]
+ } else {
+ cgi_puts [cgi_url "Quit $_wp(appname)" wp.tcl?page=quit&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/compose.tcl b/web/cgi/alpine/1.0/compose.tcl
new file mode 100755
index 00000000..d5a6af3d
--- /dev/null
+++ b/web/cgi/alpine/1.0/compose.tcl
@@ -0,0 +1,804 @@
+#!./tclsh
+# $Id: compose.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# compose.tcl
+#
+# Purpose: TCL script to generate html form representing
+# a message composition.
+
+# Input:
+set compose_vars {
+ {uid "" 0}
+ {style "" ""}
+ {nickto "" ""}
+ {book "" 0}
+ {ai "" -1}
+ {notice "" ""}
+ {repall "" 0}
+ {reptext "" 0}
+ {repqstr "" ""}
+ {f_name "" ""}
+ {f_colid "" 0}
+ {cid "Missing Command ID"}
+ {spell "" ""}
+ {oncancel "" "main.tcl"}
+}
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Output:
+#
+
+set bgcolor $_wp(dialogcolor)
+set buttoncolor "ffcc66"
+
+# set the default for the compose form. Modern browsers should submit
+# in the character set of the HTML form.
+set default_charset "UTF-8"
+
+#set cancelmsg "Really Cancel your Message (and destroy its text)"
+
+set msgs(cancel) "Cancel message (answering OK will abandon your mail message)"
+
+set msgs(noattach) {[ Message has no attachments ]}
+
+set defaultheaders {to cc subject attach}
+
+set fccname ""
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc default_fcc {itemval} {
+ global fccdefault f_name f_colid
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+
+ # fcc's itemval should be a list of collection-id and folder-name
+ if {[llength $itemval] == 2} {
+ set fcccol [lindex $itemval 0]
+ set fccname [lindex $itemval 1]
+ } elseif {[string length $f_name]} {
+ set fcccol $f_colid
+ set fccname $f_name
+ } elseif {[info exists fccdefault] || [catch {WPCmd PECompose fccdefault} fccdefault] == 0} {
+ set fcccol [lindex $fccdefault 0]
+ set fccname [lindex $fccdefault 1]
+ unset fccdefault
+ } else {
+ set fccname sent-mail
+ if {[llength $collections] > 1} {
+ set fcccol 1
+ } else {
+ set fcccol 0
+ }
+ }
+
+ return [list $fccname $fcccol $collections]
+}
+
+proc rowfield {item itemval style} {
+ global _wp msgs attachments bgcolor postoption fccname cols
+
+ set litem [string tolower $item]
+
+ if {$cols == 80} {
+ set textsize "60%"
+ } else {
+ set textsize $cols
+ }
+
+ cgi_table_row class=body $style bgcolor="$bgcolor" {
+ cgi_table_data align=left class=comphdr width=60 {
+ switch -- [string tolower $item] {
+ attach {
+ #cgi_submit_button "queryattach=Attach" class="comphdrbtn"
+ cgi_put Attachments
+ }
+ x_fcc {
+ cgi_submit_button "br_fcc=Fcc" class=comphdrbtn
+ }
+ default {
+ cgi_put $item
+ }
+ }
+ }
+
+ cgi_table_data align=center class=comphdr "style=\"padding: 0px 6px 0px 2px\"" {
+ cgi_put [cgi_bold ":"]
+ }
+
+ cgi_table_data align=left valign=middle class=comptext "style=\"padding: 2px 0px\"" nowrap {
+ switch -- [string tolower $item] {
+ attach {
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ cgi_table_row {
+ set alist ""
+ cgi_table_data align=left {
+ if {[info exists attachments] && [set n [llength $attachments]]} {
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ # format: {ID TITLE SIZE TYPE}
+ set i 1
+ foreach a $attachments {
+ cgi_table_row {
+ if {$n > 1} {
+ cgi_table_data {
+ cgi_puts [cgi_font face=Helvetica "$i)"]
+ }
+ incr i
+ }
+ cgi_table_data valign=middle align=left {
+ set id [lindex $a 0]
+ cgi_puts [cgi_font face=Helvetica "[lindex $a 1] ([lindex $a 2] bytes) [lindex $a 3]"]
+ lappend alist $id
+ }
+ cgi_table_data align=right height=23 width=23 {
+ cgi_image_button detach_${id}=[WPimg but_remove] border=0 align=right alt="Delete Attachment"
+ }
+ }
+ }
+ }
+ } else {
+ cgi_put [cgi_font size="-1" face=Helvetica $msgs(noattach)]
+ }
+
+ cgi_text attachments=[join $alist ","] type=hidden notab
+ }
+
+ cgi_table_data align=right width=70 {
+ cgi_submit_button "queryattach=Attach" class=compbtn "style=\"width:64\""
+ }
+ }
+ }
+ }
+ cc -
+ bcc -
+ reply-to -
+ to {
+ set fn [fieldname $item]
+ cgi_text $fn=${itemval} size=$textsize "style=\"padding: 2px\""
+ cgi_image_button "br_${fn}=[WPimg book]" class=compbtn "alt=Address Book" "style=\"vertical-align:text-bottom\""
+ cgi_submit_button "ex_${fn}=Expand" class=compbtn "style=\"vertical-align:base-line\""
+ }
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+ set collections [lindex $deffcc 2]
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ cgi_table_row {
+ cgi_table_data {
+ if {[llength $collections] > 1} {
+ cgi_text [fieldname $item]=$fccname size=38 onFocus=this.select()
+ #cgi_put [cgi_font face=Helvetica "in[cgi_nbspace]collection:[cgi_nbspace]"]
+ cgi_put [cgi_font class=comphdr in][cgi_nbspace]
+ cgi_select colid align=center {
+ for {set j 0} {$j < [llength $collections]} {incr j} {
+ if {$j == $fcccol} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+
+ set colname [lindex [lindex $collections $j] 1]
+ if {[string length $colname] > 15} {
+ set colname "[string range $colname 0 12]..."
+ }
+
+ cgi_option $colname value=$j $selected
+ }
+ }
+ } else {
+ cgi_text [fieldname $item]=$fccname size=$textsize maxlength=1024 onFocus=this.select()
+ cgi_text "colid=0" type=hidden notab
+ }
+ }
+
+ cgi_table_data align=right {
+ cgi_submit_button "br_fcc=Browse" class="compbtn"
+ }
+ }
+ }
+ }
+ default {
+ cgi_text [fieldname $item]=${itemval} size=$textsize maxlength=1024
+ }
+ }
+ }
+ }
+
+ switch -- [string tolower $item] {
+ attach {
+ cgi_table_row class=smallhdr {
+ cgi_table_data colspan=2 {
+ cgi_put [cgi_img [WPimg dot]]
+ }
+
+ cgi_table_data {
+ cgi_table cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data valign=middle class=smallhdr {
+ # complicated cause prompt and feature are reverse sense
+ if {[info exists postoption(fcc-without-attachments)]} {
+ if {$postoption(fcc-without-attachments)} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+ } elseif {[WPCmd PEInfo feature "fcc-without-attachments"]} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+
+ cgi_checkbox fccattach=1 class=smallhdr id="fcccb" $checked
+ }
+ cgi_table_data valign=middle class=smallhdr {
+ set blurb "Include attachments in copy of message saved to Fcc"
+ if {[string length $fccname]} {
+ append blurb " (i.e., \"$fccname\")"
+ }
+
+ cgi_put [cgi_span "style=cursor: pointer" onclick="flipCheck('fcccb')" $blurb]
+ }
+ }
+ }
+ }
+ }
+ }
+ default {}
+ }
+}
+
+set compose_menu {
+ {
+ {expr [info exists _wp(ispell)] && [file executable $_wp(ispell)]}
+ {
+ {
+ # * * * * SPELLCHECK * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "check=Spell Check" class=navtext "style=\"margin-top:8\""
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "help=Get Help" class=navtext "style=\"margin-top:8;margin-bottom:8\""
+ }
+ }
+ }
+}
+
+set compose2_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "help=Get Help" class=navtext
+ }
+ }
+ }
+}
+
+WPEval $compose_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _close "Invalid Command ID"]
+ }
+
+ set cols [WPCmd PEConfig columns]
+
+ switch -- $style {
+ Reply {
+ set title "Reply to Message [WPCmd PEMessage $uid number]"
+
+ if {[catch {cgi_import part}]} {
+ set part ""
+ }
+
+ foreach h [WPCmd PEMessage $uid replyheaders $part] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ if {!$repall} {
+ catch {unset hdrvals(cc)}
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ if {$reptext} {
+ set replytext [WPCmd PEMessage $uid replytext $repqstr $part]
+ set body [join [lindex $replytext 0] "\r\n"]
+ if {[WPCmd PEInfo feature include-attachments-in-reply]} {
+ set attachments [lindex $replytext 1]
+ }
+ } else {
+ set body ""
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+ }
+
+ catch {WPCmd set help_context reply}
+ }
+ Forward {
+ set title "Forward Message [WPCmd PEMessage $uid number]"
+
+ if {[catch {cgi_import part}]} {
+ set part ""
+ }
+
+ foreach h [WPCmd PEMessage $uid forwardheaders $part] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ set forwardtext [WPCmd PEMessage $uid forwardtext $part]
+ append body [join [lindex $forwardtext 0] "\r\n"]
+
+ set attachments [lindex $forwardtext 1]
+ catch {WPCmd set help_context forward}
+ }
+ Postponed {
+ set title "Postponed Message"
+ set postponed [WPCmd PEPostpone extract $uid]
+
+ foreach h [lindex $postponed 0] {
+ append hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ set body [join [lindex $postponed 1] "\r\n"]
+ set attachments [lindex $postponed 2]
+
+ foreach opt [lindex $postponed 3] {
+ switch [lindex $opt 0] {
+ charset {
+ set charset [lindex $opt 1]
+ }
+ }
+ }
+
+ unset postponed
+ catch {WPCmd set help_context compose}
+ }
+ default {
+ if {![info exists title]} {
+ set title "Compose New Message"
+ }
+
+ if {[catch {cgi_import ldap}] == 0
+ && [string compare $ldap 1] == 0
+ && [catch {cgi_import qn}] == 0
+ && [catch {cgi_import si}] == 0
+ && [catch {cgi_import ni}] == 0
+ && [catch {WPCmd PELdap ldapext $qn "${si}.${ni}"} leinfo] == 0} {
+ foreach item [lindex $leinfo 1] {
+ switch -- [string tolower [lindex $item 0]] {
+ "email address" {
+ if {[catch {cgi_import ei}] == 0} {
+ set ldap_email [lindex [lindex $item 1] $ei]
+ } else {
+ set ldap_email [lindex [lindex $item 1] 0]
+ }
+ }
+ name {
+ set ldap_name [lindex [lindex $item 1] 0]
+ }
+ "fax telephone" {
+ set ldap_fax [lindex [lindex $item 1] 0]
+ }
+ }
+ }
+
+ # put it all together
+ if {[catch {cgi_import fax}] == 0 && [string compare $fax yes] == 0} {
+ set n {[0-9]}
+ set n3 $n$n$n
+ set n4 $n$n$n$n
+ if {[info exists ldap_name]
+ && [regexp "^\\\+1 ($n3) ($n3)-($n4)\$" $ldap_fax dummy areacode prefix number]
+ && [lsearch -exact {206 425} $areacode] >= 0} {
+ regsub -all { } $ldap_name {_} ldap_fax_name
+ set hdrvals(to) "\"Fax to ${ldap_name}\" <${ldap_fax_name}@${areacode}-${prefix}-${number}.fax.cac.washington.edu>"
+ set hdrvals(subject) "FAX: "
+ }
+ } elseif {[info exists ldap_email]} {
+ if {[info exists ldap_name]} {
+ set hdrvals(to) "\"$ldap_name\" <$ldap_email>"
+ } else {
+ set hdrvals(to) $ldap_email
+ }
+ }
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ if {![info exists body] || [string length $body] == 0} {
+ if {([info exists msgdata] && [llength $msgdata]) || [catch {WPCmd set suspended_composition} msgdata] == 0} {
+ set attachments {}
+ foreach e $msgdata {
+ switch -- [string tolower [lindex $e 0]] {
+ "" {
+ # do nothing, empty field
+ }
+ attach {
+ if {[catch {WPCmd PECompose attachinfo [lindex $e 1]} ai]} {
+ WPCmd PEInfo statmsg $ai
+ } else {
+ lappend attachments [list [lindex $e 1] [lindex $ai 0] [lindex $ai 1] [lindex $ai 2]]
+ # attachment description is in [lindex $ai 3]
+ }
+ }
+ body {
+ catch {unset body}
+ if {[string compare $style Spell] == 0} {
+ if {[catch {cgi_import_as spell spell} result] == 0} {
+ if {[string compare $spell Cancel] == 0} {
+ WPCmd PEInfo statmsg "Spell Check Cancelled"
+ } elseif {[catch {WPCmd set wp_spellresult} spellresult] == 0} {
+ set oldbody [lindex $e 1]
+ foreach l $spellresult {
+ set oldline [lindex $oldbody [lindex $l 0]]
+ set newline ""
+ set offset 0
+ foreach w [lindex $l 1] {
+ set o [lindex $w 0]
+ append newline "[string range $oldline $offset [expr {$o - 1}]][lindex $w 2]"
+ set offset [expr {$o + [lindex $w 1]}]
+ }
+
+ append newline [string range $oldline $offset end]
+
+ set newlines([lindex $l 0]) $newline
+ }
+
+ for {set n 0} {$n < [llength $oldbody]} {incr n} {
+ if {[info exists newlines($n)]} {
+ append body $newlines($n)
+ } else {
+ append body [lindex $oldbody $n]
+ }
+
+ append body "\r\n"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No corrections present, Nothing changed."
+ }
+ }
+
+ catch {WPCmd PEInfo unset wp_spellresult}
+ }
+
+ if {![info exists body]} {
+ set body [join [lindex $e 1] "\r\n"]
+ }
+ }
+ fcc {
+ if {[string length $f_name]} {
+ set hdrvals(fcc) [list $f_colid $f_name]
+ } else {
+ set hdrvals(fcc) [lindex $e 1]
+ }
+ }
+ postoption {
+ set opt [lindex $e 1]
+ switch -- [lindex $opt 0] {
+ charset {
+ set charset [lindex $opt 1]
+ }
+ default {
+ set postoption([lindex $opt 0]) [lindex $opt 1]
+ }
+ }
+ }
+ default {
+ set hdrvals([fieldname [lindex $e 0]]) [lindex $e 1]
+ }
+ }
+ }
+
+ if {![info exists body]} {
+ set body ""
+ }
+ } else {
+ set body ""
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[string length $nickto] != 0 || $ai != -1} {
+ if {[catch {WPCmd PEAddress entry $book $nickto $ai} entryval] == 0} {
+ set addrlist [lindex $entryval 0]
+ set newfcc [lindex $entryval 1]
+ if {[string length $newfcc]} {
+ global fccdefault
+ if {[string compare $newfcc "\"\""] == 0} {
+ set newfcc ""
+ }
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+ set fccdefault [list [expr {[llength $collections] > 1 ? 1 : 0}] $newfcc]
+ }
+ } else {
+ set addrlist $nickto
+ }
+ # bug: where's "to" supposed to come from?
+ if {0 && [string length $to]} {
+ append to ", ${addrlist}"
+ } else {
+ set to $addrlist
+ }
+ }
+
+ WPCmd PECompose noattach
+ }
+ }
+
+ catch {WPCmd set help_context compose}
+ }
+ }
+
+ if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "Header Retrieval Failure" $headers]
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ if {![info exists charset]} {
+ set charset $default_charset
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ WPStdHtmlHdr "Compose Message"
+ WPStdScripts
+ WPStyleSheets
+
+ cgi_put ""
+
+ cgi_javascript {
+ cgi_put "function setop(i){"
+ cgi_put " eval('document.compose.sendop\['+i+'\].checked = true');"
+ cgi_put " return false;"
+ cgi_put "}"
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" onLoad=document.compose.to.focus() {
+ if {[info exists comments]} {
+ cgi_puts "Diag: "
+ foreach c $comments {
+ cgi_html_comment $c
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=compose enctype=multipart/form-data target=_top {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=100% {
+ cgi_table_row {
+ lappend msglist [list $notice]
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=2 {
+
+ cgi_division class=navbar "style=background-color:$_wp(menucolor)" {
+ # * * * * SEND * * * *
+ cgi_puts ""
+ }
+
+ WPTFCommandMenu compose_menu {}
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data border=0 bgcolor=$bgcolor {
+ cgi_table {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=0 align=left {
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "sessid=$sessid" type=hidden notab
+ cgi_text "page=post" type=hidden notab
+ cgi_text "postpost=$oncancel" type=hidden notab
+ if {[string length $repqstr]} {
+ cgi_text "repqstr=$repqstr" type=hidden notab
+ }
+
+ if {0 && [info exists charset]} {
+ cgi_text "form_charset=$charset" type=hidden notab
+ # character encoding suport: the idea is to plant a known
+ # char in the given charset and see what comes back to
+ # post.tcl from the browser. Why is it again the @#*$!
+ # browser can't just tell us?
+ foreach tc {#8364 #1066 thorn tcedil #65509} {
+ cgi_puts ""
+ }
+ }
+
+ if {[info exists flowed]} {
+ cgi_text "form_flowed=yes" type=hidden notab
+ }
+
+ foreach field [WPCmd PECompose syshdrs] {
+ set hdr [fieldname [lindex $field 0]]
+ if {[info exists hdrvals($hdr)]} {
+ cgi_text "${hdr}=$hdrvals($hdr)" type=hidden notab
+ }
+ }
+
+ if {[catch {WPCmd set wp_extra_hdrs} extras] == 0 && $extras == 0} {
+ set extrahdrs {}
+ }
+
+ foreach field $headers {
+ set item [lindex $field 0]
+
+ if {[string length $item] == 0} {
+ continue
+ }
+
+ set itemvaldef [lindex $field 1]
+ set litem [string tolower $item]
+ set fn [fieldname $item]
+
+ if {[info exists hdrvals($fn)]} {
+ set itemval $hdrvals($fn)
+ } elseif {[info exists $litem] && [string length [subst $$litem]]} {
+ set itemval [subst $$litem]
+ } elseif {[string length $itemvaldef]} {
+ set itemval $itemvaldef
+ } else {
+ set itemval ""
+ }
+
+ if {[catch {WPCmd PECompose composehdrs} h] == 0 && [llength $h] > 0} {
+ set display_headers [string tolower $h]
+ } else {
+ set display_headers $defaultheaders
+ }
+
+ if {![info exists extrahdrs]} {
+ if {[info exists postoption(fcc-set-by-addrbook)]} {
+ if {[lsearch -exact $display_headers fcc] < 0} {
+ lappend display_headers fcc
+ }
+ }
+ }
+
+ if {[info exists attachments] && [llength $attachments]
+ && [lsearch -exact $display_headers attach] < 0} {
+ lappend display_headers attach
+ }
+
+ if {[lsearch -exact $display_headers [string tolower $item]] >= 0} {
+ rowfield $item $itemval $style
+ } elseif {[info exists extrahdrs]} {
+ lappend extrahdrs [list $item $itemval $style]
+ } else {
+ switch -- [string tolower $item] {
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+
+ cgi_text [fieldname $item]=$fccname type=hidden notab
+ cgi_text "colid=$fcccol" type=hidden notab
+ }
+ default {
+ cgi_text "[fieldname $item]=$itemval" type=hidden notab
+ }
+ }
+ }
+ }
+
+ if {[info exists extrahdrs]} {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=left class=comptext {
+ cgi_image_button extrahdrs=[WPimg hdrless] border=0 alt="Hide Extra Headers"
+ }
+ }
+
+ foreach pb $extrahdrs {
+ rowfield [lindex $pb 0] [lindex $pb 1] [lindex $pb 2]
+ }
+ } else {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=left class=comptext {
+ cgi_image_button extrahdrs=[WPimg hdrmore] border=0 alt="Show Extra Headers"
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=center class=comptext {
+ cgi_textarea body=${body} rows=20 cols=$cols wrap=physical class=view "style=\"padding: 2px\""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/comview.tcl b/web/cgi/alpine/1.0/comview.tcl
new file mode 100755
index 00000000..01e1af80
--- /dev/null
+++ b/web/cgi/alpine/1.0/comview.tcl
@@ -0,0 +1,184 @@
+#!./tclsh
+# $Id: comview.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# comview.tcl
+#
+# Purpose: CGI script to produce the common view commands frame
+
+# Input:
+set comview_vars {
+ {f_colid {} [WPCmd PEFolder isincoming 0]}
+ {f_name {} "saved-messages"}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./cmdfunc.tcl
+
+WPEval $comview_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose top.spec.body
+ }
+
+ WPStyleSheets
+ cgi_put ""
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {top.spec.body.location = 'wp.tcl?page=view&bod_next=1'}}
+ {{p} {top.spec.body.location = 'wp.tcl?page=view&bod_prev=1'}}
+ {{i} {top.spec.location = 'fr_index.tcl'}}
+ {{s} {document.saveform.f_name.focus()}}
+ {{d} {document.delform.op[0].click()}}
+ {{u} {document.delform.op[1].click()}}
+ {{r} {document.replform.op.click()}}
+ {{f} {document.forwform.op.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ lappend kequiv [list {h} "top.spec.body.location = 'wp.tcl?page=view&fullhdr=flip'"]
+ }
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv document.saveform.f_name top.spec.body]"
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload {
+ cgi_table class=ops cellpadding=0 cellspacing=0 border=0 width="100%" height=24 {
+ cgi_table_row {
+ cgi_table_data valign=middle align=left nowrap class=viewop {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=replform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=main.tcl" type=hidden notab
+ cgi_text "postpost=fr_main.tcl" type=hidden notab
+
+ cgi_table border=0 class=ops cellpadding=0 cellspacing=0 class=viewop {
+ cgi_table_row {
+ cgi_table_data class=viewop rowspan=2 {
+ # * * * * REPLY * * * *
+ cgi_submit_button op=Reply class="viewop" "style=\"vertical-align: middle; margin-left: 4\""
+ }
+ cgi_table_data class=viewop {
+ cgi_checkbox "repall=1" style=vertical-align:middle
+ cgi_put "To All[cgi_nbspace]"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class=viewop rowspan=2 {
+ cgi_checkbox "reptext=1" checked style=vertical-align:middle
+ cgi_put "Include text"
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=forwform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=main.tcl" type=hidden notab
+ cgi_text "postpost=fr_main.tcl" type=hidden notab
+
+ # * * * * FORWARD * * * *
+ cgi_submit_button op=Forward class="viewop"
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap class=viewop {
+ cgi_table class=ops cellpadding=0 cellspacing=0 border=0 class=viewop {
+ cgi_table_row {
+ cgi_table_data class=viewop {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=spec name=saveform {
+ cgi_text "page=fr_view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "sid=[clock seconds]" type=hidden notab
+
+ # * * * * Save * * * *
+ cgi_submit_button "save=Save" class="viewop"
+ cgi_put "[cgi_nbspace]to "
+
+ cgi_text f_colid=$f_colid type=hidden notab
+ cgi_text op=save type=hidden notab
+
+ cgi_select f_name class=viewop style=vertical-align:middle "onchange=document.saveform.save.click(); return false;" {
+ foreach {oname oval} [WPTFGetSaveCache] {
+ cgi_option $oname value=$oval
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=take {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_submit_button op=Take class="viewop"
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=right nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body name=delform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ # * * * * UNDELETE * * * *
+ cgi_submit_button op=Delete class="viewop"
+
+ # * * * * UNDELETE * * * *
+ cgi_submit_button op=Undelete class="viewop" "style=\"margin-right: 4\""
+
+ # * * * * ANTISPAM * * * *
+ if {([info exists _wp(spamaddr)] && [string length $_wp(spamaddr)])
+ || ([info exists _wp(spamfolder)] && [string length $_wp(spamfolder)])} {
+ cgi_submit_button "op=Report Spam" class="viewop" "style=\"margin-right: 4; color: white; background-color: black\""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/conf_process.tcl b/web/cgi/alpine/1.0/conf_process.tcl
new file mode 100755
index 00000000..a8170c4e
--- /dev/null
+++ b/web/cgi/alpine/1.0/conf_process.tcl
@@ -0,0 +1,1358 @@
+#!./tclsh
+# $Id: conf_process.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# conf_process.tcl
+#
+# Purpose: CGI script to perform various message/mailbox
+# oriented operations
+
+source genvars.tcl
+source filter.tcl
+
+set cfs_vars {
+ {cid "Missing Command ID"}
+ {oncancel "Missing oncancel"}
+ {cp_op {} noop}
+ {save {} 0}
+ {delete {} 0}
+ {compose {} 0}
+ {cancel {} 0}
+ {gtab {} 0}
+ {mltab {} 0}
+ {mvtab {} 0}
+ {ctab {} 0}
+ {abtab {} 0}
+ {ftab {} 0}
+ {rtab {} 0}
+ {wv {} ""}
+ {varlistadd {} ""}
+ {newconf {} 0}
+}
+
+## read vars
+foreach item $cfs_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Import Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+proc wpGetVar {_var {valid ""}} {
+ upvar $_var var
+
+ if {[catch {cgi_import_as $_var var} result]} {
+ error [list _action "Import Var $_var" $result]
+ }
+
+ if {[string length $valid]} {
+ switch -exact -- $valid {
+ _INTEGER_ {
+ if {[string is integer -strict $var] != 1} {
+ error [list _action "Invalid Input" "Non-Numeric Value for $_var"]
+ }
+ }
+ default {
+ if {[lsearch -exact $valid $var] < 0} {
+ error [list _action "Invalid Input" "Unrecognized Value $var for $_var"]
+ }
+ }
+ }
+ }
+}
+
+proc wpGetVarAs {_var _varas} {
+ upvar $_varas varas
+
+ if {[catch {cgi_import_as $_var varas} result]} {
+ set varas ""
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+proc wpGetGoodVars {} {
+ global wv
+ global general_vars msglist_vars composer_vars folder_vars address_vars msgview_vars rule_vars
+
+ switch -- $wv {
+ msgl {
+ set goodvars $msglist_vars
+ }
+ msgv {
+ set goodvars $msgview_vars
+ }
+ address {
+ set goodvars $address_vars
+ }
+ composer {
+ set goodvars $composer_vars
+ }
+ folder {
+ set goodvars $folder_vars
+ }
+ rule {
+ set goodvars $rule_vars
+ }
+ general {
+ set goodvars $general_vars
+ }
+ }
+ return $goodvars
+}
+
+proc fieldPos {fmt field} {
+ for {set i 0} {$i < [llength $fmt]} {incr i} {
+ if {[string compare [string toupper [lindex [lindex $fmt $i] 0]] [string toupper $field]] == 0} {
+ return $i
+ }
+ }
+
+ return -1
+}
+
+proc numberedVar {nvbase nvtotal} {
+ if {[catch {wpGetVarAs $nvtotal nvtot}] == 0} {
+ for {set i 0} {$i < $nvtot} {incr i} {
+ if {[catch {wpGetVar ${nvbase}${i}} nvval] == 0} {
+ return $i
+ }
+ }
+ }
+
+ return -1
+}
+
+set op $cp_op
+if {[catch {WPCmd set conf_page} conftype]} {
+ set conftype general
+}
+if {[string length $wv]} {
+ set conftype $wv
+ set op tab
+}
+if {$save == 1 || [string compare $save Save] == 0} {
+ set op tab
+ set subop save
+} elseif {$newconf} {
+ set op noop
+} elseif {$gtab} {
+ set op "tab"
+ set conftype "general"
+} elseif {$mltab} {
+ set op "tab"
+ set conftype "msgl"
+} elseif {$mvtab} {
+ set op "tab"
+ set conftype "msgv"
+} elseif {$ctab} {
+ set op "tab"
+ set conftype "composer"
+} elseif {$abtab} {
+ set op "tab"
+ set conftype "address"
+} elseif {$ftab} {
+ set op "tab"
+ set conftype "folder"
+} elseif {$rtab} {
+ set op "tab"
+ set conftype "rule"
+} elseif {$cancel == 1 || [string compare $cancel Cancel] == 0} {
+ set op "cancel"
+}
+
+proc wpGetRulePattern {} {
+ global pattern_fields
+
+ set patlist {}
+
+ foreach {patvar patfield} $pattern_fields {
+ wpGetVarAs $patvar tval
+
+ switch $patvar {
+ headers {
+ # collect header fields/values into "headers"
+ set headers {}
+ if {[catch {wpGetVarAs header_total hcnt} res] == 0} {
+ for {set i 0} {$i < $hcnt} {incr i} {
+ if {[catch {wpGetVarAs hdrfld${i} fld}] == 0
+ && [catch {wpGetVarAs hdrval${i} val}] == 0} {
+ lappend headers [list $fld $val]
+ }
+ }
+ }
+
+ lappend patlist [list headers $headers]
+ }
+ default {
+ lappend patlist [list $patvar $tval]
+ }
+ }
+ }
+
+
+ return $patlist
+
+}
+
+proc wpGetRuleAction {tosave} {
+ set actlist {}
+ wpGetVar action
+ if {$tosave == 1} {
+ lappend actlist [list "action" $action]
+ } else {
+ switch -- $action {
+ move {lappend actlist [list "kill" 0]}
+ delete {lappend actlist [list "kill" 1]}
+ }
+ }
+ wpGetVar actionfolder
+ lappend actlist [list "folder" $actionfolder]
+ wpGetVarAs moind moind
+ if {[string compare $moind "on"] == 0} {
+ lappend actlist [list [expr {$tosave == 1 ? "moind" : "move_only_if_not_deleted"}] "1"]
+ } else {
+ lappend actlist [list [expr {$tosave == 1 ? "moind" : "move_only_if_not_deleted"}] "0"]
+ }
+}
+
+ #
+ # Meat and potatoes of processing goes on here.
+ # Errors are barfed up as they occur,
+ # otherwise the result is communicated below...
+ #
+ set setfeatures [WPCmd PEConfig featuresettings]
+ set script fr_tconfig.tcl
+ switch -- $op {
+ tab {
+ if {[info exists goodvars] == 0} {
+ set goodvars [wpGetGoodVars]
+ }
+ foreach goodvar $goodvars {
+ set vtypeinp [lindex $goodvar 0]
+ set varname [lindex $goodvar 1]
+ set hlpthisvar 0
+ wpGetVarAs hlp.$varname.x thlp
+ if {[string length $thlp]} {
+ set hlpthisvar 1
+ set helpcancelset conf_process
+ }
+ switch -- $vtypeinp {
+ special {
+ switch -- $varname {
+ wp-columns {
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname wp-columns
+ } else {
+ wpGetVar columns
+ WPCmd PEConfig columns $columns
+ }
+ }
+ left-column-folders {
+ if {0 == [catch {wpGetVar fcachel}]} {
+ if {$fcachel <= $_wp(fldr_cache_max)} {
+ catch {WPSessionState left_column_folders $fcachel}
+ }
+ }
+ }
+ signature {
+ wpGetVar signature
+ set cursig [string trimright [join [WPCmd PEConfig rawsig] "\n"]]
+ set signature [string trimright $signature]
+ if {[string compare $cursig $signature]} {
+ WPCmd PEConfig rawsig [split $signature "\n"]
+ }
+ }
+ filters {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for filters"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ scores {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_score 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for scores"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_score 1
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ indexcolor {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_indexcolor 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for index colors"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_indexcolor 1
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ collections {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x cladd
+ if {[string length $cladd]} {
+ set script "fr_cledit.tcl"
+ set cledit_add 1
+ set cledit_onclecancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for collections"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set cle_ret 0
+ set cle_res ""
+ if {[string length $vle]} {
+ set script "fr_cledit.tcl"
+ set cledit_cl $i
+ set cledit_onclecancel conf_process
+ } elseif {[string length $vld]} {
+ set cle_ret [catch {WPCmd PEConfig cldel $i} cle_res]
+ } elseif {[string length $vlsu]} {
+ set cle_ret [catch {WPCmd PEConfig clshuff up $i} cle_res]
+ } elseif {[string length $vlsd]} {
+ set cle_ret [catch {WPCmd PEConfig clshuff down $i} cle_res]
+ }
+ if {$cle_ret} {
+ # error
+ } elseif {[string length $cle_res]} {
+ WPCmd PEInfo statmsg $cle_res
+ # something wrong here
+ }
+ }
+ }
+ }
+ index-format {
+ wpGetVarAs index-format iformat
+
+ set varchanged 0
+
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname index-format
+ } elseif {[catch {cgi_import hlp.index_tokens.x} result] == 0} {
+ set subop secthelp
+ set topicclass plain
+ set feathelpname h_index_tokens
+ set varhelpname h_index_tokens
+ }
+
+ if {[catch {cgi_import indexadd}] == 0
+ && [string compare "Add Field" $indexadd] == 0
+ && [catch {cgi_import indexaddfield}] == 0} {
+ if {[lsearch $iformat $indexaddfield] < 0} {
+ set iformat [linsert $iformat 0 $indexaddfield]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import adjust}] == 0
+ && [string compare Change $adjust] == 0
+ && [catch {cgi_import iop}] == 0
+ && [catch {cgi_import ifield}] == 0
+ && [set pos [fieldPos $iformat $ifield]] >= 0} {
+ switch $iop {
+ left {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos -1] $ifield]
+ set varchanged 1
+ }
+ right {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos] $ifield]
+ set varchanged 1
+ }
+ widen {
+ set f [lindex [lindex $iformat $pos] 0]
+ set w [lindex [lindex $iformat $pos] 1]
+ set dw [expr {round((100/[llength $iformat]) * [WPTFIndexWidthRatio $iformat $f])}]
+
+ if {[regexp {([0123456789]+)[%]} $w dummy w] == 0} {
+ set w $dw
+ }
+
+ if {$w < 95} {
+ incr w 5
+ } else {
+ set w 99
+ }
+
+ if {$w == $dw} {
+ set ws ""
+ } else {
+ set ws "${w}%"
+ }
+
+ set iformat [lreplace $iformat $pos $pos [list $f $ws]]
+ set varchanged 1
+ }
+ narrow {
+ set f [lindex [lindex $iformat $pos] 0]
+ set w [lindex [lindex $iformat $pos] 1]
+ set dw [expr {round((100/[llength $iformat]) * [WPTFIndexWidthRatio $iformat $f])}]
+
+ if {[regexp {([0123456789]+)[%]} $w dummy w] == 0} {
+ set w $dw
+ }
+
+ if {$w > 5} {
+ incr w -5
+ } else {
+ set w 1
+ }
+
+ if {$w == $dw} {
+ set ws ""
+ } else {
+ set ws "${w}%"
+ }
+
+ set iformat [lreplace $iformat $pos $pos [list $f $ws]]
+ set varchanged 1
+ }
+ remove {
+ set iformat [lreplace $iformat $pos $pos]
+ set varchanged 1
+ }
+ }
+ } else {
+ foreach f $iformat {
+ if {[catch {cgi_import_as shrm.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] >= 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import_as shlf.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] > 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos -1] $f]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import_as shrt.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] >= 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos] $f]
+ set varchanged 1
+ }
+ }
+ }
+ }
+
+ if {$varchanged} {
+ foreach f $iformat {
+ if {[string length [lindex $f 1]]} {
+ lappend ifv "[lindex $f 0]([lindex $f 1])"
+ } else {
+ lappend ifv [lindex $f 0]
+ }
+ }
+
+ WPCmd PEConfig varset index-format [list $ifv]
+ }
+ }
+ view-colors {
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname index-format
+ } elseif {[catch {cgi_import_as colormap.x colx}] == 0
+ && [catch {cgi_import_as colormap.y coly}] == 0} {
+ set rgbs {"000" "051" "102" "153" "204" "255"}
+ set xrgbs {"00" "33" "66" "99" "CC" "FF"}
+ set rgblen [llength $rgbs]
+ set imappixwidth 10
+
+ set colx [expr {${colx} / $imappixwidth}]
+ set coly [expr {${coly} / $imappixwidth}]
+ if {($coly >= 0 && $coly < $rgblen)
+ && ($colx >= 0 && $colx < [expr {$rgblen * $rgblen}])} {
+ set ired $coly
+ set igreen [expr {($colx / $rgblen) % $rgblen}]
+ set iblue [expr {$colx % $rgblen}]
+ set rgb "[lindex $rgbs $ired],[lindex $rgbs ${igreen}],[lindex $rgbs ${iblue}]"
+ set xrgb "[lindex $xrgbs $ired][lindex $xrgbs ${igreen}][lindex $xrgbs ${iblue}]"
+
+ if {[catch {cgi_import_as text tt}] == 0} {
+ set type [split $tt .]
+ catch {WPCmd set config_deftext [lindex $type end]}
+
+ if {[catch {cgi_import_as ground ground}] == 0} {
+ switch $ground {
+ f {
+ catch {WPCmd set config_defground f}
+ set fg $xrgb
+ }
+ b {
+ catch {WPCmd set config_defground b}
+ set bg $xrgb
+ }
+ }
+
+ if {[info exists fg] || [info exists bg]} {
+ switch [lindex $type 0] {
+ hdr {
+ set type [lindex $type 1]
+ if {[catch {cgi_import_as add.${type} foo}] == 0} {
+ set colop add
+ } elseif {[catch {cgi_import_as hi.${type} hindex}] == 0} {
+ set colop change
+ }
+
+ if {[info exists colop]} {
+ if {![info exists bg] && [catch {cgi_import_as dbg.$type bg} result]} {
+ WPCmd PEInfo statmsg "Can't import default background: $result"
+ } elseif {![info exists fg] && [catch {cgi_import_as dfg.$type fg} result]} {
+ WPCmd PEInfo statmsg "Can't import default foreground: $result"
+ }
+
+ switch $colop {
+ change {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors update [list $hindex $type ""] [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Problem changing $type color: $result"
+ }
+ }
+ add {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors add [list $type ""] [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Problem adding $type color: $result"
+ }
+ }
+ }
+
+ }
+ }
+ default {
+ if {![info exists bg] && [catch {cgi_import_as dbg.$type bg} result]} {
+ WPCmd PEInfo statmsg "Can't import default background: $result"
+ } elseif {![info exists fg] && [catch {cgi_import_as dfg.$type fg} result]} {
+ WPCmd PEInfo statmsg "Can't import default foreground: $result"
+ } elseif {[catch {WPCmd PEConfig colorset $type [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Can't set $type color: $result"
+ }
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid fore/back ground input!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose foreground or background!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose the type of text to color!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid RGB Input!"
+ }
+ } elseif {[catch {cgi_import addfield}] == 0
+ && [string compare "add " [string tolower [string range $addfield 0 3]]] == 0
+ && [catch {cgi_import newfield}] == 0
+ && [string length [set newfield [string trim $newfield]]]
+ && [catch {cgi_import_as dfg.normal dfg}] == 0
+ && [catch {cgi_import_as dbg.normal dbg}] == 0} {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors add [list $newfield ""] [list $dfg $dbg]} result]} {
+ WPCmd PEInfo statmsg "Problem adding $type color: $result"
+ }
+ } elseif {[catch {cgi_import reset}] == 0
+ && [string compare "restore " [string tolower [string range $reset 0 7]]] == 0} {
+ if {[catch {cgi_import_as text tt}] == 0} {
+ if {[llength [set type [split $tt .]]] == 2 && [string compare [lindex $type 0] hdr] == 0} {
+ set hdr [lindex $type end]
+ if {[catch {cgi_import_as hi.$hdr hindex}] == 0} {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors delete $hindex} result]} {
+ # bug: reloads cause this error - need better way to report it
+ #WPCmd PEInfo statmsg "Can't reset $hdr ($hindex) text: $result!"
+ } else {
+ catch {WPCmd PEInfo unset config_deftext}
+ }
+ }
+ } elseif {[string compare normal $tt] == 0} {
+ if {[catch {WPCmd PEConfig varset normal-foreground-color ""} result]
+ || [catch {WPCmd PEConfig varset normal-background-color ""} result]} {
+ WPCmd PEInfo statmsg "Can't reset normal text: $result!"
+ }
+ } elseif {[catch {cgi_import_as dfg.normal dfg}] == 0
+ && [catch {cgi_import_as dbg.normal dbg}] == 0} {
+ catch {WPCmd set config_deftext $tt}
+ if {[catch {WPCmd PEConfig colorset $tt [list $dfg $dbg]} result]} {
+ WPCmd PEInfo statmsg "Can't reset $tt text: $result!"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose the type of text to color!"
+ }
+ }
+ }
+ }
+ }
+ var {
+ wpGetVarAs $varname formval
+ set varvals [WPCmd PEConfig varget $varname]
+ set vals [lindex $varvals 0]
+ set vartype [lindex $varvals 1]
+ set formvals [split $formval "\n"]
+ set varchanged 0
+
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname $varname
+ }
+
+ if {[string compare $vartype textarea] == 0} {
+ wpGetVarAs vla.$varname.x vlavar
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs $varname-add valadd
+ if {[string length $vlavar]} {
+ set fr_tconfig_vlavar $varname
+ }
+ set formvals {}
+ if {[string length $valadd]} {
+ lappend formvals $valadd
+ }
+ if {[string length $sz]} {
+ set prevwassd 0
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i fval
+ wpGetVarAs vld.$varname.$i.x fvaldel
+ wpGetVarAs vlsu.$varname.$i.x fvalsu
+ wpGetVarAs vlsd.$varname.$i.x fvalsd
+ set fed 0
+ set fdel 0
+ set fsu 0
+ set fsd 0
+ if {[string length $fval]} {
+ set fed 1
+ }
+ if {[string length $fvaldel]} {
+ set fdel 1
+ } elseif {[string length $fvalsu]} {
+ set fsu 1
+ } elseif {[string length $fvalsd]} {
+ set fsd 1
+ }
+ if {$fed && $fdel == 0 && $prevwassd} {
+ set prevwassd 0
+ set formvals [linsert $formvals [expr {[llength $formvals] - 1}] $fval]
+ } elseif {$fed && $fdel == 0 && $fsu == 0} {
+ lappend formvals $fval
+ if {$fsd} {
+ set prevwassd 1
+ }
+ } elseif {$fed && $fdel == 0 && $fsu} {
+ set fvallen [llength $formvals]
+ if {$fvallen} {
+ set formvals [linsert $formvals [expr {$fvallen - 2}] $fval]
+ } else {
+ lappend formvals $fval
+ }
+ }
+ }
+ }
+ set len [llength $formvals]
+ if {$len != [llength $vals]} {
+ set varchanged 1
+ } else {
+ for {set i 0} {$i < $len} {incr i} {
+ if {[string compare [lindex $formvals $i] [lindex $vals $i]]} {
+ set varchanged 1
+ break
+ }
+ }
+ }
+ } elseif {[llength $formvals] != [llength $vals]} {
+ set varchanged 1
+ } else {
+ set valslength [llength $vals]
+ for {set i 0} {$i < $valslength} {incr i} {
+ if {[string compare [lindex $vals $i] [lindex $formvals $i]]} {
+ set varchanged 1
+ break
+ }
+ }
+ }
+ if {$varchanged} {
+ WPCmd PEConfig varset $varname $formvals
+ }
+ # what about wp-indexheight?
+ }
+ feat {
+ wpGetVarAs $varname tval
+ if {$hlpthisvar} {
+ set subop feathelp
+ set feathelpname $varname
+ }
+ set featset [expr {[lsearch $setfeatures $varname] >= 0}]
+ set formfeatset [expr {[string compare $tval on] == 0}]
+ if {$formfeatset != $featset} {
+ WPCmd PEConfig feature $varname $formfeatset
+ }
+ }
+ }
+ }
+ if {[info exists subop]} {
+ switch -- $subop {
+ varhelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass]
+ set topic $varhelpname
+ set _cgi_uservar(topic) $varhelpname
+ set topicclass variable
+ set _cgi_uservar(topicclass) variable
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ feathelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass oncancel]
+ set topic $feathelpname
+ set _cgi_uservar(topic) $feathelpname
+ set topicclass feature
+ set _cgi_uservar(topicclass) feature
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ secthelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass oncancel]
+ set topic $feathelpname
+ set _cgi_uservar(topic) $feathelpname
+ set topicclass $topicclass
+ set _cgi_uservar(topicclass) $topicclass
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ save {
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _close "Invalid Operation ID"]
+ }
+ WPCmd PEConfig saveconf
+ set script $oncancel
+ catch {WPCmd PEInfo unset config_deftext}
+ }
+ }
+ }
+ }
+ filtconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+
+ set patlist [wpGetRulePattern]
+ set actlist [wpGetRuleAction 0]
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+
+ set help_vars [list topic]
+ set topic filtedit
+ set _cgi_uservar(topic) filtedit
+
+ if {[string compare $subop "edit"] == 0} {
+ set fakeimg "vle.filters.$fno"
+ set fakesz [expr {$fno + 1}]
+ } else {
+ set fakeimg "vla.filters"
+ set fakesz 1
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&filters-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load all the actions
+ foreach act [wpGetRuleAction 0] {
+ set [lindex $act 0] [lindex $act 1]
+ }
+
+ # load other variables
+ wpGetVarAs nickname nickname
+ wpGetVarAs comment comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load all the actions
+ foreach act [wpGetRuleAction 0] {
+ set [lindex $act 0] [lindex $act 1]
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set patlist [wpGetRulePattern]
+ set actlist [wpGetRuleAction 1]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ set ret [catch {WPCmd PEConfig ruleset filter $subop $fno $patlist $actlist} res]
+ if {$ret} {
+ error [list _action "Filter Set" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Filter setting failed: $res"
+
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ }
+ }
+ }
+ scoreconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ if {[string compare $subop "edit"] == 0 || [string compare $subop "add"] == 0} {
+ set patlist [wpGetRulePattern]
+
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+ }
+ set help_vars [list topic]
+ set topic scoreedit
+ set _cgi_uservar(topic) scoreedit
+ switch -- $subop {
+ edit {
+ set fakeimg "vle.scores.$fno"
+ set fakesz [expr {$fno + 1}]
+ }
+ add {
+ set fakeimg "vla.scores"
+ set fakesz 1
+ }
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&scores-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ switch -- $subop {
+ edit -
+ add {
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set patlist [wpGetRulePattern]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ wpGetVar scoreval
+ lappend actlist [list "scoreval" $scoreval]
+
+ wpGetVar scorehdr
+ lappend actlist [list "scorehdr" $scorehdr]
+
+ set ret [catch {WPCmd PEConfig ruleset score $subop $fno $patlist $actlist} res]
+
+ if {$ret} {
+ error [list _action "Score Set" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Score setting failed: $res"
+
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ }
+ }
+ }
+ }
+ }
+ indexcolorconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ if {[string compare $subop "edit"] == 0 || [string compare $subop "add"] == 0} {
+ set patlist [wpGetRulePattern]
+
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+ }
+ set help_vars [list topic]
+ set topic indexcoloredit
+ set _cgi_uservar(topic) indexcoloredit
+ switch -- $subop {
+ edit {
+ set fakeimg "vle.indexcolor.$fno"
+ set fakesz [expr {$fno + 1}]
+ }
+ add {
+ set fakeimg "vla.indexcolor"
+ set fakesz 1
+ }
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&indexcolor-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {cgi_import_as colormap.x colx}] == 0
+ && [catch {cgi_import_as colormap.y coly}] == 0} {
+ set rgbs {"000" "051" "102" "153" "204" "255"}
+ set xrgbs {"00" "33" "66" "99" "CC" "FF"}
+ set rgblen [llength $rgbs]
+ set imappixwidth 10
+
+ set colx [expr {${colx} / $imappixwidth}]
+ set coly [expr {${coly} / $imappixwidth}]
+ if {($coly >= 0 && $coly < $rgblen)
+ && ($colx >= 0 && $colx < [expr {$rgblen * $rgblen}])} {
+ set ired $coly
+ set igreen [expr {($colx / $rgblen) % $rgblen}]
+ set iblue [expr {$colx % $rgblen}]
+ set rgb "[lindex $rgbs $ired],[lindex $rgbs ${igreen}],[lindex $rgbs ${iblue}]"
+ set xrgb "[lindex $xrgbs $ired][lindex $xrgbs ${igreen}][lindex $xrgbs ${iblue}]"
+
+ if {[catch {wpGetVar fgorbg [list fg bg]}]} {
+ WPCmd PEInfo statmsg "Invalid fore/back ground input!"
+ catch {unset xrgb}
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid RGB Input!"
+ }
+
+ # relay any other config changes
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ }
+
+ # import previous settings
+ wpGetVarAs fg fg
+ wpGetVarAs bg bg
+
+ # set new value
+ if {[info exists xrgb]} {
+ set $fgorbg $xrgb
+ }
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ switch -- $subop {
+ edit -
+ add {
+
+ wpGetVar nickname
+ wpGetVar comment
+
+ set patlist [wpGetRulePattern]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ # save config?
+ set actlist {}
+ if {[catch {wpGetVar fg}] == 0 && [catch {wpGetVar bg}] == 0} {
+ lappend actlist [list fg $fg]
+ lappend actlist [list bg $bg]
+
+ # save rule
+ set ret [catch {WPCmd PEConfig ruleset indexcolor $subop $fno $patlist $actlist} res]
+ if {$ret} {
+ error [list _action "Color Set Error" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Index Color setting failed: $res"
+
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ } else {
+ error [list _action "Unset FG/BG" "Internal Error: Unset Color Variables"]
+ }
+ }
+ }
+ }
+ }
+ }
+ clconfig {
+ wpGetVar cl
+ wpGetVar nick
+ wpGetVar server
+ wpGetVar user
+ wpGetVar stype
+ wpGetVar path
+ wpGetVar view
+ wpGetVar add
+ wpGetVarAs cle_cancel.x cle_cancel
+ wpGetVarAs cle_save.x cle_save
+
+ set cledit_add $add
+ set cledit_cl $cl
+ set cledit_onclecancel conf_process
+ if {[string length $cle_save]} {
+ if {[catch {cgi_import_as "ssl" sslval}]} {
+ set ssl 0
+ } else {
+ if {[string compare $sslval on] == 0} {
+ set ssl 1
+ } else {
+ set ssl 0
+ }
+ }
+ regexp "\{?(\[^\}\]*)\}?(.*)" $server match serverb serverrem
+ if {[string length $serverb]} {
+ if {$ssl == 1} {
+ set serverb "$serverb/ssl"
+ }
+ if {[string compare "" "$user"]} {
+ set serverb "$serverb/user=$user"
+ }
+ if {[string compare "imap" [string tolower $stype]]} {
+ set serverb "$serverb/[string tolower $stype]"
+ }
+ if {[string compare "nntp" [string tolower $stype]] == 0} {
+ regsub -nocase {^(#news\.)?(.*)$} "$path" "#news.\\2" path
+ if {[string compare "" $path] == 0} {
+ set path "#news."
+ }
+ }
+ set result ""
+ set ret 0
+ set servera "\{$serverb\}$serverrem"
+ if {$add} {
+ set ret [catch {WPCmd PEConfig cladd $cl $nick $servera $path $view} result]
+ } else {
+ set ret [catch {WPCmd PEConfig cledit $cl $nick $servera $path $view} result]
+ }
+ if {$ret != 0} {
+ error [list _action "Collection List Set" $result]
+ } elseif {[string compare "" $result]} {
+ if {$add} {
+ set clerrtext "Add failed: $result"
+ } else {
+ set clerrtext "Edit failed: $result"
+ }
+ WPCmd PEInfo statmsg $clerrtext
+ set script "fr_cledit.tcl"
+ }
+ } else {
+ set clerrtext "Bad data: Nothing defined for Server"
+ WPCmd PEInfo statmsg $clerrtext
+ set script "fr_cledit.tcl"
+ }
+ }
+ }
+ noop {
+ catch {WPCmd PEInfo noop}
+ }
+ cancel {
+ set script $oncancel
+ catch {WPCmd unset conf_page} res
+ }
+ default {
+ error [list _close "Unknown process operation: $op"]
+ }
+ }
+
+source [WPTFScript $script]
diff --git a/web/cgi/alpine/1.0/detach.tcl b/web/cgi/alpine/1.0/detach.tcl
new file mode 100755
index 00000000..d53ef313
--- /dev/null
+++ b/web/cgi/alpine/1.0/detach.tcl
@@ -0,0 +1,183 @@
+#!./tclsh
+# $Id: detach.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# detach.tcl
+#
+# Purpose: CGI script to retrieve requested attachment
+#
+# Input:
+set detach_vars {
+ {uid "Unknown Message UID"}
+ {part "Unknown Message Part"}
+ {download "" 0}
+}
+
+#set detach_via_ip_address 1
+#set detach_via_local_hostname 1
+
+# inherit global config
+source ./alpine.tcl
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+WPEval $detach_vars {
+ if {[info exists env(PATH_INFO)]} {
+ if {[string index $env(PATH_INFO) 0] == "/"} {
+ set s [string range $env(PATH_INFO) 1 end]
+ if {[set i [string first "/" $s]] >= 0} {
+ set uid [string range $s 0 [expr {$i - 1}]]
+ set s [string range $s [incr i] end]
+ if {[set i [string first "/" $s]] >= 0} {
+ set part [string range $s 0 [expr {$i - 1}]]
+ }
+ }
+ }
+ }
+
+ if {[info exists uid] == 0 || [info exists part] == 0} {
+ error [list _action "Unspecified attachment UID or Part" "Please close this window."]
+ }
+
+ # generate big random string to reference the thing
+
+ # generate filenames to hold detached data and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-control]
+ set dfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]} {
+ error [list _action Detach "Cannot create control file: [cgi_quote_html $cfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-control | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ if {[catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ catch {close $cfd}
+ error [list _action Detach "Cannot create command file: [cgi_quote_html $dfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-data | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ # exec chmod [cgi_tmpfile_permissions] $cfile
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+ break
+ } elseif {$n > 4} {
+ error [list _action Detach "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ if {[catch {WPCmd PEMessage $uid detach $part $dfile} attachdata]} {
+ error [list _action Detach $attachdata "Please close this window"]
+ }
+
+ if {[info exists detach_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } elseif {[info exists detach_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set mimetype [lindex $attachdata 0]
+ set mimesubtype [lindex $attachdata 1]
+ set contentlength [lindex $attachdata 2]
+ set givenname [lindex [lindex $attachdata 3] 0]
+ set tmpfile [lindex $attachdata 4]
+
+ if {[string compare $tmpfile $dfile]} {
+ set straytmp "&straytmp=1"
+ } else {
+ set straytmp ""
+ }
+
+ if {![string length $givenname]} {
+ set givenname "attachment"
+ switch -regexp $mimetype {
+ ^[Tt][Ee][Xx][Tt]$ {
+ switch -regexp $mimesubtype {
+ ^[Pp][Ll][Aa][Ii][Nn]$ {
+ set givenname "attached.txt"
+ }
+ ^[Hh][Tt][Mm][Ll]$ {
+ set givenname "attached.html"
+ }
+ }
+ }
+ }
+ }
+
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/[WPPercentQuote $safegivenname {.}]"
+
+ if {$download == 1} {
+ puts $cfd "Content-type: Application/X-Download"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+ } else {
+ puts $cfd "Content-type: ${mimetype}/${mimesubtype}"
+ }
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $contentlength"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd ""
+
+ puts $cfd $tmpfile
+
+ # exec chmod [cgi_tmpfile_permissions] $tmpfile
+
+ close $cfd
+
+ # prepare to clean up if the brower never redirects
+
+ cgi_http_head {
+ # redirect to the place we stuffed the detach info. use the ip address
+ # to foil spilling any session cookies or the like
+ #cgi_redirect ${redirect}${safegivenname}?h=${rhandle}
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ cgi_puts "Location: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_help.tcl b/web/cgi/alpine/1.0/do_help.tcl
new file mode 100644
index 00000000..400b3af2
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_help.tcl
@@ -0,0 +1,48 @@
+# $Id: do_help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ if {![string length $topic]} {
+ if {[catch {WPCmd PEInfo set help_context} s] == 0} {
+ set topic $s
+ catch {WPCmd PEInfo unset help_context}
+ }
+ }
+
+ cgi_head {
+ cgi_title "Alpine Help"
+ }
+
+ cgi_frameset "cols=112,*" frameborder=0 framespacing=0 border=0 {
+ set parms ""
+
+ foreach v $help_vars {
+ set val [subst $[lindex $v 0]]
+ if {[string length $val]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=$val"
+ }
+ }
+
+ cgi_frame bodindx=helpindex.tcl$parms title="Help Navigation"
+ cgi_frame bodtext=helpbody.tcl$parms title="Help Text"
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_open.tcl b/web/cgi/alpine/1.0/do_open.tcl
new file mode 100755
index 00000000..22599a97
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_open.tcl
@@ -0,0 +1,126 @@
+# $Id: do_open.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action open "Invalid Operation ID" "Click Back button to try again."]
+}
+
+if {[catch {WPLoadCGIVar cancel}] == 0 && [string compare Cancel $cancel] == 0} {
+ catch {WPCmd PEInfo statmsg "Authentication Cancelled"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=${oncancel}.tcl
+ }
+} else {
+
+ if {[catch {WPLoadCGIVar path}]} {
+ WPLoadCGIVar colid
+ WPLoadCGIVar folder
+ set path [list $colid $folder]
+ } else {
+ set colid [lindex $path 0]
+ set folder [lrange $path 1 end]
+ }
+
+ if {[info exists src] == 0 && [catch {eval WPCmd PEMailbox open $path} reason]} {
+ if {[string first ": no such folder" $reason] > 0} {
+ catch {WPCmd PEInfo statmsg "Folder [lrange $path 1 end] doesn't exist"}
+ set src $oncancel
+ } elseif {[string compare BADPASSWD [string range $reason 0 8]] == 0 || [string compare $reason "Login Error"] == 0} {
+ # control error messages
+ set statmsgs [WPCmd PEInfo statmsgs]
+ WPCmd PEMailbox newmailreset
+ if {[catch {WPCmd PESession creds $colid $folder} creds] == 0 && $creds != 0} {
+ catch {
+ WPCmd PEInfo statmsg "Invalid Username or Password"
+ WPCmd PESession nocred $colid $folder
+ }
+ }
+
+ if {[catch {WPCmd PEFolder clextended} coln]} {
+ WPCmd set reason "Can't get Collection Info: $coln"
+ } else {
+ set coln [lindex $coln $colid]
+ if {[regexp {^([a-zA-Z\.]+).*\/user=([^ /]*)} [lindex $coln 4] dummy srvname authuser]} {
+ WPCmd set reason "Opening folder [cgi_bold $folder] first requires that you log in o the server [cgi_bold "$srvname"]."
+ WPCmd set authuser $authuser
+ } elseif {[WPCmd PEFolder isincoming $colid]} {
+ WPCmd set reason "Incoming folder [cgi_bold $folder] requires you log into the the server."
+ } else {
+ WPCmd set reason "Opening [cgi_bold $folder] in [cgi_bold [lindex $coln 1]] requires you log into the the server."
+ }
+ }
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol $colid
+ WPCmd set authfolder $folder
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/open.tcl?folder=${folder}&colid=${colid}"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"]
+
+ set src [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryauth.tcl]
+
+ } else {
+ catch {WPCmd PEInfo statmsg "Cannot open $path: $reason"}
+ set src folders
+ }
+ } else {
+
+ # manage caching last folder opened
+ if {0 == [catch {WPCmd set wp_open_folder} last_folder]} {
+ WPTFAddFolderCache [lindex $last_folder 0] [lindex $last_folder 1]
+ }
+
+ catch {WPCmd set wp_open_folder [list $colid $folder]}
+
+ # start with the message indicated by the
+ # incoming-startup-rule' in the current index
+ set firstmsg 1
+ if {![catch {WPCmd PEMailbox firstinteresting} firstint] && $firstint > 0} {
+ set messagecount [WPCmd PEMailbox messagecount]
+ if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg == 0} {
+ set ppg $_wp(indexlines)
+ }
+
+ for {set i 1} {$i < $messagecount} {incr i $ppg} {
+ if {$i >= $firstint} {
+ break
+ }
+
+ set firstmsg $i
+ }
+
+ # show whole last page
+ if {$firstmsg + $ppg > $messagecount} {
+ if {[set n [expr {($messagecount + 1) - $ppg}]] > 0} {
+ set firstmsg $n
+ } else {
+ set firstmsg 1
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox uid $firstmsg} exp]} {
+ set exp 1
+ }
+
+ WPCmd set first $firstmsg
+ WPCmd set top $exp
+ WPCmd set uid $exp
+
+ WPCmd set width $_wp(width)
+ WPCmd set wp_spec_script fr_index.tcl
+ set src main.tcl
+ }
+}
+
+if {[info exists src]} {
+ source [WPTFScript $src]
+}
diff --git a/web/cgi/alpine/1.0/do_quit.tcl b/web/cgi/alpine/1.0/do_quit.tcl
new file mode 100755
index 00000000..0c013e4b
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_quit.tcl
@@ -0,0 +1,98 @@
+#!./tclsh
+# $Id: do_quit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryquit.tcl
+#
+# Purpose: CGI script to handle quit query, either redirecting
+# to session logout or returning to message listn
+#
+# Input:
+set quit_vars {
+ {cid "Command ID"}
+ {quit {} ""}
+ {expinbox {} 0}
+ {expcurrent {} 0}
+ {cancel {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $quit_vars {
+ if {$cid != [WPCmd PEInfo key]} {
+ error "Invalid Command ID"
+ }
+
+ switch -regexp -- $quit {
+ "^Yes, .*" {
+
+ set exps ""
+
+ if {[string compare $expinbox "on"] == 0} {
+ append exps "&expinbox=1"
+ }
+
+ if {[string compare $expcurrent "on"] == 0} {
+ append exps "&expcurrent=1"
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}${exps}"
+ }
+
+ cgi_body {
+ cgi_table height="20%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+
+ cgi_center {
+ cgi_table border=0 width=500 cellpadding=3 {
+ cgi_table_row {
+ cgi_table_data align=center rowspan=2 {
+ cgi_put [cgi_imglink logo]
+ }
+
+ cgi_table_data rowspan=2 {
+ put [nbspace]
+ put [nbspace]
+ }
+
+ cgi_table_data {
+ cgi_puts [cgi_font size=+2 face=Helvetica "Quitting Alpine ..."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ default {
+ source [WPTFScript main]
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_view.tcl b/web/cgi/alpine/1.0/do_view.tcl
new file mode 100755
index 00000000..fb8c5af6
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_view.tcl
@@ -0,0 +1,190 @@
+# $Id: do_view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# do_view.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+#
+# Input:
+set view_vars {
+ {uid {} 0}
+ {op {} ""}
+ {f_colid {} ""}
+ {f_name {} ""}
+ {savecancel {} ""}
+ {sid {} ""}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+}
+
+## read vars
+foreach item $view_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+WPCmd PEInfo set wp_spec_script fr_view.tcl
+
+proc statmsg {msg} {
+ catch {WPCmd PEInfo statmsg $msg}
+}
+
+if {$uid} {
+ # commit to servlet, view will retrieve it
+ WPCmd set uid $uid
+}
+
+set uidparm ""
+
+# If there's an "op" (meaning we got here from a comview.tcl
+# reference) trust "uid" is set within alpined's interpreter.
+if {[string length $op]} {
+# Set "op" only after we've concluded the folder's ready
+# for view.tcl to do the actual copy
+ if {[string compare save [string tolower $op]]} {
+ append uidparm "&op=$op"
+ }
+} else {
+ append uidparm "&uid=$uid"
+}
+
+if {[string length $savecancel]} {
+ append uidparm "&savecancel=$savecancel"
+}
+
+
+# handle doing the actual save mechanics here rather than
+# view.tcl since the result will have to be reflected
+# in comview.tcl's Save dropdown.
+if {[string compare save [string tolower $op]] == 0} {
+ if {[string length $savecancel] == 0} {
+ if {[string length [set folder [string trim $f_name]]]} {
+ switch -exact -- $folder {
+ __folder__prompt__ {
+ set uid 0
+ _cgi_set_uservar onselect {fr_view op=save}
+ _cgi_set_uservar oncancel fr_view
+ _cgi_set_uservar target spec
+ _cgi_set_uservar controls 0
+ source [WPTFScript savecreate]
+ set nopage 1
+ }
+ __folder__list__ {
+ set uid 0
+ _cgi_set_uservar onselect {fr_view op=save}
+ _cgi_set_uservar oncancel fr_view
+ _cgi_set_uservar target spec
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+ }
+ default {
+ if {$uid > 0} {
+ if {$auths} {
+ catch {WPCmd PESession nocred $f_colid $folder}
+ if {[catch {WPCmd PESession creds $f_colid $folder $user $pass} result]} {
+ statmsg "Cannot set credentials ($f_colid) $folder: result"
+ }
+ }
+
+ if {[catch {WPCmd PEFolder exists $f_colid $folder} reason]} {
+ if {[string compare BADPASSWD [string range $reason 0 8]] == 0} {
+ set oncancel "view.tcl&uid=$uid&savecancel=1"
+ set conftext "Create Folder '$folder'?"
+ lappend params [list page fr_view]
+ lappend params [list uid $uid]
+ lappend params [list op save]
+ lappend params [list f_name $folder]
+ lappend params [list f_colid $f_colid]
+ source [WPTFScript auth]
+ set nopage 1
+ } else {
+ statmsg "Existance test failed: $reason"
+ }
+ } elseif {$reason == 0} {
+ if {$create == 1 || [string compare create [string tolower $create]] == 0} {
+ if {[catch {WPCmd PEFolder create $f_colid $folder} reason]} {
+ statmsg "Create failed: $reason"
+ } else {
+ set dosave 1
+ }
+ } else {
+ #set oncancel "view&uid=$uid&savecancel=1"
+ set qstate [list $folder]
+ set params [list [list page fr_view]]
+ lappend params [list uid $uid]
+ lappend params [list sid [clock seconds]]
+ lappend params [list op save]
+ lappend params [list f_name $folder]
+ lappend params [list f_colid $f_colid]
+ lappend qstate $params
+
+ if {[catch {WPCmd PEInfo set querycreate_state $qstate}] == 0} {
+ source [WPTFScript querycreate]
+ set nopage 1
+ } else {
+ statmsg "Error saving creation state"
+ }
+ }
+ } else {
+ set dosave 1
+ }
+
+ if {[info exists dosave]} {
+ append uidparm "&op=save"
+ }
+ } else {
+ statmsg "Cannot Save unknown message ID"
+ }
+ }
+ }
+ } else {
+ statmsg "Cannot Save to emtpy folder name"
+ }
+ }
+}
+
+
+if {![info exists nopage]} {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=38,*" border=0 frameborder=0 framespacing=0 {
+
+ if {[string length $f_colid] && [string length $f_name]} {
+ set parms "&f_colid=${f_colid}&f_name=[WPPercentQuote ${f_name}]"
+ if {[string length $sid]} {
+ append parms "&sid=$sid"
+ }
+ } else {
+ set parms ""
+ }
+
+ cgi_frame cmds=comview.tcl?c=[WPCmd PEInfo key]${parms} scrolling=no title="Message Commands"
+ cgi_frame body=wp.tcl?page=view${uidparm}${parms} title="Message Text"
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/docancel.tcl b/web/cgi/alpine/1.0/docancel.tcl
new file mode 100755
index 00000000..e3d0aab5
--- /dev/null
+++ b/web/cgi/alpine/1.0/docancel.tcl
@@ -0,0 +1,56 @@
+# $Id: docancel.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+#
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {postpost "" main}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+# clean up attachments
+WPCmd PEInfo statmsg "Message cancelled"
+catch {WPCmd PEInfo unset suspended_composition}
+
+source [WPTFScript $postpost]
diff --git a/web/cgi/alpine/1.0/dosend.tcl b/web/cgi/alpine/1.0/dosend.tcl
new file mode 100755
index 00000000..44130572
--- /dev/null
+++ b/web/cgi/alpine/1.0/dosend.tcl
@@ -0,0 +1,99 @@
+# $Id: dosend.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+#
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {postpost "" "main.tcl"}
+ {user "" ""}
+ {pass "" ""}
+ {server "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+if {[string length $user] && [string length $pass] && [string length $server]} {
+ set cclientname "\{$server\}"
+ catch {WPCmd PESession nocred 0 $cclientname}
+ if {[catch {WPCmd PESession creds 0 $cclientname $user $pass} result]} {
+ WPCmd PEInfo statmsg "Cannot set credentials for $server"
+ }
+}
+
+if {[catch {WPCmd PEInfo set suspended_composition} msgdata] == 0} {
+ if {[catch {WPCmd PECompose post $msgdata} errstr]} {
+ if {[string compare BADPASSWD [string range $errstr 0 8]] == 0
+ && [catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ set oncancel "page=compose&restore=1&cid=$cid"
+ set conftext "Send Messsage?"
+ set reason "The server used to send this message requires authentication.[cgi_nl][cgi_nl]Enter Username and Password to connect to $server"
+ _cgi_set_uservar params [WPPercentQuote [list [list server $server] [list page dosend] [list postpost $postpost]]]
+ set src auth
+ } else {
+ # regurgitate the compose window
+ _cgi_set_uservar style ""
+ #set style ""
+ set title "Send Error: [cgi_font class=notice "$errstr"]"
+ if {[string length $errstr]} {
+ set notice "Send FAILED: $errstr"
+ } else {
+ set notice "Send FAILED: [WPCmd PEInfo statmsg]"
+ }
+ WPCmd PEInfo statmsg "$notice"
+
+ if {[info exists attachments]} {
+ set a [split $attachments ","]
+ unset attachments
+ foreach id $a {
+ # id file size type/subtype
+ if {[catch {WPCmd PECompose attachinfo $id} result]} {
+ WPCmd PEInfo statmsg $result
+ } else {
+ lappend attachments [list $id [lindex $result 0] [lindex $result 1] [lindex $result 2]]
+ }
+ }
+ }
+
+ set src compose
+ }
+ } else {
+ catch {WPCmd PEInfo unset suspended_composition}
+ WPCmd PEInfo statmsg "Message Sent!"
+ set src $postpost
+ }
+} else {
+ WPCmd PEInfo statmsg "Internal Error: $msgdata"
+ set src $postpost
+}
+
+source [WPTFScript $src]
diff --git a/web/cgi/alpine/1.0/export.tcl b/web/cgi/alpine/1.0/export.tcl
new file mode 100755
index 00000000..338e928c
--- /dev/null
+++ b/web/cgi/alpine/1.0/export.tcl
@@ -0,0 +1,165 @@
+#!./tclsh
+# $Id: export.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# export.tcl
+#
+# Purpose: CGI script to download exported folder
+#
+# Input:
+set export_vars {
+ {cid "Unknown Command ID"}
+ {fid "Unknown Collection ID"}
+}
+
+#set export_via_ip_address 1
+#set export_via_local_hostname 1
+
+# inherit global config
+source ./alpine.tcl
+
+set mailextension ".mbx"
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+
+WPEval $export_vars {
+ # generate filenames to hold exported folder and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(detachpath) detach.${rhandle}.control]
+ set dfile [file join $_wp(detachpath) detach.${rhandle}.data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]
+ || [catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ if {[info exists dfd]} {
+ catch {close $cfd}
+ catch {file delete -force $cfile}
+ set errstr $dfd
+ } else {
+ set errstr $cfd
+ }
+
+ error [list _action Export "Cannot create command/control files: [cgi_quote_html $errstr]" "Please close this window"]
+ } else {
+ close $dfd
+ break
+ }
+ } elseif {$n > 4} {
+ error [list _action Export "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ set colid [lindex $fid 0]
+ set fldr [eval "file join [lrange $fid 1 end]"]
+
+ catch {file delete $dfile}
+
+ if {[catch {WPCmd PEFolder export $colid $fldr $dfile} result]} {
+ WPCmd PEInfo statmsg $result
+ } else {
+ if {[set dfilesize [file size $dfile]] > 0
+ && ([info exists _wp(uplim_bytes)] && $_wp(uplim_bytes) > 0)
+ && $dfilesize > $_wp(uplim_bytes)} {
+ if {$_wp(uplim_bytes) > (1000000)} {
+ set dfs [format {%s.%.2s MB} [WPcomma [expr {$dfilesize / 1000000}]] [expr {$dfilesize % 1000000}]]
+ set esl [format {%s.%.2s MB} [WPcomma [expr {$_wp(uplim_bytes) / 1000000}]] [expr {$_wp(uplim_bytes) % 1000000}]]
+ } else {
+ set dfs "[WPcomma $dfs] KB"
+ set esl "[WPcomma $_wp(uplim_bytes)] KB"
+ }
+
+ WPCmd PEInfo statmsg "Exported folder size ($dfs) exceeds the maximum ($esl) size that can be imported. If you wish to import this folder back into Web Alpine at a later time, you should break it up into smaller folders"
+ }
+
+ if {[info exists export_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } elseif {[info exists export_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set givenname "[file tail $fldr]${mailextension}"
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/$safegivenname"
+
+ puts $cfd "Content-type: Application/X-Mail-Folder"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $dfilesize"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd "Refresh: 0; URL=\"$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders\""
+ puts $cfd ""
+
+ puts $cfd $dfile
+
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+
+ close $cfd
+
+ exec /bin/chmod [cgi_tmpfile_permissions] $cfile
+ exec /bin/chmod [cgi_tmpfile_permissions] $dfile
+ }
+
+ # prepare to clean up if the brower never redirects
+ if {[info exists redirect]} {
+ set redirect "${redirect}${safegivenname}?h=${rhandle}"
+ } else {
+ set redirect "wp.tcl?page=folders&cid=$cid"
+ }
+
+ cgi_http_head {
+ # redirect to the place we stuffed the export info. use the ip address
+ # to foil spilling any session cookies or the like
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: $redirect"
+ cgi_puts "Location: $redirect"
+ }
+
+ exec echo $rhandle | [file join $_wp(cgipath) [WPCmd PEInfo set wp_ver_dir] whackatch.tcl] >& /dev/null &
+}
diff --git a/web/cgi/alpine/1.0/exporting.tcl b/web/cgi/alpine/1.0/exporting.tcl
new file mode 100644
index 00000000..b1242843
--- /dev/null
+++ b/web/cgi/alpine/1.0/exporting.tcl
@@ -0,0 +1,187 @@
+# $Id: exporting.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# exporting.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# exporting explanation text
+#
+# Input:
+set export_vars {
+ {fid "Missing Collection ID"}
+ {cid "Missing Command ID"}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# Command Menu definition for Message View Screen
+set export_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Cancel * * * *
+ cgi_put [cgi_url "Folder List" wp.tcl?page=folders&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $export_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} key]} {
+ error [list _action "command ID" $key]
+}
+
+# massage fid, strip leading "f_"
+set fid [string range [lindex $fid 0] 2 end]
+set digfid [cgi_unquote_input $fid]
+set colid [lindex $digfid 0]
+if {[set l [llength $digfid]] > 2} {
+ set fpath [eval "file join [lrange $digfid 1 [expr {[llength $digfid] - 1}]]"]
+} else {
+ set fpath ""
+}
+set fldr [lindex $digfid end]
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Exporting"
+ WPStyleSheets
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/export.tcl?fid=${fid}&cid=$cid"
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ WPTFTitle "Folder Export"
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+
+ cgi_table_row {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=margin-top:4;margin-bottom:4" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu export_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" valign=top class=dialog {
+
+ cgi_division "style=\"margin-left: 12%; margin-right: 12%\"" {
+
+ cgi_division align=center "style=\"padding: 18; font-size: bigger \"" {
+ cgi_puts "Export Folder"
+ }
+
+ cgi_puts "WebPine is preparing the folder [cgi_bold $fldr] for download. "
+ cgi_puts "You should see your browser's File Open Dialog appear any momment."
+
+ cgi_p
+
+ cgi_puts "The exported file will contain all of the messages in the folder separated "
+ cgi_puts "by a traditional mail message delimiter, and should be recognizable by "
+ cgi_puts "a variety of desktop mail programs."
+
+ cgi_p
+
+ cgi_puts "Be sure to pick a good name for the downloaded mail folder."
+ cgi_puts "If you are sure the folder has been exported properly (that is, "
+ cgi_puts "there were no error messages or other such problems, you can "
+ if {[string compare inbox [string tolower $mbox]]} {
+ cgi_puts "delete the folder from the collection."
+ } else {
+ cgi_puts "delete and expunge the messages from your INBOX."
+ }
+
+ cgi_p
+
+ cgi_puts "WebPine's [cgi_span "style=font-weight: bold; font-style: italic" Import] command, found to the right of each collection and "
+ cgi_puts "directory entry in the folder list, can be used to transfer the exported "
+ cgi_puts "mail folder from your computer back into a folder collection "
+ cgi_puts "suitable for viewing within WebPine "
+
+ cgi_p
+
+ cgi_puts "If your browser does not automatically return to the Folder List page after the download is complete, click the button below."
+
+ cgi_p
+
+ cgi_division align=center {
+ cgi_form $_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl method=get {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_submit_button "done=Return to Folder List"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/filtedit.tcl b/web/cgi/alpine/1.0/filtedit.tcl
new file mode 100755
index 00000000..34b9bd0f
--- /dev/null
+++ b/web/cgi/alpine/1.0/filtedit.tcl
@@ -0,0 +1,704 @@
+#!./tclsh
+# $Id: filtedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# filtedit.tcl
+#
+# Purpose: CGI script to generate html form editing of a single filter
+
+#
+# include common filter info
+source filter.tcl
+
+#
+# Input:
+set filtedit_vars {
+ {cid "No cid"}
+ {oncancel "No oncancel"}
+ {onfiltcancel {} ""}
+ {fno {} -1}
+ {add {} 0}
+ {filterrtext {} ""}
+ {filtedit_score {} 0}
+ {filtedit_indexcolor {} 0}
+ {fg {} ""}
+ {bg {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $filtedit_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$filtedit_score} {
+ set filttype score
+ set filttypename Score
+} elseif {$filtedit_indexcolor} {
+ set filttype indexcolor
+ set filttypename "Index Color"
+} else {
+ set filttype filt
+ set filttypename Filter
+}
+
+if {[info exists filtedit_add]} {
+ set add $filtedit_add
+}
+
+if {[info exists filtedit_fno]} {
+ set fno $filtedit_fno
+}
+
+if {[info exists filtedit_onfiltcancel]} {
+ set onfiltcancel $filtedit_onfiltcancel
+}
+
+if {[info exists filtedit_filterrtext]} {
+ set filterrtext $filtedit_filterrtext
+}
+
+set filterr 0
+if {[string length $filterrtext]} {
+ set filterr 1
+}
+
+set filtedit_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ #cgi_image_button filt_save=[WPimg but_save] border=0 alt="Save Config"
+ cgi_submit_button "${filttype}_save=Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button filtcancel=Cancel
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_submit_button "${filttype}help=Get Help"
+ }
+ }
+ }
+}
+
+
+proc wpGetVarAs {_var _varas} {
+ upvar $_varas varas
+
+ if {[catch {cgi_import_as $_var varas} result]} {
+ set varas ""
+ }
+}
+
+proc freetext_cell {intro varname varval} {
+ cgi_table_data align=right {
+ cgi_puts [cgi_bold "$intro :[cgi_nbspace][cgi_nbspace]"]
+ }
+ cgi_table_data align=left {
+ cgi_text "$varname=$varval" "style=margin:2"
+ }
+}
+
+
+array set idvarnames $pattern_id
+array set idvarvals {}
+array set patvarnames $pattern_fields
+array set patvarvals {}
+array set actionvarnames $pattern_actions
+array set colvarnames $pattern_colors
+array set scorevarnames $pattern_scores
+
+array set actionvals {}
+
+cgi_http_head {
+ cgi_content_type
+ cgi_pragma no-cache
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "$filttypename List Configuration"
+ WPStyleSheets
+ }
+
+ if {$add == 0} {
+ if {$filtedit_score} {
+ set actions $pattern_scores
+ set fext [WPCmd PEConfig scoreextended $fno]
+ } elseif {$filtedit_indexcolor} {
+ set actions $pattern_colors
+ set fext [WPCmd PEConfig indexcolorextended $fno]
+ } else {
+ set actions $pattern_actions
+ set fext [WPCmd PEConfig filtextended $fno]
+ }
+
+ foreach fvar $fext {
+ switch -- [lindex $fvar 0] {
+ id {
+ foreach idvar [lindex $fvar 1] {
+ set idname [lindex $idvar 0]
+ if {[info exists idvarnames($idname)]} {
+ set idvarvals($idname) [lindex $idvar 1]
+ }
+ }
+ }
+ pattern {
+ foreach patternvar [lindex $fvar 1] {
+ set patname [lindex $patternvar 0]
+ if {[info exists patvarnames($patname)]} {
+ set patvarvals($patname) [lindex $patternvar 1]
+ }
+ }
+ }
+ filtaction {
+ foreach actionvar [lindex $fvar 1] {
+ set actionname [lindex $actionvar 0]
+ if {[info exists actionvarnames($actionname)]} {
+ set actionvals($actionname) [lindex $actionvar 1]
+ }
+ }
+ }
+ indexcolors {
+ foreach colvar [lindex $fvar 1] {
+ set colname [lindex $colvar 0]
+ if {[info exists colvarnames($colname)]} {
+ set actionvals($colname) [lindex $colvar 1]
+ }
+ }
+ }
+ scores {
+ foreach colvar [lindex $fvar 1] {
+ set actionvals([lindex $colvar 0]) [lindex $colvar 1]
+ }
+ }
+ }
+ }
+ } else {
+ if {$filtedit_score} {
+ set actions $pattern_scores
+ } elseif {$filtedit_indexcolor} {
+ set actions $pattern_colors
+ } else {
+ set actions $pattern_actions
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=filtconfig target=_top {
+ cgi_text "page=conf_process" type=hidden notab
+ cgi_text "cp_op=${filttype}config" type=hidden notab
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu filtedit_menu {}
+ }
+ }
+
+ #
+ # In main body of screen goes confg list
+ #
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {[string length $onfiltcancel]} {
+ cgi_text "onfiltcancel=$onfiltcancel" type=hidden notab
+ }
+ cgi_text "fno=$fno" type=hidden notab
+ cgi_text "subop=[expr {$add ? "add" : "edit"}]" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=0 {
+ # pattern title
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts ""
+ }
+ }
+
+ # Folder Conditions
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_puts ""
+ }
+ }
+
+ # Message Conditions
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts ""
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data "style=\"padding-bottom: 40\"" {
+ cgi_puts ""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/filter.tcl b/web/cgi/alpine/1.0/filter.tcl
new file mode 100755
index 00000000..2974f6ca
--- /dev/null
+++ b/web/cgi/alpine/1.0/filter.tcl
@@ -0,0 +1,63 @@
+# $Id: filter.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# filter.tcl
+#
+# Purpose: Common filter management data/routines
+
+set pattern_id {
+ nickname {"Nickname" freetext}
+ comment {"Comment" freetext}
+}
+
+set pattern_fields {
+ to {"To" freetext}
+ from {"From" freetext}
+ sender {"Sender" freetext}
+ cc {"Cc" freetext}
+ recip {"Recipients" freetext}
+ partic {"Participants" freetext}
+ news {"Newsgroups" freetext}
+ subj {"Subject" freetext}
+ alltext {"All Text" freetext}
+ bodytext {"Body Text" freetext}
+ age {"Age Interval" freetext}
+ size {"Size Interval" freetext}
+ score {"Score Interval" freetext}
+ keyword {"Keyword" freetext}
+ charset {"Character Set" freetext}
+ headers {"Extra Headers" headers}
+ stat_new {"Message is New" status}
+ stat_rec {"Message is Recent" status}
+ stat_del {"Message is Deleted" status}
+ stat_imp {"Message is Important" status}
+ stat_ans {"Message is Answered" status}
+ stat_8bitsubj {"Subject contains raw 8bit characters" status}
+ stat_bom {"Beginning of Month" status}
+ stat_boy {"Beginning of Year" status}
+ addrbook {"Address in address book" addrbook}
+}
+
+
+set pattern_actions {
+ kill {"kill"}
+ folder {"Folder"}
+ move_only_if_not_deleted {"moind"}
+}
+
+set pattern_colors {
+ indexcolor {indexcolor}
+}
+
+set pattern_scores {
+ scores {scores}
+}
diff --git a/web/cgi/alpine/1.0/flags.tcl b/web/cgi/alpine/1.0/flags.tcl
new file mode 100755
index 00000000..7cc83962
--- /dev/null
+++ b/web/cgi/alpine/1.0/flags.tcl
@@ -0,0 +1,112 @@
+#!./tclsh
+# $Id: flags.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryexpunge.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# deleted message expunge
+#
+# Input:
+set flag_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $flag_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Set Flags"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "sessid=$sessid" type=hidden notab
+ cgi_text "uid=$uid" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl]
+ cgi_puts "Status flags are attributes you can assign to messages that help you associate certain meanings (for example, [cgi_bold Important]) or indicate to Web Alpine"
+ cgi_puts "how you would like to operate on the message (for example, the [cgi_bold Deleted] flag tells WebPine to permanently remove the"
+ cgi_puts "message from the folder when you [cgi_bold Expunge])."
+ cgi_puts [cgi_nl][cgi_nl]
+ cgi_puts "Set or unset desired flags for message [WPCmd PEMessage $uid number] below then"
+ cgi_puts "click [cgi_italic "Set Flags"], or [cgi_italic Cancel] to return to the list of messages"
+ cgi_puts "in [WPCmd PEMailbox mailboxname]."
+ cgi_br
+ cgi_br
+
+ set flaglist [WPCmd PEInfo flaglist]
+ set setflags [WPCmd PEMessage $uid status]
+
+ cgi_table class=dialog {
+ foreach item $flaglist {
+ cgi_table_row {
+ cgi_table_data valign=top align=right width="30%" {
+ if {[lsearch $setflags $item] >= 0} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_checkbox $item style="background-color:$_wp(dialogcolor)" $checked
+ }
+
+ cgi_table_data valign=top align=left {
+ switch -- $item {
+ New { set text "New" }
+ Answered { set text "Answered" }
+ Deleted { set text "Deleted" }
+ default { set text $item }
+ }
+ cgi_puts $text
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data colspan=2 height=50 {
+ cgi_br
+ cgi_submit_button "op=Set Flags"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fldrbrowse.tcl b/web/cgi/alpine/1.0/fldrbrowse.tcl
new file mode 100755
index 00000000..b9021a4d
--- /dev/null
+++ b/web/cgi/alpine/1.0/fldrbrowse.tcl
@@ -0,0 +1,335 @@
+# $Id: fldrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# folders.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# and collection management
+#
+# Input:
+set folder_vars {
+ {uid {} 0}
+ {show {} ""}
+ {expand {} ""}
+ {contract {} ""}
+ {target {} ""}
+ {onselect {} "compose"}
+ {oncancel {} "index"}
+ {controls {} 1}
+ {reload}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# the name of this script
+set me [file tail [info script]]
+
+set indention 18
+
+proc pretty_folder_name {collections folder} {
+ set fcolid [lindex $folder 0]
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ if {$fcolid == [lindex $col 0]} {
+ set coltext [lindex $col 1]
+ }
+ }
+ return "${coltext}:[join [lrange $folder 1 end] /]"
+}
+
+
+set key [WPCmd PEInfo key]
+
+
+#
+# Display the given folder list in a table (w/ mihodge mods)
+#
+proc blat_folder_list {colid flist shown path baseurl scroll anchorcntref onselect depth} {
+
+ global key border indention _wp target
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ upvar $anchorcntref anchorcnt
+
+ set rownum 0
+
+ foreach folder $flist {
+ set t [lindex $folder 0]
+ set f [lindex $folder 1]
+ set ff [linsert $path [llength $path] $f]
+ set index -1
+
+ # initial pad=12, expand/contract control is 9px wide
+ set cellpad [expr {12 + ($depth * $indention)}]
+
+ if {[string first F $t] >= 0} {
+ set delim [WPCmd PEFolder delimiter $colid]
+ set fullpath [join [lrange $ff 1 end] $delim]
+ regsub -all {(')} [lrange $ff 1 end] {\\\\\1} ef
+ set celldata [cgi_url $f wp.tcl?page=[join ${onselect} {&}]&f_colid=${colid}&f_name=[WPPercentQuote [join $ef $delim]]&target=${target}&cid=$key target=${target}]
+ } else {
+ set celldata $f
+ }
+
+ if {[string first D $t] >= 0} {
+
+ if {[set index [lsearch $shown $ff]] < 0} {
+ set control expand
+ } else {
+ set control contract
+ }
+
+ set celldata "[cgi_url [cgi_imglink $control] "${baseurl}${control}=[WPPercentQuote $ff]#f_[WPPercentQuote $ff]" name=f_[WPPercentQuote $ff] "style=\"padding-right:10px\""]$celldata"
+ incr cellpad -19
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+
+ cgi_table_data align=left "style=\"padding-left: ${cellpad}px\"" nowrap {
+ cgi_put $celldata
+ }
+
+ cgi_table_data valign=top nowrap {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+
+ if {[string first D $t] >= 0 && $index >= 0} {
+ set nflist [eval WPCmd PEFolder list $ff]
+ set newpath $path
+ lappend newpath $f
+ blat_folder_list $colid $nflist $shown $newpath $baseurl $scroll anchorcnt $onselect [expr {$depth + 1}]
+ }
+
+ catch {unset control}
+ }
+}
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {expr {$controls == 1}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url Cancel wp.tcl?page=$oncancel&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {}
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collectoin list" $collections]
+}
+
+set shown [split $show ,]
+set scroll {}
+set anchorcnt 0
+
+# mihodge: process actions
+if {[llength $expand]} {
+ lappend shown $expand
+ set scroll $expand
+}
+
+if {[llength $contract]} {
+ if {[set index [lsearch $shown $contract]] >= 0} {
+ set shown [lreplace $shown $index $index]
+ set scroll $contract
+ }
+}
+
+set baseurl wp.tcl?page=fldrbrowse&onselect=[WPPercentQuote ${onselect}]&oncancel=${oncancel}&controls=${controls}&target=${target}&
+
+if {[llength $shown]} {
+ append baseurl "show=[WPPercentQuote [join $shown ,]]&"
+}
+
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder List" folders
+ if {$controls == 1} {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"
+ }
+
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+
+ catch {WPCmd PEInfo set help_context folders}
+
+ # prepare context and navigation information
+
+ set navops ""
+
+ if {$controls == 1} {
+ WPTFTitle "Browse Folder" $newmail
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ if {$controls > 0} {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=0 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" align=center valign=top class=dialog {
+
+ # then the table representing the folders
+ cgi_table width=75% border=0 cellspacing=0 cellpadding=2 align=center {
+
+ cgi_table_row {
+ cgi_table_data height=80 align=center valign=middle class=dialog {
+ switch $controls {
+ 0 -
+ 2 { set task "the Saved message" }
+ default { set task "your composition's [cgi_italic "File Carbon Copy"] (Fcc)" }
+ }
+
+ cgi_puts "Click a folder name below to use it as the destination for $task, or click [cgi_italic Cancel]"
+ cgi_puts "to return without choosing anything."
+ }
+ }
+
+ if {$controls != 1} {
+ cgi_table_row {
+ cgi_table_data align=center valign=top height=40 class=navbar {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=$target {
+ cgi_text page=$oncancel type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center {
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ cgi_table_row {
+ cgi_table_data width=18 valign=top {
+ if {[llength $collections] > 1} {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ cgi_puts [cgi_url [cgi_imglink expand] "${baseurl}expand=$colid"]
+ } else {
+ cgi_puts [cgi_url [cgi_imglink contract] "${baseurl}contract=$colid"]
+ }
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+
+ cgi_table_data align=left {
+ if {[llength $collections] == 1} {
+ set menu "c"
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set menu "ce"
+ set flist {}
+ } else {
+ set menu "cc"
+ set flist 1
+ }
+ }
+
+ if {[llength $flist]} {
+ set flist [WPCmd PEFolder list $colid]
+ }
+
+ if {$scroll == $colid} {
+ #cgi_javascript {cgi_puts {scroll = window.document.anchors.length;}}
+ }
+
+ cgi_puts [cgi_font face=Helvetica size=+1 "[lindex $col 1]"]
+
+ incr anchorcnt
+
+ if {[llength $flist]} {
+ blat_folder_list $colid $flist $shown $colid $baseurl $scroll anchorcnt $onselect 1
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fldrsavenew.tcl b/web/cgi/alpine/1.0/fldrsavenew.tcl
new file mode 100755
index 00000000..a2a5f457
--- /dev/null
+++ b/web/cgi/alpine/1.0/fldrsavenew.tcl
@@ -0,0 +1,202 @@
+# $Id: fldrsavenew.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fldrsavenew.tcl
+#
+# Purpose: CGI script to generate html output associated with message
+# Save to a new folder
+#
+# Input:
+set folder_vars {
+ {onselect "" "index"}
+ {oncancel "" "index"}
+ {target "" ""}
+ {controls "" 1}
+ {reload}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+set key [WPCmd PEInfo key]
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {expr {$controls == 1}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url Cancel wp.tcl?page=$oncancel&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {}
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Create for Save" folders
+ if {$controls == 1} {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=fldrsavenew"
+ }
+
+ WPStyleSheets
+ }
+
+ cgi_body onload=document.savepmt.f_name.focus() bgcolor=$_wp(bordercolor) {
+
+ catch {WPCmd PEInfo set help_context fldrsave}
+
+ # prepare context and navigation information
+
+ set navops ""
+
+ if {$controls == 1} {
+ WPTFTitle "Browse Folder" $newmail
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ if {$controls > 0} {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" align=center valign=top class=dialog {
+
+ if {[string length $target] == 0} {
+ set target _top
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=$target name=savepmt {
+ cgi_text page=[lindex $onselect 0] type=hidden notab
+ for {set i 1} {$i < [llength $onselect]} {incr i} {
+ set a [split [lindex $onselect $i] {=}]
+ cgi_text [lindex $a 0]=[lindex $a 1] type=hidden notab
+ }
+
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+
+ # then the table representing the folders
+ cgi_table width=75% border=0 cellspacing=0 cellpadding=2 align=center {
+
+ cgi_table_row {
+ cgi_table_data height=140 align=center valign=middle class=dialog {
+ cgi_p "Enter the name of the folder to save to below, and then click [cgi_italic OK]."
+ cgi_p "You may enter either the name of an existing folder, or the name of a new folder name to have it created. You may also specify a directory path in front of the folder name."
+ cgi_p "Click [cgi_italic Cancel] to return without saving (or creating) anything."
+ }
+ }
+
+ if {[WPCmd PEFolder isincoming 0]} {
+ set f_colid 1
+ } else {
+ set f_colid 0
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=top height=40 class=dialog {
+ cgi_put "Folder name : "
+ cgi_text f_name= type=text size=20 maxlength=256 style=vertical-align:middle onFocus=this.select()
+
+ if {[catch {WPCmd PEFolder collections} collections] == 0 && [llength $collections] > 1} {
+
+ cgi_put "within "
+
+ cgi_select f_colid style=vertical-align:middle {
+ set j 0
+ foreach i $collections {
+ if {$j == $f_colid} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+ if {[string length [set f [lindex $i 1]]] > 12} {
+ set f "[string range $f 0 10]..."
+ }
+
+ cgi_option $f value=$j $selected
+ incr j;
+ }
+ }
+ } else {
+ cgi_text f_colid=0 type=hidden notab
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle height=60 class=dialog {
+ cgi_submit_button "ok= OK "
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/folders.tcl b/web/cgi/alpine/1.0/folders.tcl
new file mode 100755
index 00000000..a173b778
--- /dev/null
+++ b/web/cgi/alpine/1.0/folders.tcl
@@ -0,0 +1,727 @@
+# $Id: folders.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# folders.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# and collection management
+#
+# Input:
+set folder_vars {
+ {uid "" 0}
+ {cid {} ""}
+ {show {} ""}
+ {expand {} ""}
+ {contract {} ""}
+ {oncancel "" main}
+ {frestore "" 0}
+ {delquery {} ""}
+ {dwnquery {} ""}
+ {delete {} ""}
+ {renquery {} ""}
+ {rename {} ""}
+ {newfolder {} ""}
+ {folder {} ""}
+ {newdir {} ""}
+ {directory {} ""}
+ {import {} ""}
+ {cancelled {} ""}
+ {fid {} ""}
+ {reload}
+}
+
+set indention 18
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+proc linecolor {linenum} {
+ if {$linenum % 2} {
+ return "#EEEEEE"
+ } else {
+ return "#FFFFFF"
+ }
+}
+
+proc pretty_folder_name {collections folder} {
+ set fcolid [lindex $folder 0]
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ if {$fcolid == [lindex $col 0]} {
+ set coltext [lindex $col 1]
+ }
+ }
+ return "${coltext}:[join [lrange $folder 1 end] /]"
+}
+
+#
+# Display the given folder list in a table (w/ mihodge mods)
+#
+proc blat_folder_list {colid flist shown path baseurl scroll anchorcntref depth} {
+ global key border indention mbox _wp
+
+ upvar $anchorcntref anchorcnt
+
+ set rownum 0
+
+ foreach folder $flist {
+ set t [lindex $folder 0]
+ set f [lindex $folder 1]
+ set ff [linsert $path [llength $path] $f]
+ set index -1
+
+ set bgcolor [linecolor [incr anchorcnt]]
+
+ # initial pad=12, expand/contract control is 9px wide
+ set cellpad [expr {12 + ($depth * $indention)}]
+ set delim [WPCmd PEFolder delimiter $colid]
+ set fullpath [join [lrange $ff 1 end] $delim]
+
+ if {[string first F $t] >= 0} {
+ regsub -all {(')} [lrange $ff 1 end] {\\\\\1} ef
+ set celldata [cgi_url $f open.tcl?colid=${colid}&folder=[WPPercentQuote $fullpath]&oncancel=folders&cid=$key target=_top]
+ } else {
+ set celldata $f
+ }
+
+ if {[string first D $t] >= 0} {
+
+ if {[set index [lsearch $shown $ff]] < 0} {
+ set control expand
+ } else {
+ set control contract
+ }
+
+ set celldata "[cgi_url [cgi_imglink $control] "${baseurl}${control}=[WPPercentQuote $ff]#f_[WPPercentQuote $ff]" name=f_[WPPercentQuote $ff] "style=\"padding-right:10px\""]$celldata"
+ incr cellpad -19
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data align=center {
+ if {[string first F $t] >= 0 || ([WPCmd PEFolder isincoming $colid] == 0 && [string compare $mbox $fullpath])} {
+ cgi_radio_button "fid=f_[WPPercentQuote $ff]"
+ }
+ }
+
+ cgi_table_data align=left "style=\"padding-left: ${cellpad}px\"" nowrap {
+ cgi_put $celldata
+ }
+
+ cgi_table_data valign=top nowrap {
+ if {[info exists control] && [string compare $control contract] == 0} {
+ cgi_submit_button "new_[WPPercentQuote $ff]=Create New..."
+ cgi_submit_button "imp_[WPPercentQuote $ff]=Import..."
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+
+ if {[string first D $t] >= 0 && $index >= 0} {
+ set nflist [eval WPCmd PEFolder list $ff]
+ set newpath $path
+ lappend newpath $f
+ blat_folder_list $colid $nflist $shown $newpath $baseurl $scroll anchorcnt [expr {$depth + 1}]
+ }
+
+ catch {unset control}
+ }
+}
+
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower $mbox]]} {
+ cgi_put [cgi_url INBOX [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=folders&cid=$key target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ #set button [cgi_img [WPimg but_resume] border=0 alt="Resume"]
+ set button Resume
+ cgi_puts [cgi_url $button wp.tcl?page=resume&oncancel=folders&cid=$key class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ #set button [cgi_img [WPimg but_abook] border=0 alt="Address Book"]
+ set button "Address Book"
+ cgi_puts [cgi_url $button wp.tcl?page=addrbook&oncancel=folders class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Configure" wp.tcl?page=conf_process&newconf=1&oncancel=folders&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * LOGOUT * * * *
+ if {[WPCmd PEInfo feature quit-without-confirm]} {
+ cgi_puts [cgi_url "Quit $_wp(appname)" $_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid target=_top class=navbar]
+ } else {
+ cgi_puts [cgi_url "Quit $_wp(appname)" wp.tcl?page=quit&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} key]} {
+ error [list _action "command ID" $key]
+}
+
+# perform requested op
+if {$delquery == 1 || [string compare $delquery Delete] == 0} {
+ if {[string length $fid]} {
+ set fid [string range $fid 2 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querydelfldr.tcl]
+ set nopage 1
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Delete]"]
+ }
+} elseif {$delete == 1 || [string compare $delete Delete] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid]} {
+ if {[catch [concat WPCmd PEFolder delete $fid] result] == 0} {
+ lappend newmail [list "'[lindex $fid end]' permanently removed"]
+ }
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Delete]"]
+ }
+} elseif {[string compare $delete Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Delete Cancelled"]
+} elseif {[string compare $rename Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Rename Cancelled"]
+} elseif {$renquery == 1 || [string compare $renquery Rename] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid]} {
+ set fid [string range $fid 2 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryrenfldr.tcl]
+ set nopage 1
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Rename]"]
+ }
+} elseif {$dwnquery == 1 || [string compare $dwnquery Export] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid] <= 0} {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Export]"]
+ } elseif {[file isdirectory $_wp(detachpath)] <= 0} {
+ lappend newmail [list "Server Configuration Problem: $_wp(detachpath) does not exist"]
+ } else {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) exporting.tcl]
+ set nopage 1
+ }
+} elseif {[string compare $rename Rename] == 0} {
+ if {[string length $folder]} {
+ if {[catch [concat WPCmd PEFolder rename $fid [list $folder]] result]} {
+ } else {
+ lappend newmail [list "'[lindex $fid end]' renamed to '$folder'"]
+ }
+ } else {
+ lappend newmail [list "Rename failed: no new name provided"]
+ }
+} elseif {[string compare [string range $newfolder 0 5] Create] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $folder]} {
+ set fpath [lrange $fid 1 end]
+ lappend fpath $folder
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} result]
+ || [catch {WPCmd PEFolder create [lindex $fid 0] [join $fpath $result]} result]} {
+ lappend newmail [list "Create failed: $result"]
+ } else {
+ lappend newmail [list "Folder $folder created"]
+ }
+ } else {
+ lappend newmail [list "Folder creation failed: no folder name provided"]
+ }
+} elseif {[string compare $newfolder Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Create Cancelled"]
+} elseif {[string compare [string range $import 0 5] Import] == 0} {
+ if {[catch {WPImport file "Missing File Upload"} errstr] == 0} {
+ set local_file [lindex $file 0]
+
+ if {[catch {WPImport iname "import name"} errstr] == 0} {
+ set iname [string trim $iname]
+
+ if {[string length $iname]} {
+
+ set colid [lindex $fid 0]
+ set fldr [eval "file join [lrange $fid 1 end] $iname"]
+
+ if {[catch {WPCmd PEFolder import $local_file $colid $fldr} errstr] == 0} {
+ lappend newmail [list "Imported folder $iname"]
+ } else {
+ lappend newmail [list "Can't Import File: $errstr"]
+ }
+ } else {
+ lappend newmail [list "Must provide uploaded folder name"]
+ }
+ } else {
+ lappend newmail [list "Can't get uploaded folder name"]
+ }
+
+ catch {file delete -force $local_file}
+ } else {
+ lappend newmail [list "Problem uploading file"]
+ }
+} elseif {[string compare [string range $newdir 0 5] Create] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $directory]} {
+ set fpath [lrange $fid 1 end]
+ lappend fpath "${directory}/"
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} result]
+ || [catch {WPCmd PEFolder create [lindex $fid 0] [join $fpath $result]} result]} {
+ lappend newmail [list "Create failed: $result"]
+ } else {
+ lappend newmail [list "Folder $directory created"]
+ }
+ } else {
+ lappend newmail [list "Directory Create failed: no name provided"]
+ }
+} elseif {[string compare $newdir Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Directory Creation Cancelled"]
+} elseif {[string compare $cancelled Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "New Folder or Directory Creation Cancelled"]
+} elseif {[catch {WPCmd PEInfo set wp_folder_script} script] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $script]
+ set nopage 1
+} else {
+ foreach i [cgi_import_list] {
+ switch -regexp -- $i {
+ ^new_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 4 end]
+ catch {WPCmd PEInfo set fid $fid}
+ catch {WPCmd PEInfo set wp_folder_script fr_querynewdir.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewfoldir.tcl]
+ set nopage 1
+ }
+ ^nd_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 3 end]
+ catch {WPCmd PEInfo set fid $fid}
+ catch {WPCmd PEInfo set wp_folder_script fr_querynewdir.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewdir.tcl]
+ set nopage 1
+ }
+ ^nf_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 3 end]
+ catch {WPCmd set fid $fid}
+ catch {WPCmd set wp_folder_script fr_querynewfldr.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewfldr.tcl]
+ set nopage 1
+ }
+ ^imp_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 4 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryimport.tcl]
+ set nopage 1
+ }
+ default {
+ }
+ }
+
+ catch {WPCmd PEInfo unset fid}
+ catch {WPCmd PEInfo unset wp_folder_script}
+ }
+}
+
+if {[info exists nopage] == 0} {
+ if {$reload || $frestore || ([string length $show] == 0 && [string length $expand] == 0 && [string length $contract] == 0)} {
+ catch {set show [WPCmd PEInfo set fr_show]
+ set expand [WPCmd PEInfo set fr_expand]
+ set contract [WPCmd PEInfo set fr_contract]}
+ } else {
+ WPCmd set fr_show $show
+ WPCmd set fr_expand $expand
+ WPCmd set fr_contract $contract
+ }
+
+ # collect top level folder lists
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ set shown [split $show ,]
+ set scroll {}
+ set anchorcnt 0
+
+ # mihodge: process actions
+ if {[llength $expand]} {
+ lappend shown $expand
+ set scroll $expand
+ }
+
+ if {[llength $contract]} {
+ if {[set index [lsearch $shown $contract]] >= 0} {
+ set shown [lreplace $shown $index $index]
+ set scroll $contract
+ }
+ }
+
+ set baseurl wp.tcl?page=folders&
+
+ if {[llength $shown]} {
+ append baseurl "show=[WPPercentQuote [join $shown ,]]&"
+ }
+
+ # build top-level collection's folder list
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ if {[llength $collections] == 1} {
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set flist {}
+ } else {
+ set flist 1
+ }
+ }
+
+ if {[llength $flist]} {
+ if {[catch {WPCmd PEFolder list $colid} flist]} {
+ if {[string compare BADPASSWD [string range $flist 0 8]] == 0} {
+ # control error messages
+ set statmsgs [WPCmd PEInfo statmsgs]
+ WPCmd PEMailbox newmailreset
+ if {[catch {WPCmd PESession creds [lindex $expand 0] folder} creds] == 0 && $creds != 0} {
+ catch {WPCmd PEInfo statmsg "Invalid Username or Password"}
+ WPCmd PESession nocred $expand folder
+ }
+
+ if {[catch {WPCmd PEFolder clextended} coln]} {
+ WPCmd set reason "Can't get Collection Info: $coln"
+ } else {
+ set coln [lindex $coln $expand]
+ if {[regexp {^([a-zA-Z\.]+).*\/user=([^ /]*)} [lindex $coln 4] dummy srvname authuser]} {
+ WPCmd set reason "Listing folders in the [cgi_bold [lindex $coln 1]] collection first requires that you log in to the server [cgi_bold "$srvname"]."
+ WPCmd set authuser $authuser
+ } else {
+ WPCmd set reason "Folders in the [cgi_bold [lindex $coln 1]] collection are on a server that must be logged into."
+ }
+ }
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol [lindex $expand 0]
+ WPCmd set authfolder folder
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders&expand=$expand"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"]
+
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryauth.tcl]
+
+ catch {WPCmd unset fr_expand}
+
+ set nopage 1
+ } else {
+ set flist {}
+ }
+ }
+ }
+
+ lappend collectionfolders $flist
+ }
+}
+
+if {[info exists nopage] == 0} {
+ # collect new mail message and errors
+ if {[catch {WPNewMail $reload} newmailmsg]} {
+ error [list _action "new mail" $newmailmsg]
+ } else {
+ foreach m $newmailmsg {
+ lappend newmail $m
+ }
+
+ if {[info exists newmail] == 0} {
+ set newmail ""
+ }
+ }
+
+ # paint the page
+ cgi_http_head {
+ WPStdHttpHdrs text/html
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder List" folders
+
+ set onload "onLoad="
+ set onunload "onUnload="
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"}]
+
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function viewReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "viewReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ WPStyleSheets
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=folders'}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=folders&cid=$key'"]
+
+ append onload [WPTFKeyEquiv $kequiv]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ catch {WPCmd PEInfo set help_context folders}
+
+ # prepare context and navigation information
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ lappend pagehier [list "Folder List"]
+ lappend pagehier [list [cgi_bold "\[Return to $mbox\]"] fr_main.tcl "View list of messages"]
+ if {[string compare $oncancel view] == 0} {
+ if {$uid} {
+ set num [WPCmd PEMessage $uid number]
+ } else {
+ set num View
+ }
+
+ lappend pagehier [list [cgi_bold "\[Return to Message $num\]"] view.tcl "View Message"]
+ }
+
+ set navops ""
+
+ WPTFTitle "Folder List" $newmail 0 "folders"
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=0 {
+ cgi_table_row {
+ cgi_table_data class=navbar "style=\"padding: 6 0 0 4\"" {
+ cgi_puts [cgi_span "style=font-weight: bold" "Current Folder"]
+ cgi_division align=center "style=margin-top:4;margin-bottom:4" {
+ set mbn [WPCmd PEMailbox mailboxname]
+ if {[string length $mbn] > 16} {
+ set mbn "[string range $mbn 0 14]..."
+ }
+
+ cgi_put [cgi_url $mbn fr_main.tcl target=_top class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Read Only"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Closed"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" bgcolor=#ffffff valign=top {
+
+ if {[llength $collections] > 1} {
+ cgi_division "style=\"font-family: helvetica; padding: 18; text-align: center\"" {
+ cgi_puts [cgi_span "style=font-weight: bold; font-size: 14pt; vertical-align: middle" "Folder Collections"]
+ cgi_br
+ cgi_puts [cgi_span "style=font-size: smaller" "(click to expand, open, delete, etc.)"]
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=$key" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+ # then the table representing the folders
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center {
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ if {[llength $collections] == 1} {
+ set menu "c"
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set menu "ce"
+ set flist {}
+ } else {
+ set menu "cc"
+ set flist 1
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data nowrap valign=middle {
+ if {[WPCmd PEFolder isincoming $colid] == 0 && [llength $flist]} {
+ cgi_image_button delquery=[WPimg but_folddel] border=0 alt=Delete
+ cgi_image_button renquery=[WPimg but_foldren] border=0 alt=Rename style=margin-left:4
+ cgi_image_button dwnquery=[WPimg but_foldexp] border=0 alt=Export style=margin-left:4
+ }
+ }
+
+ if {[llength $collections] > 1} {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set colpref [cgi_url [cgi_imglink expand] "${baseurl}expand=$colid" name=f_$colid]
+ } else {
+ set colpref [cgi_url [cgi_imglink contract] "${baseurl}contract=$colid" name=f_$colid]
+ }
+ } else {
+ set colpref ""
+ }
+
+ cgi_table_data align=left "style=\"padding-left:10\"" nowrap {
+ if {[llength [lindex $collectionfolders $i]]} {
+ set flist [lindex $collectionfolders $i]
+ }
+
+ cgi_puts ${colpref}[cgi_span "style=font-family:Helvetica; size: large; padding-left:10" "[lindex $col 1]"]
+ }
+
+ if {[llength $flist]} {
+ if {[WPCmd PEFolder isincoming $colid] == 0} {
+ cgi_table_data valign=middle nowrap {
+ cgi_submit_button "new_$colid=Create New..."
+ cgi_submit_button "imp_$colid=Import..."
+ }
+ }
+ }
+ }
+
+ if {[llength $flist]} {
+ blat_folder_list $colid $flist $shown $colid $baseurl $scroll anchorcnt 1
+ }
+
+ cgi_table_row {
+ cgi_table_data height=12 {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_addrbrowse.tcl b/web/cgi/alpine/1.0/fr_addrbrowse.tcl
new file mode 100755
index 00000000..2e1d2504
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_addrbrowse.tcl
@@ -0,0 +1,66 @@
+# $Id: fr_addrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_addrbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {op "" ""}
+ {field "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=73
+ cgi_frame subbody=wp.tcl?page=addrbook${parms}
+ }
+ }
diff --git a/web/cgi/alpine/1.0/fr_addredit.tcl b/web/cgi/alpine/1.0/fr_addredit.tcl
new file mode 100644
index 00000000..5836c001
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_addredit.tcl
@@ -0,0 +1,86 @@
+# $Id: fr_addredit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_addredit.tcl
+#
+# Purpose: CGI script to generate frame set for address book operations
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book {} -1}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ if {$add} {
+ set title 72
+ } else {
+ set title 71
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=addredit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_cledit.tcl b/web/cgi/alpine/1.0/fr_cledit.tcl
new file mode 100755
index 00000000..60ae3909
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_cledit.tcl
@@ -0,0 +1,79 @@
+#!./tclsh
+# $Id: fr_cledit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+ set add 0
+ if {[info exists cledit_add] && $cledit_add == 1} {
+ set add 1
+ }
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr [expr {$add == 1 ? "Add Collection Configuration" : "Edit Collection Configuration"}]
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {0} {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+ }
+
+ set title [expr {$add == 1 ? 151 : 152}]
+ set parms ""
+ if {[info exists cledit_add]} {
+ set parms "${parms}&add=${cledit_add}"
+ }
+ if {[info exists cledit_cl]} {
+ set parms "${parms}&cl=${cledit_cl}"
+ }
+ if {[info exists cledit_onclecancel]} {
+ set parms "${parms}&onclecancel=${cledit_onclecancel}"
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=wp.tcl?page=cledit&cid=$cid&oncancel=$oncancel$parms
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_compose.tcl b/web/cgi/alpine/1.0/fr_compose.tcl
new file mode 100755
index 00000000..bcdd3c35
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_compose.tcl
@@ -0,0 +1,144 @@
+# $Id: fr_compose.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_comp.tcl
+#
+# Purpose: CGI script to generate frame set for composer in
+# webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+ {part "" ""}
+ {style "" ""}
+ {nickto "" ""}
+ {book "" 0}
+ {ai "" -1}
+ {notice "" ""}
+ {repall "" 0}
+ {reptext "" 0}
+ {repqstr "" ""}
+ {restore "" 0}
+ {f_name "" ""}
+ {f_colid "" 0}
+ {cid "Missing Command ID"}
+ {spell "" ""}
+ {oncancel "" "main.tcl"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Import Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+switch -- $style {
+ Reply {
+ set title "40,[WPCmd PEMessage $uid number]"
+ }
+ Forward {
+ set title "30,[WPCmd PEMessage $uid number]"
+ }
+ Postponed {
+ set title "20,"
+ }
+ Spell {
+ # validate input
+ set spellresult {}
+ if {[catch {cgi_import_as last_line last} result] == 0 && [regexp {^[0-9]+$} $last] && $last < 10000} {
+ array set replace {}
+
+ for {set n 0} {$n < $last} {incr n} {
+ if {[catch {cgi_import_as l_$n locs} result] == 0} {
+
+ set words {}
+
+ foreach l [split $locs {,}] {
+ if {[regexp {[0-9]+_([0-9]+)_([0-9]+)} $l match o len]} {
+ if {[info exists replace($l)]} {
+ lappend words [list $o $len $replace($l)]
+ } elseif {([catch {cgi_import_as r_$l newword} result] == 0 && [string length [set newword [string trim $newword { }]]])
+ || ([catch {cgi_import_as s_$l newword} result] == 0 && [string length [set newword [string trim $newword { }]]])} {
+ lappend words [list $o $len $newword]
+ if {[catch {cgi_import_as a_$l allofem} result] == 0
+ && [string compare $allofem on] == 0
+ && [catch {cgi_import_as e_$l allofem} result] == 0} {
+ foreach e [split $allofem {,}] {
+ set replace($e) $newword
+ }
+ }
+ }
+ }
+ }
+
+ if {[llength $words]} {
+ lappend spellresult [list $n $words]
+ }
+ }
+ }
+
+ if {[llength $spellresult]} {
+ catch {WPCmd PEInfo set wp_spellresult $spellresult}
+ }
+ }
+
+ set title "10,"
+ }
+ default {
+ set title "10,"
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr Compose
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms &
+ } else {
+ append parms ?
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=$title title="Composer Title"
+ cgi_frame body=compose.tcl${parms} title="Compose Form"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_filtedit.tcl b/web/cgi/alpine/1.0/fr_filtedit.tcl
new file mode 100755
index 00000000..41abee9b
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_filtedit.tcl
@@ -0,0 +1,136 @@
+#!./tclsh
+# $Id: fr_filtedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+source filter.tcl
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Filter Configuration"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {[info exists filtedit_add] && 1 == $filtedit_add} {
+ set title 153
+ } else {
+ set title 154
+ }
+
+ set parms ""
+ if {[info exists filtedit_add]} {
+ set parms "${parms}&add=${filtedit_add}"
+ }
+ if {[info exists filtedit_fno]} {
+ set parms "${parms}&fno=${filtedit_fno}"
+ }
+ if {[info exists filtedit_onfiltcancel]} {
+ set parms "${parms}&onfiltcancel=${filtedit_onfiltcancel}"
+ }
+ if {[info exists filtedit_indexcolor]} {
+ set parms "${parms}&filtedit_indexcolor=1"
+ if {[info exists fg] && [string length $fg]} {
+ set parms "${parms}&fg=$fg"
+ }
+ if {[info exists bg] && [string length $bg]} {
+ set parms "${parms}&bg=$bg"
+ }
+ if {[info exists fgorbg]} {
+ set parms "${parms}&fgorbg=$fgorbg"
+ }
+ } elseif {[info exists filtedit_score]} {
+ set parms "${parms}&filtedit_score=1"
+ if {[info exists scoreval] && [string length $scoreval]} {
+ set parms "${parms}&scoreval=$scoreval"
+ }
+ if {[info exists scorehdr] && [string length $scorehdr]} {
+ set parms "${parms}&scoreval=$scorehdr"
+ }
+ }
+
+ if {[info exists filterrtext]} {
+ # relay pattern elements
+ set parms "${parms}&filterrtext=${filterrtext}"
+ foreach {pvar pexp} $pattern_id {
+ if {[info exists $pvar]} {
+ if {[string length [set pval [subst $$pvar]]]} {
+ append parms "&${pvar}=${pval}"
+ }
+ }
+ }
+
+ foreach {pvar pexp} $pattern_fields {
+ if {[info exists $pvar]} {
+ if {[string length [set pval [subst $$pvar]]]} {
+ append parms "&${pvar}=${pval}"
+ }
+ }
+ }
+
+ # relay various pattern actions
+ if {[info exists action] || 0 == [catch {WPImport action}]} {
+ append parms "&action=$action"
+ }
+
+ if {0 == [catch {WPImport actionfolder}]} {
+ append parms "&actionfolder=$actionfolder"
+ }
+
+ if {0 == [catch {WPImport moind}] && [string length $moind]} {
+ append parms "&moind=$moind"
+ }
+
+ if {0 == [catch {WPImport actionfolder}]} {
+ append parms "&actionfolder=$actionfolder"
+ }
+
+ if {[info exists folder] == 0} {
+ wpGetVarAs folder folder
+ }
+
+ if {[string length $folder]} {
+ append parms "&folder=$folder"
+ }
+
+ if {[info exists ftype] == 0} {
+ wpGetVarAs ftype ftype
+ }
+
+ if {[string length $ftype]} {
+ append parms "&ftype=$ftype"
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=wp.tcl?page=filtedit&cid=$cid&oncancel=$oncancel$parms
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_flags.tcl b/web/cgi/alpine/1.0/fr_flags.tcl
new file mode 100755
index 00000000..febc2eaf
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_flags.tcl
@@ -0,0 +1,67 @@
+#!./tclsh
+# $Id: fr_flags.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_flags.tcl
+#
+# Purpose: CGI script to generate frame set for flag setting
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $frame_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=160
+ cgi_frame subbody=flags.tcl${parms}
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_fldrbrowse.tcl b/web/cgi/alpine/1.0/fr_fldrbrowse.tcl
new file mode 100644
index 00000000..9373e5ff
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_fldrbrowse.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_fldrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_fldrbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting a folder from the user's
+# defined collections in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {onselect "" main}
+ {oncancel "" main}
+ {target "" ""}
+ {controls "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+
+ switch $controls {
+ 2 { set tnum 221 }
+ default {set tnum 220}
+ }
+
+ cgi_frame subhdr=header.tcl?title=${tnum} title="Folder Selection for Save"
+ cgi_frame subbody=wp.tcl?page=fldrbrowse${parms} title="Folder Selection Frame"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_fldrsavenew.tcl b/web/cgi/alpine/1.0/fr_fldrsavenew.tcl
new file mode 100644
index 00000000..f59a8914
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_fldrsavenew.tcl
@@ -0,0 +1,65 @@
+# $Id: fr_fldrsavenew.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_fldrcreate.tcl
+#
+# Purpose: CGI script to generate frame set for creating a new folder to save to
+
+# Input:
+set frame_vars {
+ {onselect "" main}
+ {oncancel "" main}
+ {target "" ""}
+ {controls "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+
+ switch $controls {
+ 2 { set tnum 223 }
+ default {set tnum 222}
+ }
+
+ cgi_frame subhdr=header.tcl?title=${tnum} title="Folder Creation for Save"
+ cgi_frame subbody=wp.tcl?page=fldrsavenew${parms} title="Folder Creation Frame"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_help.tcl b/web/cgi/alpine/1.0/fr_help.tcl
new file mode 100755
index 00000000..a6f7e388
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_help.tcl
@@ -0,0 +1,91 @@
+# $Id: fr_help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_help.tcl
+#
+# Purpose: CGI script to generate frame set for display of help text
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {topic "" ""}
+ {index "" ""}
+ {oncancel "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ cgi_title "WebPine Help"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),0,*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists help_vars]} {
+ foreach v $help_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ lappend parmlist [lindex $v 0]
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {(![info exists parmlist] || [lsearch -exact $parmlist [lindex $v 0]] < 0) && [string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=140 title="Help Title"
+ cgi_frame noop=wp.tcl?page=noop
+ cgi_frame body=help.tcl$parms title="Help Body"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_index.tcl b/web/cgi/alpine/1.0/fr_index.tcl
new file mode 100755
index 00000000..92b34184
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_index.tcl
@@ -0,0 +1,58 @@
+#!./tclsh
+# $Id: fr_index.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_index.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set index_vars {
+ {expunge ""}
+ {emptyit ""}
+ {f_colid {} ""}
+ {f_name {} ""}
+ {cid {} 0}
+ {split {} 0}
+}
+
+# Output:
+#
+
+# read config
+source ./alpine.tcl
+
+WPEval $index_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 10
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=100%,*" border=0 frameborder=0 framespacing=0 {
+ set parms ""
+ if {[info exists index_vars]} {
+ foreach v $index_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame body=wp.tcl?page=index${parms} title="Message List"
+ }
+ }
+}
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/fr_ldapbrowse.tcl b/web/cgi/alpine/1.0/fr_ldapbrowse.tcl
new file mode 100755
index 00000000..c6ac8c59
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_ldapbrowse.tcl
@@ -0,0 +1,61 @@
+# $Id: fr_ldapbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_ldapbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting addresses
+# from an LDAP query in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input: (NOTE: these are expected to be set when we get here)
+set frame_vars {
+ {ldapquery "" ""}
+ {addresses "" ""}
+ {field "" ""}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=74
+ cgi_frame subbody=ldapbrowse.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_ldapquery.tcl b/web/cgi/alpine/1.0/fr_ldapquery.tcl
new file mode 100644
index 00000000..b2b90e24
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_ldapquery.tcl
@@ -0,0 +1,75 @@
+# $Id: fr_ldapquery.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_ldapquery.tcl
+#
+# Purpose: CGI script to generate frame set for LDAP server query
+# handling in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=240
+ cgi_frame body=ldapquery.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_main.tcl b/web/cgi/alpine/1.0/fr_main.tcl
new file mode 100755
index 00000000..8654ab69
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_main.tcl
@@ -0,0 +1,34 @@
+#!./tclsh
+# $Id: fr_main.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_main.tcl - frame set for Index and View
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set frame_vars {
+ {expunge {} 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+
+WPEval $frame_vars {
+ source main.tcl
+}
diff --git a/web/cgi/alpine/1.0/fr_promptsave.tcl b/web/cgi/alpine/1.0/fr_promptsave.tcl
new file mode 100755
index 00000000..4bbf040b
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_promptsave.tcl
@@ -0,0 +1,68 @@
+# $Id: fr_promptsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_promptsave.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=190
+ cgi_frame subbody=promptsave.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryattach.tcl b/web/cgi/alpine/1.0/fr_queryattach.tcl
new file mode 100755
index 00000000..8cbdc015
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryattach.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_queryattach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryattach.tcl
+#
+# Purpose: CGI script to generate frame set for specifying an attachment
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=110
+ cgi_frame subbody=queryattach.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryauth.tcl b/web/cgi/alpine/1.0/fr_queryauth.tcl
new file mode 100755
index 00000000..ad5d13d1
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryauth.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_queryauth.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryauth.tcl
+#
+# Purpose: CGI script to generate frame set for input of user/passwd
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+ {authcol "Missing Authenticaion Collection"}
+ {authfolder "Missing Authentication Folder"}
+ {authpage "Missing Post Authorization Instructions"}
+ {authcancel "Missing Auth Cancel Instructions"}
+ {authuser "" ""}
+ {reason "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=130 title="Status Frame"
+ cgi_frame body=$_wp(serverpath)/session/queryauth.tcl?sessid=$_wp(sessid)${parms} title="User and Password Prompt"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querycreate.tcl b/web/cgi/alpine/1.0/fr_querycreate.tcl
new file mode 100755
index 00000000..b3ff332c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querycreate.tcl
@@ -0,0 +1,42 @@
+# $Id: fr_querycreate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querycreate.tcl
+#
+# Purpose: CGI script to generate frame set for creation confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=120 title="Status Frame"
+ cgi_frame subbody=querycreate.tcl title="Creation Confirmation Prompt"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querydelfldr.tcl b/web/cgi/alpine/1.0/fr_querydelfldr.tcl
new file mode 100755
index 00000000..653c52cb
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querydelfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querydelfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querydelfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder delete confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=170
+ cgi_frame subbody=querydelfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryexpunge.tcl b/web/cgi/alpine/1.0/fr_queryexpunge.tcl
new file mode 100755
index 00000000..704c12c7
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryexpunge.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_queryexpunge.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_expunge.tcl
+#
+# Purpose: CGI script to generate frame set for expunge confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ WPCmd PEInfo set wp_spec_script fr_queryexpunge.tcl
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=90
+ cgi_frame subbody=queryexpunge.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryimport.tcl b/web/cgi/alpine/1.0/fr_queryimport.tcl
new file mode 100644
index 00000000..d4e7ee28
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryimport.tcl
@@ -0,0 +1,44 @@
+# $Id: fr_queryimport.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryimport.tcl
+#
+# Purpose: CGI script to generate frame set for specifying a folder
+# to upload and import to a collection. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ cgi_frame subhdr=header.tcl?title=250 title="Folder Import Dialog"
+ cgi_frame subbody=queryimport.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewdir.tcl b/web/cgi/alpine/1.0/fr_querynewdir.tcl
new file mode 100755
index 00000000..a8f54899
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewdir.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewdir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewdir.tcl
+#
+# Purpose: CGI script to generate frame set for Directory create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=172
+ cgi_frame subbody=querynewdir.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewfldr.tcl b/web/cgi/alpine/1.0/fr_querynewfldr.tcl
new file mode 100755
index 00000000..6bc17b42
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=171
+ cgi_frame subbody=querynewfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewfoldir.tcl b/web/cgi/alpine/1.0/fr_querynewfoldir.tcl
new file mode 100755
index 00000000..fc6a61b7
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewfoldir.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewfoldir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewfoldir.tcl
+#
+# Purpose: CGI script to generate frame set for Folder/Directory create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=174
+ cgi_frame subbody=querynewfoldir.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryprune.tcl b/web/cgi/alpine/1.0/fr_queryprune.tcl
new file mode 100644
index 00000000..20e9638c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryprune.tcl
@@ -0,0 +1,66 @@
+# $Id: fr_queryprune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryprune.tcl
+#
+# Purpose: CGI script to generate frame set for pruning dialog
+# in webpine.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+ {start "Missing Start Page"}
+ {nojs "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=260 title="Folder Pruning Frame"
+ cgi_frame body=queryprune.tcl?sessid=$_wp(sessid)&${parms} title="Folder Pruning Dialog"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryquit.tcl b/web/cgi/alpine/1.0/fr_queryquit.tcl
new file mode 100644
index 00000000..4f12e8ba
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryquit.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_queryquit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryquit.tcl
+#
+# Purpose: CGI script to generate frame set for logging out of a session
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "$_wp(logoutpause); url=$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=230
+ cgi_frame subbody=queryquit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryrenfldr.tcl b/web/cgi/alpine/1.0/fr_queryrenfldr.tcl
new file mode 100755
index 00000000..a498700c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryrenfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_queryrenfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryrenfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder rename confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=173
+ cgi_frame subbody=queryrenfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querysave.tcl b/web/cgi/alpine/1.0/fr_querysave.tcl
new file mode 100755
index 00000000..af8e8c88
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querysave.tcl
@@ -0,0 +1,68 @@
+# $Id: fr_querysave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querysave.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=90
+ cgi_frame subbody=querysave.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_resume.tcl b/web/cgi/alpine/1.0/fr_resume.tcl
new file mode 100755
index 00000000..3e332cae
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_resume.tcl
@@ -0,0 +1,104 @@
+# $Id: fr_resume.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_resume.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {oncancel "" main}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+proc ppnd_uid {ppnd} {
+ foreach i $ppnd {
+ switch -- [lindex $i 0] {
+ uid {
+ return [lindex $i 1]
+ }
+ }
+ }
+
+ error "No Valid UID for Postponed message"
+}
+
+
+if {[catch {WPLoadCGIVar cid} result]} {
+ catch {WPCmd PEInfo statmsg "Missing Command ID: $result"}
+ source [WPTFScript $oncancel]
+} elseif {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+ source [WPTFScript $oncancel]
+} elseif {[catch {WPCmd PEPostpone count} postponed]} {
+ catch {WPCmd PEInfo statmsg "Resume Error: $postponed"}
+ source [WPTFScript $oncancel]
+} else {
+ switch -- $postponed {
+ -1 -
+ 0 {
+ catch {WPCmd PEInfo statmsg "No Postponed Messages"}
+ source [WPTFScript $oncancel]
+ }
+ default {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=80 title="Status Frame"
+ cgi_frame body=resume.tcl${parms} title="Resumable Message List"
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_seldate.tcl b/web/cgi/alpine/1.0/fr_seldate.tcl
new file mode 100755
index 00000000..99f0a933
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_seldate.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_seldate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_seldate.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by date
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=101
+ cgi_frame subbody=seldate.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_select.tcl b/web/cgi/alpine/1.0/fr_select.tcl
new file mode 100755
index 00000000..8b70d23a
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_select.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_select.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by the various methods
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=104 title="Status Frame"
+ cgi_frame subbody=select.tcl${parms} title="Search Criteria"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_selstat.tcl b/web/cgi/alpine/1.0/fr_selstat.tcl
new file mode 100755
index 00000000..317684fd
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_selstat.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_selstat.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_selstat.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by status
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=103
+ cgi_frame subbody=selstat.tcl${parms}
+ }
+ }
diff --git a/web/cgi/alpine/1.0/fr_seltext.tcl b/web/cgi/alpine/1.0/fr_seltext.tcl
new file mode 100755
index 00000000..644ed353
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_seltext.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_seltext.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_seltext.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by text
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=102
+ cgi_frame subbody=seltext.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_spellcheck.tcl b/web/cgi/alpine/1.0/fr_spellcheck.tcl
new file mode 100755
index 00000000..bdd64e07
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_spellcheck.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_spellcheck.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_spellcheck.tcl
+#
+# Purpose: CGI script to generate frame set for spell checking composition
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {repqstr "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=180
+ cgi_frame body=spellcheck.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_split.tcl b/web/cgi/alpine/1.0/fr_split.tcl
new file mode 100644
index 00000000..1861ad35
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_split.tcl
@@ -0,0 +1,58 @@
+# $Id: fr_split.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_split.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set split_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $split_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs {} 10
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=33%,*" {
+ set parms ""
+ if {[info exists split_vars]} {
+ foreach v $split_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame fr_top=wp.tcl?page=index&split=1${parms} title="Message List"
+ cgi_frame fr_bottom=fr_view.tcl?split=1${parms} title="Message View"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_take.tcl b/web/cgi/alpine/1.0/fr_take.tcl
new file mode 100644
index 00000000..b5a37ebb
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_take.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_take.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_take.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=210
+ cgi_frame subbody=takeaddr.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_takeedit.tcl b/web/cgi/alpine/1.0/fr_takeedit.tcl
new file mode 100644
index 00000000..a339bafe
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_takeedit.tcl
@@ -0,0 +1,79 @@
+# $Id: fr_takeedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_takeedit.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=211
+ cgi_frame subbody=addredit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_takesame.tcl b/web/cgi/alpine/1.0/fr_takesame.tcl
new file mode 100644
index 00000000..fb69a4aa
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_takesame.tcl
@@ -0,0 +1,79 @@
+# $Id: fr_takesame.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_takeedit.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=212
+ cgi_frame subbody=querynick.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_tconfig.tcl b/web/cgi/alpine/1.0/fr_tconfig.tcl
new file mode 100755
index 00000000..a7d62244
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_tconfig.tcl
@@ -0,0 +1,69 @@
+#!./tclsh
+# $Id: fr_tconfig.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Intput:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Configuration"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {0} {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+ }
+
+ set title 150
+
+ set vlavarstr ""
+ if {[info exists fr_tconfig_vlavar]} {
+ set vlavarstr "&vlavar=$fr_tconfig_vlavar"
+ }
+ cgi_frame hdr=header.tcl?title=${title} title="Status Frame"
+ cgi_frame body=wp.tcl?page=tconfig&newconf=$newconf&oncancel=$oncancel&wv=$conftype$vlavarstr title="Configuration options"
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_view.tcl b/web/cgi/alpine/1.0/fr_view.tcl
new file mode 100755
index 00000000..a4258baa
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_view.tcl
@@ -0,0 +1,30 @@
+#!./tclsh
+# $Id: fr_view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_view.tcl - wrapper around do_view.tcl to start tcl interp
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval {} {
+ source do_view.tcl
+}
diff --git a/web/cgi/alpine/1.0/genvars.tcl b/web/cgi/alpine/1.0/genvars.tcl
new file mode 100755
index 00000000..b982aee9
--- /dev/null
+++ b/web/cgi/alpine/1.0/genvars.tcl
@@ -0,0 +1,114 @@
+# $Id: genvars.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+set general_vars {
+ {var personal-name "Name"}
+ {var user-domain "User Domain"}
+ {var inbox-path "Inbox Location"}
+ {var default-fcc "Default Fcc"}
+ {var postponed-folder "Default Postponed Folder"}
+ {var alt-addresses "Other Addresses"}
+ {var wp-indexheight "Font Size"}
+ {var smtp-server "SMTP Server"}
+ {feat enable-newmail-sound "Enable Background Sound on New Mail Arrival"}
+ {feat enable-flag-cmd "Enable Flag Command"}
+ {feat auto-move-read-msgs "Automatically Move Read Messages"}
+ {feat expunge-without-confirm "Expunge INBOX Without Confirming"}
+ {feat expunge-without-confirm-everywhere "Expunge Everywhere Without Confirming"}
+ {feat quit-without-confirm "Quit Without Confirming"}
+ {feat enable-jump-cmd "Enable Jump Command"}
+ {special wp-columns "Display Width"}
+ {special left-column-folders "Message View/List Folder List Count"}
+}
+
+set msglist_vars {
+ {special index-format "Message Line Format"}
+ {var sort-key "Sort By"}
+ {var incoming-startup-rule "Start At"}
+ {var wp-indexlines "Message Lines Displayed"}
+ {feat mark-for-cc "Mark Messages For Cc"}
+ {feat enable-aggregate-command-set "Enable Aggregate Commands"}
+ {feat auto-zoom-after-select "Zoom View after Search"}
+ {feat auto-unselect-after-apply "Unmark Messages After Command"}
+}
+
+set composer_vars {
+ {special signature "Signature"}
+ {var default-composer-hdrs "Default Composer Headers"}
+ {var customized-hdrs "Customized Headers"}
+ {var fcc-name-rule "Fcc name rule"}
+ {var empty-header-message "Empty Header Message"}
+ {var posting-character-set "Posting Character Set"}
+ {feat compose-rejects-unqualified-addrs "Compose Rejects Unqualified Addresses"}
+ {feat enable-sigdashes "Enable Sigdashes"}
+ {feat quell-user-lookup-in-passwd-file "Don't Look Up Users in passwd File"}
+ {var reply-indent-string "Reply Indent String"}
+ {feat enable-reply-indent-string-editing "Enable Reply Indent String Editing"}
+ {var reply-leadin "Reply Leadin"}
+ {feat include-attachments-in-reply "Include Attachments in Reply"}
+ {feat include-header-in-reply "Include Header in Reply"}
+ {feat include-text-in-reply "Include Text in Reply"}
+ {feat signature-at-bottom "Signature at Bottom"}
+ {feat strip-from-sigdashes-on-reply "Strip From Sigdashes on Reply"}
+ {feat fcc-without-attachments "Fcc Without Attachments"}
+ {feat enable-8bit-esmtp-negotiation "Enable 8bit ESMTP Negotiation"}
+ {feat enable-delivery-status-notification "Enable Delivery Status Notification"}
+ {feat enable-verbose-smtp-posting "Enable Verbose SMTP Posting"}
+ {feat use-sender-not-x-sender "Use Sender, Not X-Sender"}
+ {feat send-confirms-only-expanded "Confirm Send only if Addresses Expanded"}
+ {feat quell-content-id "Prevent Content-ID header in Attachments"}
+ {feat quell-format-flowed "Do Not Send Flowed Text"}
+ {feat forward-as-attachment "Forward message as attachment"}
+}
+
+set folder_vars {
+ {special collections "Folder Collections"}
+ {var default-fcc "Default Fcc"}
+ {var default-saved-msg-folder "Default Saved Message Folder"}
+ {var saved-msg-name-rule "Saved Message Name Rule"}
+ {var postponed-folder "Postponed Folder"}
+ {var read-message-folder "Read Messages Folder"}
+ {var form-letter-folder "Form Letter Folder"}
+ {var folder-sort-rule "Folder Sort Rule"}
+ {var incoming-folders "Incoming Folders"}
+ {var pruned-folders "Pruned Folders"}
+ {var pruning-rule "Pruning Rule"}
+ {feat prune-uses-yyyy-mm "Prune Uses YYYY-MM"}
+ {feat enable-dot-folders "Enable Hidden Folders"}
+ {feat enable-lame-list-mode "Enable Lame List Mode"}
+ {feat try-alternative-authentication-driver-first "Try Alternative Authentication First"}
+ {feat quell-empty-directories "Do Not Display Empty Directores"}
+}
+
+set address_vars {
+ {var address-book "Address Books"}
+ {var global-address-book "Global Address Books"}
+ {var addrbook-sort-rule "Address Book Sort Rule"}
+ {var ldap-servers "Directory Servers"}
+}
+
+set msgview_vars {
+ {special view-colors "Message View Color Settings"}
+ {var viewer-hdrs "Viewer Headers"}
+ {feat enable-msg-view-urls "Enable URLs"}
+ {feat enable-msg-view-web-hostnames "Enable Web Hostnames"}
+ {feat enable-msg-view-addresses "Enable Address Links"}
+ {feat enable-msg-view-attachments "Enable Attachments View"}
+ {feat enable-full-header-cmd "Enable Full Headers"}
+ {feat quell-host-after-url "Hide server name display after links in HTML"}
+}
+
+set rule_vars {
+ {special filters "Filters"}
+ {special scores "Scoring"}
+ {special indexcolor "Index Colors"}
+}
diff --git a/web/cgi/alpine/1.0/header.tcl b/web/cgi/alpine/1.0/header.tcl
new file mode 100755
index 00000000..8bff53e6
--- /dev/null
+++ b/web/cgi/alpine/1.0/header.tcl
@@ -0,0 +1,226 @@
+#!./tclsh
+# $Id: header.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# header.tcl
+#
+# Purpose: CGI script to generate generic header for
+# webpine-lite pages. the idea is that this
+# page goes in the {title,nav}-bar portion of a
+# framed page so we keep the servlet alive via
+# periodic reloads while more static/form stuff
+# is displayed in the "body" frame.
+
+# Input:
+set header_vars {
+ {title "" "0,0"}
+ {reload}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set nologo 0
+set about {}
+
+WPEval $header_vars {
+
+ set tv [split $title ","]
+ switch -- [lindex $tv 0] {
+ 10 {
+ set title_text "Compose New Message"
+ }
+ 20 {
+ set title_text "Postponed Message"
+ }
+ 30 {
+ set title_text "Forward Message"
+ if {[regexp {^[0-9]*$} [lindex $tv 1]]} {
+ append title_text " [lindex $tv 1]"
+ }
+ }
+ 40 {
+ set title_text "Reply to Message"
+ if {[regexp {^[0-9]*$} [lindex $tv 1]]} {
+ append title_text " [lindex $tv 1]"
+ }
+ }
+ 50 {
+ set title_text "Message Index"
+ set nologo 1
+ }
+ 60 {
+ set title_text "Help System"
+ }
+ 70 {
+ set title_text "Address Books"
+ }
+ 71 {
+ set title_text "Edit Address Book Entry"
+ }
+ 72 {
+ set title_text "New Address Book Entry"
+ }
+ 73 {
+ set title_text "Address Selection"
+ }
+ 74 {
+ set title_text "LDAP Query Result Selection"
+ }
+ 80 {
+ set title_text "Select Postponed Message"
+ }
+ 90 {
+ set title_text "Expunge Deleted Messages"
+ set nologo 1
+ }
+ 101 {
+ set title_text "Select Messages by Date"
+ set nologo 1
+ }
+ 102 {
+ set title_text "Select Messages by Text"
+ set nologo 1
+ }
+ 103 {
+ set title_text "Select Messages by Status"
+ set nologo 1
+ }
+ 104 {
+ set title_text "Search and Mark Messages"
+ set nologo 1
+ }
+ 110 {
+ set title_text "Attach a File"
+ }
+ 120 {
+ set title_text "File Creation Confirmation"
+ set nologo 1
+ }
+ 130 {
+ set title_text "Authentication Required"
+ }
+ 140 {
+ set title_text "Web Alpine Help"
+ }
+ 150 {
+ set title_text "Configuration"
+ }
+ 151 {
+ set title_text "Add Collection Configuration"
+ }
+ 152 {
+ set title_text "Edit Collection Configuration"
+ }
+ 153 {
+ set title_text "Add Filter Configuration"
+ }
+ 154 {
+ set title_text "Edit Filter Configuration"
+ }
+ 160 {
+ set title_text "Set Message Flags"
+ set nologo 1
+ }
+ 170 {
+ set title_text "Confirm Folder Delete"
+ }
+ 171 {
+ set title_text "New Folder Creation"
+ }
+ 172 {
+ set title_text "New Directory Creation"
+ }
+ 173 {
+ set title_text "Folder Rename"
+ }
+ 174 {
+ set title_text "Create New Folder or Directory"
+ }
+ 180 {
+ set title_text "Spell Check Composition"
+ }
+ 190 {
+ set title_text "Save Messages"
+ set nologo 1
+ }
+ 200 {
+ set title_text "Attachment Display"
+ }
+ 210 {
+ set title_text "Take Addresses"
+ }
+ 211 {
+ set title_text "Take Address Edit"
+ }
+ 212 {
+ set title_text "Take Address Same Nickname"
+ }
+ 220 {
+ set title_text "Folder List for Save"
+ set nologo 1
+ }
+ 221 {
+ set title_text "Folder List for Save"
+ }
+ 222 {
+ set title_text "Folder To Save To"
+ set nologo 1
+ }
+ 223 {
+ set title_text "Folder To Save To"
+ }
+ 230 {
+ set title_text "Quitting Web Alpine"
+ }
+ 240 {
+ set title_text "LDAP Query"
+ }
+ 250 {
+ set title_text "Folder Upload and Import"
+ }
+ 260 {
+ set title_text "Monthly Folder Clean Up"
+ }
+ default {
+ if {[catch {WPCmd PEInfo set wp_header_title} title_text]} {
+ set title_text Untitled
+ }
+ }
+ }
+
+ WPCmd PEInfo set wp_header_title $title_text
+
+ if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs text/html
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr Header
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/header.tcl?sessid=$sessid"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" {
+ WPTFTitle $title_text $newmail $nologo $about
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/help.tcl b/web/cgi/alpine/1.0/help.tcl
new file mode 100755
index 00000000..6881895d
--- /dev/null
+++ b/web/cgi/alpine/1.0/help.tcl
@@ -0,0 +1,36 @@
+#!./tclsh
+# $Id: help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# help.tcl
+#
+# Purpose: CGI script to generate html help text for Alpine
+
+# Input:
+set help_vars {
+ {topic {} ""}
+ {topicclass {} ""}
+ {index {} ""}
+ {oncancel {} main}
+ {params {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS help text for alpine
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $help_vars {
+ source do_help.tcl
+}
diff --git a/web/cgi/alpine/1.0/help/about.tcl b/web/cgi/alpine/1.0/help/about.tcl
new file mode 100644
index 00000000..44d28a12
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/about.tcl
@@ -0,0 +1,30 @@
+# $Id: about.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_h2 "About Web Alpine"
+cgi_p "Version [WPCmd PEInfo version].[WPCmd PEInfo revision] (basic HTML interface)"
+cgi_p {
+Web Alpine is a mail user agent, built on the Alpine Mail System, designed to
+provide email access and management facilities via the World Wide Web.
+As a web-based application, Alpine provides universal, convenient, and
+secure access to your email environment.
+}
+cgi_p {Because its foundation is shared
+with the Alpine Mail System, Web Alpine can easily provide a view of your email
+environment consistent with that of Alpine and PC-Alpine. However, due to
+inherent speed and efficiency limitations of web email, it is not intended
+to replace any other email programs. Web Alpine is designed specifically for
+those away from their own desktop computers and for people with light duty
+email needs.
+}
+cgi_p {
+}
+cgi_p "Send comments and suggestions to [cgi_quote_html "<$_wp(comments)>"]."
diff --git a/web/cgi/alpine/1.0/help/addrbook.html b/web/cgi/alpine/1.0/help/addrbook.html
new file mode 100644
index 00000000..11399f33
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addrbook.html
@@ -0,0 +1,61 @@
+
+Address Books
+
+
The Address Books screen provides a listing of addresses and contact information. If you have
+more than one address book, your "Read-Only" books will be listed directly beneath your personal
+listing.
+
+Adding an entry
+Click to go to a screen that includes the following
+fields: "Nickname:", "Full Name:", "Addresses:", "Fcc:", "Comments:".
+Complete the information that you want to save in your address book and
+click to add an entry to your personal addressbook.
+
+
For more information about these fields, see the Address Book Entry
+help text.
+
+
+Removing an entry
+Click the nickname of an entry you would like to remove. On the next
+screen, click .
+
+
+Editing an entry
+Click the nickname of an entry you would like to edit. On the next
+screen, make your desired changes and click .
+
+
+Creating a distribution list
+Click to go to a screen that includes the following
+fields: "Nickname:", "Full Name:", "Addresses:", "Fcc:", "Comments:".
+Complete the information that you want to save in your
+address book. Include the addresses for your distribution (or group
+mailing) list in the "Addresses:" field, separating each address by a
+comma. Use a Nickname and Full Name that will be meaningful for you for
+this list.
+
+Going directly to Message Compose
+Click a highlighted address to go directly to your Message Compose page.
+The address you select will be in the "To:" field ready for your new
+message. In the case of distribution lists, select any one of the
+addresses in that list and they will all be included in the "To:" field.
diff --git a/web/cgi/alpine/1.0/help/addrbrowse.html b/web/cgi/alpine/1.0/help/addrbrowse.html
new file mode 100644
index 00000000..3e9abf2e
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addrbrowse.html
@@ -0,0 +1,27 @@
+
+Addressing Messages
+
+
Select addresses for your message composition in your address book after you
+click on your Message Compose
+screen.
+
+
Click the checkbox next to address or addresses to which you want to send your
+message.
+
+
Click to return to your Message Compose screen.
+Your message will now include the addresses you have selected.
+
+
Click to return to your Message Compose screen without
+adding an address.
diff --git a/web/cgi/alpine/1.0/help/addredit.html b/web/cgi/alpine/1.0/help/addredit.html
new file mode 100644
index 00000000..01defdcc
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addredit.html
@@ -0,0 +1,59 @@
+
+Address Book Entry
+
+
You can add and edit individual and group entries to your address book by adding information to
+the following fields:
+
+Nickname
+Enter a nickname which will identify this address book entry. Every
+address book entry needs to have a unique nickname associated with it.
+While composing a message, you can use the nickname in place of the address.
+By clicking , the nickname will automatically by replace by
+the full address or addresses for this entry. The nickname is not seen in the outgoing message.
+
+
Full Name
+Enter the full name for this entry. For an
+individual entry, you will ordinarily use that person's name. For a group
+of addresses (or distribution list), use a descriptive word or phrase
+that describes the group.
+
+
Addresses
+Enter the email address or addresses for this entry. You must complete this field for all your
+address book entries. You can create group mailing lists for sending
+email messages to several addresses at once by listing the addresses
+separated by commas, just as you would enter them when composing a
+message. For those addresses already in your address book, you can just
+add the nicknames separated by commas.
+
+
Fcc
+When the "Fcc:" (Folder carbon copy) field is used, a copy of all messages
+that you send with this addressbook entry as the first address in the
+"To:" field will be saved in the folder specified in the "Fcc:" field
+rather than your default Fcc folder (usually "sent-mail").
+
+
Comments
+
+This optional field allows you to enter any comments about the entry. This field is not used in your
+outgoing messages.
+
diff --git a/web/cgi/alpine/1.0/help/attach.html b/web/cgi/alpine/1.0/help/attach.html
new file mode 100644
index 00000000..b632c9f4
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/attach.html
@@ -0,0 +1,37 @@
+
+Add an Attachment
+
+
Add a file (such as a document, image, audio clip) to your message after
+you click on your Message Compose screen.
+
+
Click to find and select the file you want to attach.
+If you know the exact path to the file, simply type in that path.
+
+
You have the option of entering a short description of the attachment
+in the second text box. If you choose to include a description, your
+recipients will see that text alongside the file name. Descriptions
+can be particularly helpful when you include several attachments to your
+message.
+
+
Click to return to your Message Compose screen.
+Your attached file will be listed in the "Attachments:" field. To add
+another attachment, from Message Compose, click again.
+
+
If you have attached a file that you do not want to send, return to the Message
+Compose screen by clicking . Then click the corresponding to remove it.
+
+
Click to return to your Message Compose screen without
+adding an attachment.
diff --git a/web/cgi/alpine/1.0/help/compose.html b/web/cgi/alpine/1.0/help/compose.html
new file mode 100644
index 00000000..aad7ac40
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/compose.html
@@ -0,0 +1,147 @@
+
+
+
+
Attachments: Use this field to attach files (such as
+documents,
+images, audio clips) to your message. Click to find and attach a file
+from your local system. If you have attached a file that you do not want
+to send,
+click the corresponding to
+remove it.
+
+
Subject: Use this field to provide a few words that summarize
+the message.
+
+
Cc: (Carbon copy) This field is similar to the "To:" field, but
+it is used to send a copy of the message to one or more people. These
+email
+addresses will be seen by all message recipients.
+
+
Bcc: (Blind carbon copy) This field is similar to the "To:" and
+"Cc:" fields, but it is
+used to send a copy of the message to one or more people whose
+addresses you do not want disclosed to other message recipients.
+
+
Fcc: (File carbon copy) Use this field to specify the folder
+to which a copy of your
+outgoing message will be saved. When this header is visible, you can
+change or remove the Fcc by editing the folder name.
+
+
Reply-To: Use this field when you would like replies to your
+messages to be directed to an address other than your usual "From:"
+address.
+
+Type your message in the large text box beneath the headers. Depending on
+your browser, messages you send may contain a single long line rather than
+the nicely wrapping text shown in the text box. In those cases,
+recipients will have to scroll horizontally to read your message. To
+avoid this problem, use the Return key at the end of each line.
+
+
To spell check your message, click the
+ button. The resulting page will list each
+potentially misspelled word. Each word will have a text box for you to
+enter a correction. Additionally, some words will also have
+a list of suggested corrections. Click the Apply button to have
+your changes appear in the composer, or
+Cancel to return to the composer with the original text.
+
+
+
Do you want to add a personalized signature line to your messages? Go
+to Configure from the Message View or List page and click the Composer tab.
+To send your message, postpone it to resume later, or to cancel it
+completely, click the appropriate radio button and then click .
+
+
Send - Use this option to send your message to the
+recipients.
+
Postpone - Use this option to store an unfinished message
+without sending it. To finish the message at a later time, click
+Resume in the far left column of the Message List.
+
Cancel - Use this option to throw out the current composition.
+The message will not be sent and you will not be able to resume
+it.
Alpine is designed primarily for easy access to email. It is not
+intended to replace any other heavy duty email programs. Accordingly, it
+is missing some of the more advanced features you will find in Pine and
+PC-Pine. As development continues, features will be added as long as they
+do not make a large impact on Alpine's speed or efficiency.
+
+
Some of the features you will not currently find in Alpine Compose:
+
+
Lcc (List carbon copy)
+
Where is (instead, use your browser's "find" command)
+
Read a file into the composition
+
+
+
+
diff --git a/web/cgi/alpine/1.0/help/create_save.tcl b/web/cgi/alpine/1.0/help/create_save.tcl
new file mode 100644
index 00000000..f2a07b5c
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/create_save.tcl
@@ -0,0 +1,17 @@
+# $Id: create_save.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_h2 "Create Folder Confirmation Help"
+cgi_p "Help pages for the create file to save in confirmation page will appear here."
+cgi_p {
+ Someday.
+
+}
diff --git a/web/cgi/alpine/1.0/help/expunge.html b/web/cgi/alpine/1.0/help/expunge.html
new file mode 100644
index 00000000..f1602175
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/expunge.html
@@ -0,0 +1,20 @@
+
+Expunge Deleted Messages
+
+
Click to permanently remove the messages you have flagged for deletion. You will
+not be able to retrieve your messages once you have expunged them.
+
+
Click to return to your list of messages. The messages you previously flagged for
+deletion will remain in your folder, still flagged for deletion.
Filtering is a way to automatically move certain messages from one
+folder to another or to delete messages, according to rules that you
+define. For each filtering rule you define, you will provide a
+Pattern to establish the messages you want filtered, and an
+Action, to control what to do with those messages.
+
+
Click to go to a screen where you can define a set of
+new filter rules.
+
+
Click next to a filter that you would like to change. You
+will go to an edit screen. You will only see this option if you have
+already created filters.
+
+
+
Click next to a filter rule you would like to remove.
+That filter will disappear. You will only see this option if
+you have already created filter rules.
+
+
When you have more than one filter defined, you will see the (shuffle up),
+and (shuffle down), options next to each filter. Use these to
+move your filters up or down in the list. The order is important. Your
+messages will be checked for filtering against the top filter first and,
+if the filter is set up for that message, it will be filtered. If no
+matching information is found, the message will be checked against the
+second filter and so on down the list. Messages that do not match any
+filter rules will be delivered to your Inbox.
+
+
Performance considerations:
+
+
The more filters you have defined the longer it will take to run
+ down the list. Deleting unused filters is a good
+ idea.
+
Filtering in newsgroups served by an NNTP server will be slow if your
+ patterns include tests other than "From:" or
+ "Subject:".
+
Filtering a folder served by an IMAP server based on protocol
+ versions prior to 4.
+
This Filter Configuration screen is where you can add new filters
+or modify existing ones.
+
+
In order to determine whether or not a message matches a filter, the
+message is compared with the Filter's Pattern. Once a filter match is
+found for a particular message, there are some actions which may be
+taken.
+
+
NOTE: When you set up a Pattern to delete messages, it is recommended
+that you test the Pattern first with a "Move" folder in case unintended
+matches occur. Messages that are deleted will be removed from the folder
+and may be unrecoverable.
Nickname:
+This is a nickname to help you. You should have a different nickname for
+each filtering rule you define. The nickname will be used in the Message
+Filtering screen to allow you to pick a rule to edit.
+
+
To:
+Any text you enter as the "To pattern" will be compared to the recipients
+from the To: line of messages when WebPine
+opens folders. When the text you entered matches all or part of the To:
+line of a message, then the Filter Action you
+have specified will be carried out. (Any other non-blank parts of the
+Pattern must match, too.)
+
+
You may enter a complete email address, part of an address, or a
+comma-separated list of addresses or partial
+addresses. For example:
+
+
To: = friend@public.com
+ To: = rated.net
+ To: = admin@public.com, admin@msn.com, fool@motleyfool.com
+
+
+
Each of those are valid "To patterns".
+
+
Messages match those patterns if any of the addresses in the To: line
+of the message contains the pattern. If the pattern is a comma-separated
+list of patterns (like the last example above) then it is a match if any
+of the patterns in the list match any of the addresses in the To: line.
+(It is not possible to specify two addresses which must BOTH be present
+for a match. It is only possible to specify that EITHER address1 OR
+address2 must be present. That is exactly what the comma-separated list
+does.)
+
+
Some messages may be "bounced" to you, and will have a "Resent-To:"
+header line. If the message contains a Resent-To: line, WebPine will look
+for matches to your "To: patterns" there, and NOT in the original To:
+line.
+
+
From:
+This is just like the "To pattern" except that it is compared with the
+address in the From: line of the message instead of the addresses from the
+To: line. See the help for the To pattern for more information on header
+patterns.
+
+
Sender:
+This is just like the "To pattern" except that it is compared with the
+address from the Sender: line of the message
+instead of the addresses from the To: line. See the help for the To
+pattern for more information on header patterns.
+
+
Cc:
+This is just like the "To pattern" except that it is compared with the
+addresses from the Cc: line of the message instead of the addresses from
+the To: line. See the help for the To pattern for more information on
+header patterns.
+
+
+
Recipient:
+This is just like the "To pattern" except that it is compared with the
+addresses from both the To: line and the Cc:
+line of the message instead of just the addresses from the To: line. In
+other words, it is considered a match if the
+pattern matches EITHER an address in the To: line OR an address in the Cc:
+line. (Notice that defining the Recipient
+pattern does not have the same effect as defining both the To and Cc
+patterns. Recipient is To OR Cc; not To AND Cc.
+It is equivalent to having two different rules; one with a To pattern and
+the other with the same Cc pattern.)
+
+
+
Participants:
+This is just like the "To pattern" except that it is compared with the
+addresses from the From: line, the To: line, and the Cc: line of the
+message instead of just the addresses from the To: line. In other words,
+it is considered a match if the pattern matches EITHER an address in the
+From: line, OR an address in the To: line, OR an address in the Cc: line.
+(Notice that defining the Participant pattern does not have the same
+effect as defining all of the From, To, and Cc patterns. Participant is
+From OR To OR Cc; not From AND To AND Cc. It is equivalent to having
+three different rules; one with a From pattern, another with the same To
+pattern, and a third with the same Cc pattern.)
+
+
+
Newsgroups:
+If this pattern is non-blank, then for this rule to be considered a match,
+at least one of the newsgroups from the
+Newsgroups line of the message must match this pattern. If this pattern is
+a comma-separated list of patterns, then at
+least one of the newsgroups must match at least one of the patterns. (Any
+other non-blank parts of the Pattern must
+match, too.)
+
+
Subject:
+This is similar to the other parts of the Pattern. It is compared with the
+contents from the Subject of the message.
+
+
If you enter non-ASCII characters in this field then the search will be
+done using the character set you have defined with the "character-set"
+configuration variable. (The truly sophisticated may use an alternate
+character set for a search by entering the MIME encoding of the header
+string here.)
+
+
+
All Text:
+This is similar to the header patterns. Instead of comparing with text in
+a particular header field it is compared with all of the text in the
+message header and body.
+
+
If you enter non-ASCII characters in this field then the search will be
+done using the character set you have defined
+with the "character-set" configuration variable. (The truly sophisticated
+may use an alternate character set for a
+search by entering the MIME encoding of the header string here.)
+
+
It is possible that you may notice degraded performance when using
+AllText Patterns.
+
+
+
Message is New
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be "New" in order to be a
+match; or "No", which means the message must not be "New" in order to be a
+match. "New" is the same as Unseen and not "New" is the same as Seen.
+
+
Message is Deleted
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be marked "Deleted" in
+order to be a match; or "No", which means the message must not be marked
+"Deleted" in order to be a match.
+
+
If you are thinking of using this part of the Pattern as a way to
+prevent messages from being filtered more than once in a Filter Pattern,
+take a look at the Filter Option "move-only-if-not-deleted" instead. It
+should work better than using this field since it will hide the filtered
+messages even if they are already Deleted. That option is at the bottom of
+the Filter configuration screen.
+
+
Message is Important
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be flagged "Important" in
+order to be a match; or "No", which means the message must not be flagged
+"Important" in order to be a match.
+
+
Message is Answered
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be marked "Answered" in
+order to be a match; or "No", which means the message must not be marked
+"Answered" in order to be a match.
+
+
+Filter Actions
+The Filter Action specifies the action to be taken when the Pattern is a
+match. It may be either Delete or Move
+
+
If you set it to "Move", then provide the name of the folder to which
+the matching message should be moved in the corresponding text box. You
+may type a list of folders separated by commas, in which case the message
+will be copied to all of the folders in the list before it is deleted.
+
+Move only if not deleted If you set this option then a message
+will be moved into the specified folder only if it is not marked for
+deletion. This is useful if you have multiple Pine or WebPine sessions
+running simultaneously and you don't want messages to be filtered into a
+folder more than once. It is also useful if you want to filter only the
+"undeleted" messages in a newsgroup into a folder. This method is not
+foolproof. There may be cases where a message gets marked deleted and so
+it is never filtered into the folder. For example, if you deleted it in
+another Pine or WebPine session or another mail program that didn't use
+the filtering rule.
+
+This option has no effect if the Filter Action is not set to Move.
+
+Examples
+To create a filter to move all incoming messages from
+"sue@travelworld.com" to your "Vacation" folder, add the following to the
+Filter Configuration screen:
+Nickname: Travelworld
+From: sue@travelworld.com
+Move filter action:Vacation
+
+Click Save to add the filter.
+
+
To create a filter to delete all incoming messages that contain the
+text "Make Money fast!" in the subject line, add the following to your
+Filter Configuration screen:
+Nickname: Make Money
+Subject: Make Money Fast!
+Delete: (Click next to this option)
+Reminder: It is a very good idea to test this with the "Move to Folder"
+option in case unintended matches occur.
+
+Click Save to add the filter.
+
+
+
+
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/help/folders.html b/web/cgi/alpine/1.0/help/folders.html
new file mode 100644
index 00000000..6e23973b
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/folders.html
@@ -0,0 +1,39 @@
+
+Folder List
+
+
Your email messages are stored in folders. The Folder List screen allows you to
+get to those folders by clicking on the folder name. Manage your folders by doing
+the following:
+
+
+
Delete a folder: Click the radio button corresponding to the correct
+folder and click .
+You will be prompted for confirmation before the folder is actually deleted.
+
Rename a folder: Click the radio button corresponding to the correct
+folder and click
+.
+You will be prompted for confirmation before the folder is actually renamed.
+
Add a folder: Click to go to the Folder Creation
+screen.
+
+
+
If your folder list includes directories (used to contain folders) or
+collections (used to organize folders on different email hosts), you will
+see the following icons:
+
+
+
Click to expand the listing to see the contents
+
Click to collapse the listing and see the top-level only
\""]]
+ } else {
+ lappend help_menu [list {} [list "cgi_puts \"${prefix}\[cgi_url \"[lindex $s 2]\" \"help.tcl?topic=[lindex $s 0]&oncancel=[WPPercentQuote $oncancel]&index=${index}\" class=navbar target=body\]\""]]
+ }
+ }
+ } else {
+ lappend help_menu [list {} [list "cgi_puts \"\[cgi_url \"About Web Alpine\" \"helpbody.tcl?topic=about&oncancel=[WPPercentQuote $oncancel]\" class=navbar target=bodtext\]\""]]
+ if {[string compare [string tolower $index] none]} {
+ lappend help_menu [list {} [list "cgi_puts \"\[cgi_url \"Other Topics\" \"helpindex.tcl?topic=${topic}&index=full&oncancel=[WPPercentQuote $oncancel]\" class=navbar target=bodindx\]\""]]
+ }
+ }
+
+ WPTFCommandMenu help_menu {}
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/index.tcl b/web/cgi/alpine/1.0/index.tcl
new file mode 100755
index 00000000..6a0fa543
--- /dev/null
+++ b/web/cgi/alpine/1.0/index.tcl
@@ -0,0 +1,1972 @@
+# $Id: index.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# index.tcl
+#
+# Purpose: CGI script snippet to generate html output associated
+# with the WebPine message list (index) body frame
+#
+# Input:
+set index_vars {
+ {sort {} date}
+ {rev {} 0}
+ {top {} 0}
+ {uid {} 0}
+ {width {} $_wp(width)}
+ {op {} none}
+ {bod_next {} 0}
+ {bod_last {} 0}
+ {bod_first {} 0}
+ {bod_prev {} 0}
+ {growpage {} 0}
+ {shrinkpage {} 0}
+ {grownum {} 0}
+ {goto {} ""}
+ {gonum {} ""}
+ {select {} ""}
+ {selectop {} ""}
+ {doselect {} 0}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+ {save {} ""}
+ {browse {} ""}
+ {f_name {} ""}
+ {f_colid {} ""}
+ {savecancel {} ""}
+ {promptsave {} ""}
+ {setflag {} ""}
+ {flags {} ""}
+ {repall {} 0}
+ {reptext {} 0}
+ {sortrev {} 0}
+ {sortto {} 0}
+ {sortfrom {} 0}
+ {sortdate {} 0}
+ {sortsize {} 0}
+ {sortsubject {} 0}
+ {sortorderedsubj {} 0}
+ {sortthread {} 0}
+ {queryexpunge {} 0}
+ {expunge {} 0}
+ {cid {} 0}
+ {folders {} 0}
+ {compose {} 0}
+ {submitted {} 0}
+ {zoom {} ""}
+ {mark {} ""}
+ {unmark {} ""}
+ {search {} ""}
+ {aggon {} ""}
+ {aggoff {} ""}
+ {hdron {} ""}
+ {hdroff {} ""}
+ {split {} 0}
+ {spamit {} ""}
+ {reload}
+}
+
+# Output:
+#
+
+# FOR TESTING VARIOUS LAYOUTS AND SUCH
+set do_status_icons 1
+
+set selectverb Search
+
+set growmax 50
+set growverb Increase
+set shrinkverb Decrease
+
+# various color defs
+set color(sortfg) "#FFFFFF"
+set color(sortbg) "#BFBFBF"
+set color(line1) "#EEEEEE"
+set color(line2) "#FFFFFF"
+set color(greyout) "#888888"
+set sb_width 13
+set sb_dir bar
+
+set aggbar 1
+set sortbar 2
+
+set gonum ""
+
+if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg <= 0} {
+ set ppg $_wp(indexlines)
+}
+
+# make sure any caching doesn't screw this setting
+catch {WPCmd PEInfo set wp_spec_script fr_index.tcl}
+
+proc statmsg {s} {
+ global newmail
+
+ lappend newmail [list $s]
+}
+
+proc selectresponse {type num prevnum zoomref topref uidref} {
+ upvar $zoomref zoomed
+ upvar $topref top
+ upvar $uidref uid
+
+ if {$num == 0} {
+ if {$prevnum} {
+ set statmsg "$type search found no additional messages. Set of marked messages unchanged"
+ } else {
+ set statmsg "$type search found no matching messages"
+ }
+ } elseif {$num > 0} {
+ if {$prevnum} {
+ set statmsg "$type search found $num messages. [expr {$num + $prevnum}] total messages now marked."
+ } else {
+ set statmsg "$type search found and marked $num messages"
+ }
+
+ if {!$zoomed} {
+ # force reframing
+ set top "0+0"
+ set uid 0
+ }
+ } else {
+ set statmsg "[set num [expr abs($num)]] messages Unmarked."
+ if {$prevnum > $num} {
+ append statmsg " [expr {$prevnum - $num}] remain Marked."
+ }
+ }
+
+ # update zoomed count or zoom if necessary
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox selected]
+ } elseif {[WPCmd PEInfo feature auto-zoom-after-select] && [WPCmd PEMailbox selected]} {
+ set zoomed [WPCmd PEMailbox zoom 1]
+ #append statmsg ". Those not matching excluded from view."
+ }
+
+ statmsg $statmsg
+ catch {WPCmd PEInfo unset wp_def_search_text}
+}
+
+
+proc sortname {name {current 0}} {
+ global rev me
+
+ switch -- $name {
+ Number { set newname "#" }
+ OrderedSubj { set newname "Ordered Subject" }
+ Arrival { set newname Arv }
+ Status { set newname " " }
+ default { set newname $name }
+ }
+
+ if {$current} {
+ if {$rev > 0} {
+ set text [cgi_imglink increas]
+ set args rev=0
+ } else {
+ set text [cgi_imglink decreas]
+ set args rev=1
+ }
+
+ append newname [cgi_url $text "wp.tcl?page=index&sortrev=1" "title=Reverse $newname ordering" target=body]
+ }
+
+ return $newname
+}
+
+proc lineclass {linenum} {
+ if {$linenum % 2} {
+ return i0
+ } else {
+ return i1
+ }
+}
+
+proc uid_framed {u mv} {
+ foreach m $mv {
+ if {$u == [lindex $m 1]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+proc index_quote {text} {
+ set text [cgi_quote_html $text]
+ regsub -all { } $text {\ } text
+
+ return $text
+}
+
+proc index_part_color {text color} {
+ if {[llength $color] == 2} {
+ set fg [lindex $color 0]
+ set bg [lindex $color 1]
+ return [cgi_span "style=color: $fg; background-color: $bg" $text]
+ } else {
+ return $text
+ }
+}
+
+## read vars
+foreach item $index_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+# check for new mail first since counts
+# and sort order might change...
+if {[catch {WPNewMail $reload ""} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+set cid [WPCmd PEInfo key]
+
+set messagecount [WPCmd PEMailbox messagecount]
+set delcount [WPCmd PEMailbox flagcount deleted]
+set flagcmd [WPCmd PEInfo feature enable-flag-cmd]
+set aggops [WPCmd PEInfo feature enable-aggregate-command-set]
+set aggtabstate [WPCmd PEInfo aggtabstate]
+set zoomed [WPCmd PEMailbox zoom]
+
+set indexheight [WPIndexLineHeight]
+
+if {$split != "0"} {
+ set vtarget fr_bottom
+} else {
+ set vtarget spec
+}
+
+# perform any requested actions
+if {$queryexpunge == 1 || [string compare [string tolower $queryexpunge] expunge] == 0} {
+ if {$delcount > 0} {
+ set fn [WPCmd PEMailbox mailboxname]
+ set oncancel index
+ # delcount, messagecount set above
+ source [WPTFScript expunge]
+ set nopage 1
+ } else {
+ statmsg "No deleted messages to Expunge"
+ }
+} elseif {$expunge == 1
+ || [string compare [string tolower $expunge] expunge] == 0
+ || [string compare [string range [string tolower $expunge] 0 10] "yes, remove"] == 0} {
+ if {$delcount > 0} {
+ if {$delcount < $messagecount
+ || ($delcount == $messagecount
+ && 0 == [catch {cgi_import emptyit}]
+ && 1 == $emptyit)} {
+ set setflags [WPCmd PEMessage $top status]
+ if {[lsearch $setflags "Deleted"] != -1} {
+ set curmsg [WPCmd PEMessage $top number]
+ set nextmsg [WPCmd PEMailbox next $curmsg]
+ set done 0
+ while {$nextmsg > $curmsg && $done == 0} {
+ set nextuid [WPCmd PEMailbox uid $nextmsg]
+ set setflags [WPCmd PEMessage $nextuid status]
+ if {[lsearch $setflags "Deleted"] == -1} {
+ set uid $nextuid
+ set top $uid
+ set done 1
+ } else {
+ set curmsg $nextmsg
+ set nextmsg [WPCmd PEMailbox next $curmsg]
+ }
+ }
+
+ if {$done == 0} {
+ set curmsg [WPCmd PEMessage $top number]
+ set prevmsg [WPCmd PEMailbox next $curmsg -1]
+ while {$prevmsg < $curmsg && $done == 0} {
+ set prevuid [WPCmd PEMailbox uid $prevmsg]
+ set setflags [WPCmd PEMessage $prevuid status]
+ if {[lsearch $setflags "Deleted"] == -1} {
+ set uid $prevuid
+ set top $uid
+ set done 1
+ } else {
+ set curmsg $prevmsg
+ set prevmsg [WPCmd PEMailbox next $curmsg -1]
+ }
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox expunge} blasted] || [string length $blasted]} {
+ statmsg "Expunge problem: $blasted"
+ } else {
+ set delcount 0
+ set messagecount [WPCmd PEMailbox messagecount]
+ if {$messagecount < 1} {
+ set uid 0
+ set top 0
+ set first 1
+ if {$zoomed} {
+ WPCmd PEMailbox zoom 0
+ }
+ } else {
+ if {$top > 0 && ([catch {WPCmd PEMessage $top number} n] || $n <= 0)} {
+ # previous top message is gone, figure new one below
+ set top 0
+ }
+
+ if {$uid > 0 && ([catch {WPCmd PEMessage $uid number} n] || $n <= 0)} {
+ # recently viewed message is gone
+ set uid 0
+ }
+ }
+ }
+ } else {
+ statmsg "
No Messages Expunged!
To prevent unintended deletions, you must check the box on the Expunge Confirmation page to indicate that you acknowledge expunge will leave the folder [WPCmd PEMailbox mailboxname] empty.
"
+ }
+ } else {
+ statmsg "No deleted messages to Expunge"
+ }
+} elseif {$growpage == 1 || [string compare $growverb $growpage] == 0} {
+ if {$grownum <= 0 || $grownum > $growmax} {
+ set grownum 5
+ }
+
+ incr ppg $grownum
+ catch {WPCmd PEInfo set grownum $grownum}
+ WPCmd PEInfo indexlines $ppg
+} elseif {$shrinkpage == 1 || [string compare $shrinkverb $shrinkpage] == 0} {
+ if {$grownum <= 0 || $grownum > $growmax} {
+ set grownum 5
+ }
+
+ incr ppg -$grownum
+ catch {WPCmd PEInfo set grownum $grownum}
+
+ if {$ppg < 1} {
+ set ppg 1
+ }
+
+ WPCmd PEInfo indexlines $ppg
+} elseif {$bod_prev} {
+ set top "$top-$ppg"
+ set uid 0
+} elseif {$bod_first} {
+ set first 1
+ if {$messagecount > 0} {
+ set top [WPCmd PEMailbox uid $first]
+ }
+
+ set uid 0
+} elseif {$bod_next} {
+ set top "$top $ppg"
+ set uid 0
+} elseif {$bod_last} {
+ if {$messagecount > 0} {
+ if {$zoomed} {
+ if {$zoomed > $ppg} {
+ if {[catch {WPCmd PEMailbox uid [WPCmd PEMailbox next [expr {[WPCmd PEMailbox last] - [expr {${ppg} - 1}]}]]} top]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first [WPCmd PEMessage $top number]
+ }
+ }
+ } else {
+ if {[set first [expr {$messagecount - $ppg + 1}]] < 0} {
+ set first 1
+ }
+
+ set top [WPCmd PEMailbox uid $first]
+ }
+ }
+
+ set uid 0
+} elseif {[string length $goto]} {
+ if {[regexp {^([0-9]+)$} $gonum n]} {
+ if {$n > 0 && $n <= [WPCmd PEMailbox last]} {
+ set first $n
+ set uid [WPCmd PEMailbox uid $first]
+ set top $uid
+ set gonum ""
+ } else {
+ statmsg "Jump value $gonum out of range"
+ set goto ""
+ }
+ } else {
+ if {[string length $gonum]} {
+ statmsg "Unrecognized Jump value: $gonum"
+ } else {
+ statmsg "Enter a message number, then click 'Jump'"
+ }
+ }
+} elseif {$promptsave == 1 || [string compare [string tolower $promptsave] save] == 0} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click 'Save'"
+ } else {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_promptsave.tcl]
+ set nopage 1
+ }
+} elseif {$savecancel == 1 || [string compare cancel [string tolower $savecancel]] == 0} {
+ catch {WPCmd PEInfo unset wp_index_script}
+ lappend newmail [list "Save cancelled. Folder not created."]
+} elseif {[string length $browse] && [string compare $browse Browse] == 0} {
+ set uid 0
+ _cgi_set_uservar onselect main
+ _cgi_set_uservar oncancel main
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+} elseif {([string length $save] && ([string compare [string trim $save] OK] == 0 || [string compare [string trim $save] Save] == 0)) || [string compare save [string tolower $op]] == 0} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click 'Save'"
+ } elseif {[catch {cgi_import cancel}] == 0} {
+ statmsg "Save cancelled"
+ } else {
+ set f_name [string trim $f_name]
+ if {[string length $f_name]} {
+ if {[regexp {^([0-9]+)$} $f_colid]} {
+ switch -exact -- $f_name {
+ __folder__prompt__ {
+ set uid 0
+ _cgi_set_uservar onselect {index save=OK}
+ _cgi_set_uservar oncancel index
+ _cgi_set_uservar target body
+ _cgi_set_uservar controls 0
+ source [WPTFScript savecreate]
+ set nopage 1
+ }
+ __folder__list__ {
+ set uid 0
+ _cgi_set_uservar onselect {index save=OK}
+ _cgi_set_uservar oncancel index
+ _cgi_set_uservar target body
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+ }
+ default {
+ if {$auths} {
+ catch {WPCmd PESession nocred $f_colid $f_name}
+ if {[catch {WPCmd PESession creds $f_colid $f_name $user $pass} result]} {
+ lappend newmail ["Cannot set credentials ($f_colid) $f_name: result"]
+ }
+ }
+
+ if {[catch {WPCmd PEFolder exists $f_colid $f_name} reason]} {
+ if {[string compare BADPASSWD [string range $reason 0 8]] == 0} {
+ set oncancel "index.tcl&savecancel=1"
+ set conftext "Create Folder '$f_name'?"
+ lappend params [list page index]
+ lappend params [list save Save]
+ lappend params [list f_name $f_name]
+ lappend params [list f_colid $f_colid]
+ source [WPTFScript auth]
+ set nopage 1
+ } else {
+ lappend newmail [list "Existance test failed: $reason"]
+ }
+ } elseif {$reason == 0} {
+ if {$create == 1 || [string compare create [string tolower $create]] == 0} {
+ if {[catch {WPCmd PEFolder create $f_colid $f_name} reason]} {
+ lappend newmail [list "Create failed: $reason"]
+ } else {
+ set dosave 1
+ }
+ } else {
+ set qstate [list $f_name]
+ set params [list [list page index]]
+ lappend params [list save OK]
+ lappend params [list f_name $f_name]
+ lappend params [list f_colid $f_colid]
+ lappend qstate $params
+
+ if {[catch {WPCmd PEInfo set querycreate_state $qstate}] == 0} {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querycreate.tcl]
+ set nopage 1
+ } else {
+ statmsg "Error saving creation state"
+ }
+ }
+ } else {
+ set dosave 1
+ }
+
+ if {[info exists dosave]} {
+ if {[catch {WPCmd PEMailbox apply save $f_colid $f_name} reason]} {
+ error [list _action "Cannot save to $f_name in $f_colid" $reason]
+ } else {
+ set statmsg "Saved $reason message[WPplural $reason] to $f_name"
+
+ set savedef [WPTFSaveDefault $uid]
+ if {[lindex $savedef 0] == $f_colid} {
+ WPTFAddSaveCache $f_name
+ }
+
+ if {[WPCmd PEInfo feature auto-unselect-after-apply]} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ set statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ set statmsg "No Marked messages to Unmark"
+ } else {
+ append statmsg " and unmarked"
+ }
+ }
+ }
+
+ statmsg $statmsg
+ }
+ }
+ }
+ }
+ } else {
+ statmsg "Unrecognized collection id"
+ }
+ } else {
+ statmsg "Must provide a folder name to Save to"
+ }
+ }
+} elseif {[string compare Set $setflag] == 0 || [string compare Delete $setflag] == 0 || [string compare Undelete $setflag] == 0} {
+ switch -- $setflag {
+ Delete {
+ set flagverb Delete
+ set flags delete
+ }
+ Undelete {
+ set flagverb Undelete
+ set flags undeleted
+ }
+ default {
+ set flagverb Set
+ }
+ }
+
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click '$flagverb'"
+ } else {
+ switch -- $flags {
+ delete {
+ set flagverb "for deletion"
+ if {[catch {WPCmd PEMailbox apply delete} reason]} {
+ set statmsg "Problem deleting: $reason"
+ }
+ }
+ undeleted {
+ set flagverb Undeleted
+ if {[catch {WPCmd PEMailbox apply undelete} reason]} {
+ set statmsg "Problem undeleting: $reason"
+ }
+ }
+ new {
+ set flagverb New
+ if {[catch {WPCmd PEMailbox apply flag ton new} reason]} {
+ set statmsg "Problem setting New flag: $reason"
+ }
+ }
+ read {
+ set flagverb Read
+ if {[catch {WPCmd PEMailbox apply flag not new} reason]} {
+ set statmsg "Problem Unsetting New flag: $reason"
+ }
+ }
+ answered {
+ set flagverb Answered
+ if {[catch {WPCmd PEMailbox apply flag ton ans} reason]} {
+ set statmsg "Problem setting Answered flag: $reason"
+ }
+ }
+ unanswered {
+ set flagverb "Not Answered"
+ if {[catch {WPCmd PEMailbox apply flag not ans} reason]} {
+ set statmsg "Problem Unsetting Answered flag: $reason"
+ }
+ }
+ important {
+ set flagverb "Important"
+ if {[catch {WPCmd PEMailbox apply flag ton imp} reason]} {
+ set statmsg "Problem setting Important flag: $reason"
+ }
+ }
+ unimportant {
+ set flagverb "Not Important"
+ if {[catch {WPCmd PEMailbox apply flag not imp} reason]} {
+ set statmsg "Problem Unsetting Important flag: $reason"
+ }
+ }
+ default {
+ statmsg "Unknown flag set request: $flags"
+ }
+ }
+
+ if {![info exists statmsg]} {
+ set statmsg "$reason message[WPplural $reason] flagged $flagverb"
+ if {[WPCmd PEInfo feature auto-unselect-after-apply]} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ set statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ set statmsg "No Selected messages to Unmark"
+ } else {
+ append statmsg " and unmarked"
+ }
+ }
+ }
+ }
+
+ statmsg $statmsg
+ }
+} elseif {[string length $mark]} {
+ if {[string compare mark [string tolower [lindex $mark 0]]] == 0} {
+ if {[catch {WPCmd PEMailbox select all} result]} {
+ statmsg "Cannot mark all messages: $result"
+ } else {
+ set zm ""
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ set zm ". Message List now displaying all messages."
+ }
+ statmsg "All messages in folder '[WPCmd PEMailbox mailboxname]' marked$zm"
+ }
+ } elseif {[string compare $mark 1] == 0} {
+ if {$zoomed} {
+ statmsg "Messages on page already marked"
+ } elseif {$messagecount > 0} {
+ set p [split $uidpage ","]
+ set s [WPCmd PEMessage [lindex $p 0] number]
+ set e [WPCmd PEMessage [lindex $p end] number]
+
+ if {[catch {WPCmd PEMailbox select broad num $s $e} result]} {
+ statmsg "Cannot mark messages: $result"
+ } else {
+ statmsg "Marked all messages [cgi_underline "on this page"]"
+ }
+ }
+ }
+} elseif {[string length $unmark]} {
+ if {[string compare unmark [lindex [string tolower $unmark] 0]] == 0} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ if {[regexp {[0-9]+} $result] && $result == $messagecount} {
+ set result All
+ }
+
+ statmsg "Unmarked $result Messages"
+ }
+ }
+ } elseif {[string compare $unmark 1] == 0} {
+ if {[catch {WPCmd PEMailbox select clear [split $uidpage ","]} result]} {
+ statmsg "Cannot clear message marks: $result"
+ } else {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ statmsg "Unmarked all messages [cgi_underline "on this page"]"
+ }
+ }
+ }
+} elseif {[string length $select] && [string compare $select $selectverb] == 0} {
+ switch -- $selectop {
+ mark {
+ if {[catch {WPCmd PEMailbox select all} result]} {
+ statmsg "Cannot mark all messages: $result"
+ } elseif {0} {
+ statmsg "All messages marked"
+ }
+ }
+ clear {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ statmsg "Cannot clear all message marks: $result"
+ } elseif {0} {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ statmsg "Unmarked $result messages"
+ }
+ }
+ }
+ text {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_seltext.tcl]
+ set nopage 1
+ }
+ date {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_seldate.tcl]
+ set nopage 1
+ }
+ stat {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_selstat.tcl]
+ set nopage 1
+ }
+ zoom {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "No marked messages to Zoom on"
+ } elseif {$zoomed == 0} {
+ set zoomed [WPCmd PEMailbox zoom 1]
+ }
+ }
+ unzoom {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ }
+ null {
+ }
+ default {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_select.tcl]
+ set nopage 1
+ }
+ }
+} elseif {$zoom != ""} {
+ set z 0
+ if {[WPCmd PEMailbox selected] == 0} {
+ if {[string compare [string tolower [string range $zoom 0 7]] "show all"]} {
+ statmsg "No marked messages to Zoom in on!"
+ }
+ } elseif {$zoomed == 0} {
+ set z 1
+ }
+
+ set zoomed [WPCmd PEMailbox zoom $z]
+} elseif {$doselect == 1} {
+ WPLoadCGIVar result
+
+ if {[string compare new [string tolower $result]] == 0} {
+ catch {WPCmd PEMailbox select none}
+ catch {WPCmd PEMailbox zoom 0}
+ set zoomed 0
+ set result broad
+ }
+
+ set selected [WPCmd PEMailbox selected]
+
+ if {[catch {WPLoadCGIVar cancel}] || [string compare cancel [string tolower $cancel]] != 0} {
+ if {[catch {WPLoadCGIVar by}]} {
+ if {[string length $selectop]} {
+ set by [string tolower [lindex $selectop 1]]
+ } else {
+ statmsg "Unknown Search Option -- Click button associated with desired search"
+ set by unset
+ }
+ }
+
+ switch -- $by {
+ date {
+ WPLoadCGIVar datecase ;# on, since or before
+ WPLoadCGIVar datemon ;# month abbrev: jan, feb etc
+ WPLoadCGIVar dateday ;# day num
+ WPLoadCGIVar dateyear ;# year num
+
+ if {[catch {WPCmd PEMailbox select $result date $datecase $dateyear $datemon $dateday} reason]} {
+ statmsg "Date Search Failed: $reason"
+ } else {
+ selectresponse Date $reason $selected zoomed top uid
+ }
+ }
+ text {
+ WPLoadCGIVar textcase ;# ton, not
+ WPLoadCGIVar field ;# to from cc recip partic subj any
+ WPLoadCGIVar text ;# search string
+
+ if {[catch {WPCmd PEMailbox select $result text $textcase $field $text} reason]} {
+ statmsg "Text Search Failed: $reason"
+ } else {
+ switch -- $field {
+ subj {set fieldtext "\"Subject:\""}
+ from {set fieldtext "\"From:\""}
+ to {set fieldtext "\"To:\""}
+ cc {set fieldtext "\"Cc:\""}
+ recip {set fieldtext "Recipient"}
+ partic {set fieldtext "Participant"}
+ default {set fieldtext "Full text"}
+ }
+
+ selectresponse $fieldtext $reason $selected zoomed top uid
+ }
+ }
+ status {
+ if {[catch {WPLoadCGIVar flag}]} {
+ statmsg "Choose a Status value and then click [cgi_bold "Search Status"]"
+ } else {
+ WPLoadCGIVar statcase
+ if {[catch {WPCmd PEMailbox select $result status $statcase $flag} reason]} {
+ statmsg "Flag Search Failed: $reason"
+ } else {
+ switch -- $statcase {
+ not { set casetext "NOT " }
+ default { set casetext "" }
+ }
+ switch -- $flag {
+ imp {set flagtext Important}
+ new {set flagtext "New status"}
+ ans {set flagtext Answered}
+ del {set flagtext Deleted}
+ }
+ selectresponse "${casetext}${flagtext} status" $reason $selected zoomed top uid
+ }
+ }
+ }
+ unset {
+ if {[catch {WPLoadCGIVar text}] == 0} {
+ catch {WPCmd PEInfo set wp_def_search_text $text}
+ }
+ }
+ default {
+ WPCmd PEInfo statmsg "Unknown Search Option"
+ }
+ }
+ } else {
+ catch {WPCmd PEInfo unset wp_def_search_text}
+ }
+
+ catch {WPCmd PEInfo unset wp_index_script}
+} elseif {$sortrev} {
+ if {$rev} {
+ set rev 0
+ } else {
+ set rev 1
+ }
+} elseif {$sortto} {
+ set sort To
+} elseif {$sortfrom} {
+ set sort From
+} elseif {$sortdate} {
+ set sort Date
+} elseif {$sortsize} {
+ set sort siZe
+} elseif {$sortsubject} {
+ set sort Subject
+} elseif {$sortorderedsubj} {
+ set sort OrderedSubj
+} elseif {$sortthread} {
+ set sort tHread
+} elseif {$folders} {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) folders.tcl]
+ set nopage 1
+} elseif {[string compare reply [string tolower $op]] == 0} {
+ if {0} {
+ set oncancel index
+ set cid [WPCmd PEInfo key]
+ #_cgi_set_uservar style Reply
+ source [WPTFScript compose]
+ set nopage 1
+ }
+ statmsg "Aggregate Reply not implemented yet"
+} elseif {[string compare forward [string tolower $op]] == 0} {
+ statmsg "Aggregate Forward not implemented yet"
+} elseif {[string length $aggon]} {
+ set aggtabstate [expr {$aggtabstate | $aggbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $aggoff]} {
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ statmsg "Message List now displaying all (marked and unmarked) messages"
+ }
+
+ set aggtabstate [expr {$aggtabstate & ~$aggbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $hdron]} {
+ set aggtabstate [expr {$aggtabstate | $sortbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $hdroff]} {
+ set aggtabstate [expr {$aggtabstate & ~$sortbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[catch {WPCmd PEInfo set wp_index_script} script] == 0} {
+ catch {WPCmd PEInfo unset wp_index_script}
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $script]
+ set nopage 1
+} elseif {[string length $spamit]} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click '$spamit'"
+ } else {
+ # create
+
+ # aggregate save
+ if {[info exists _wp(spamsubj)] && [string length $_wp(spamsubj)]} {
+ set spamsubj $_wp(spamsubj)
+ } else {
+ set spamsubj "Spam Report"
+ }
+
+ # aggregate delete
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ set savedef [WPCmd PEMailbox savedefault]
+ if {[WPCmd PEFolder exists [lindex $savedef 0] $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create [lindex $savedef 0] $_wp(spamfolder)
+ }
+
+ WPCmd PEMailbox apply save [lindex $savedef 0] $_wp(spamfolder)
+ } result]} {
+ statmsg "Error Reporting Spam: $result"
+ } elseif {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]
+ && [catch {WPCmd PEMailbox apply spam $_wp(spamaddr) $spamsubj} reason]} {
+ statmsg "Error Sending Spam Notice: $reason"
+ } elseif {[catch {WPCmd PEMailbox apply delete} reason]} {
+ statmsg "Error marking Spam Deleted: $reason"
+ } else {
+ set seld [WPCmd PEMailbox selected]
+ statmsg "$seld spam message[WPplural $seld] reported and flagged for deletion"
+ catch {WPCmd PEMailbox select none}
+ }
+ }
+} elseif {[string compare "set flags" [string tolower $op]] == 0} {
+ if {[catch {WPCmd PEInfo flaglist} flags]} {
+ statmsg "Can't get flags: $flags"
+ } else {
+ # then go thru flag list setting and clearing as needed
+ foreach flag $flags {
+ if {[catch {cgi_import_as $flag val}]} {
+ if {[catch {WPCmd PEMessage $uid flag $flag 0} result]} {
+ statmsg "Can't set $flag: $result"
+ break
+ }
+ } else {
+ set newval [expr {[string compare $val on] == 0}]
+ if {[catch {WPCmd PEMessage $uid flag $flag $newval} result]} {
+ statmsg "Can't set $flag: $result"
+ break
+ }
+ }
+ }
+ }
+}
+
+if {![info exists nopage]} {
+ # set the specified sort order
+ if {[catch {WPCmd PEMailbox sort $sort $rev} currentsort]} {
+ error [list _action Sort $currentsort]
+ }
+
+ if {$aggops} {
+ set selected [WPCmd PEMailbox selected]
+ if {$selected < 1 && $zoomed} {
+ set zoomed 0
+ WPCmd PEMailbox zoom 0
+ statmsg "Message List now displaying all (marked and unmarked) messages"
+ }
+ }
+
+ # "top" is uid of first message in index. n after '+' is relative offset
+ if {$messagecount <= 0} {
+ set first 1
+ set top 0
+ set miv ""
+ } else {
+ if {[regexp {^([0-9]+)([\+\ -])([0-9]+)$} $top dummy u sign offset]} {
+ if {$u == 0 || [catch {WPCmd PEMessage $u number} first]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set top $u
+ }
+
+ if {$offset != 0} {
+ if {[catch {WPCmd PEMailbox next [WPCmd PEMessage $top number] ${sign}${offset}} newfirst] == 0} {
+ set first $newfirst
+ set top [WPCmd PEMailbox uid $newfirst]
+ }
+ }
+ } elseif {[regexp {^[0-9]*$} $top]} {
+ if {$top == 0 || [catch {WPCmd PEMessage $top number} first]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+ } else {
+ statmsg "Invalid UID for first message"
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+
+ # validate first is in range
+ if {$messagecount && $first < [set f [WPCmd PEMailbox first]]} {
+ set first $f
+ set top [WPCmd PEMailbox uid $f]
+ }
+
+ # check framing
+ if {$zoomed} {
+ if {$zoomed < $ppg || [WPCmd PEMessage $top select] == 0} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first [WPCmd PEMessage $top number]
+ }
+
+ set uid $top
+ } else {
+ if {$messagecount < $ppg} {
+ if {![string length $goto]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+ } elseif {$first > $messagecount} {
+ if {[set mdiff [expr {$messagecount - $ppg + 1}]] < 0} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first $mdiff
+ set top [WPCmd PEMailbox uid $mdiff]
+ }
+ }
+ }
+
+ # validate uid
+ # use "size" instead of "number" to work around temporary bug in pinetcld
+ if {$uid != 0 && ([catch {WPCmd PEMessage $uid size} n] || $n <= 0)} {
+ set uid 0
+ }
+
+ set nv [WPCmd PEMailbox nextvector $first $ppg [list indexparts indexcolor status statusbits]]
+ set miv [lindex $nv 0]
+ set charset [lindex $nv 1]
+
+ # hook to keep last viewed message in current message list
+ if {$uid > 0} {
+ if {[catch {WPCmd PEMessage $uid number} n] == 0 && [uid_framed $uid $miv] == 0} {
+ set first $n
+ set top $uid
+ set nv [WPCmd PEMailbox nextvector $first $ppg [list indexparts indexcolor status statusbits ]]
+ set miv [lindex $nv 0]
+ set charset [lindex $nv 1]
+ }
+
+ #set uid 0 ;# no longer "last viewed"
+ #catch {WPCmd PEInfo unset uid}
+ }
+
+ # remember for next time
+ catch {
+ WPCmd PEInfo set top $top
+ WPCmd PEInfo set sort $sort
+ WPCmd PEInfo set rev $rev
+ }
+ }
+
+ if {[llength $miv] == 0
+ || (!([info exists charset] && [string length $charset])
+ && ([catch {WPCmd PEConfig varget character-set} charset]
+ || [string length [set charset [lindex $charset 0]]] == 0
+ || [string compare [string tolower $charset] "us-ascii"] == 0))} {
+ set charset "UTF-8"
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ # start writing page
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ set onload "onLoad="
+ set onunload "onUnload="
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ if {[info exists _wp(timing)]} {
+ set onsubmit "onSubmit=return submitTimestamp()"
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "var loadtime = new Date();"
+ cgi_put "function submitTimestamp(){"
+ cgi_put " var now = new Date();"
+ cgi_put " document.index.submitted.value = now.getTime();"
+ cgi_put " return true;"
+ cgi_puts "}"
+ cgi_put "function fini() {"
+ cgi_put " var now = new Date();"
+ cgi_put " var t_load = (now.getTime() - loadtime.getTime())/1000;"
+ if {$submitted} {
+ cgi_put " var t_submit = (now.getTime() - $submitted)/1000;"
+ set rtt ", rtt = '+t_submit+', cumulative = '+(t_submit + t_load)"
+ } else {
+ set rtt "'"
+ }
+ cgi_put " window.status = 'Page loaded in '+t_load+' seconds${rtt};"
+ cgi_puts "}"
+ }
+ append onload "fini();"
+ } else {
+ set onsubmit ""
+ }
+
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=index"}]
+ if {[info exists _wp(exitonclose)]} {
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function indexReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=index&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "indexReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ WPStyleSheets
+ cgi_puts ""
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function flip(d){"
+ cgi_put " var f = document.index;"
+ cgi_put " if(f && document.implementation){"
+ cgi_put " var e = document.createElement('input');"
+ cgi_puts " var ver = navigator.appVersion;"
+ cgi_put " if(!((ver.indexOf('MSIE')+1) && (ver.indexOf('Macintosh')+1))) e.type = 'hidden';"
+ cgi_put " e.name = 'bod_'+d;"
+ cgi_put " e.value = 1;"
+ cgi_put " f.appendChild(e);"
+ cgi_put " f.submit();"
+ cgi_put " return false;"
+ cgi_put " }"
+ cgi_put " return true;"
+ cgi_puts "}"
+
+ cgi_put "function view(u) {"
+ cgi_put " var f = document.index;"
+ cgi_put " f.target = '$vtarget';"
+ cgi_put " f.page.value = 'fr_view';"
+ cgi_put " f.uid.value = u;"
+ cgi_puts " f.submit();"
+ cgi_puts " return false;"
+ cgi_puts "}"
+
+ cgi_put "function toggleMarks(elobj){"
+ cgi_put " var i, ckd = 1;"
+ cgi_put " for(i = 0; i < document.index.uidList.length; i++)"
+ cgi_put " if(!document.index.uidList\[i\].checked){"
+ cgi_put " ckd = 0;"
+ cgi_put " break;"
+ cgi_put " }"
+ cgi_put " for(i = 0; i < document.index.uidList.length; i++) document.index.uidList\[i\].checked = !ckd;"
+ cgi_put " elobj.src = (ckd) ? '[WPimg markall3]' : '[WPimg marknone3]';"
+ cgi_put " return false;"
+ cgi_puts "}"
+ }
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {if(flip('next')) location = 'wp.tcl?page=body&bod_next=1'}}
+ {{p} {if(flip('prev')) location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{ } {if(flip('next')) location = 'wp.tcl?page=body&bod_next=1'}}
+ {{-} {if(flip('prev')) location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{;} {if(document.index.select) document.index.select.click(); else document.index.aggon.click()}}
+ {{z} {if(document.index.zoom) document.index.zoom.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {$aggops && ($aggtabstate & $aggbar)} {
+ set exclusions document.index.f_name
+ } else {
+ set exclusions ""
+ }
+
+ append onload [WPTFKeyEquiv $kequiv $exclusions]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ catch {WPCmd set help_context index}
+
+ # check for status msg updates
+ foreach s [WPStatusMsgs] {
+ lappend newmail [list $s]
+ }
+
+ if {[llength $newmail]} {
+ WPTFStatusTable $newmail 1 "style=\"padding: 6px 0; color: white\""
+
+ if {!$reload} {
+ WPCmd PEMailbox newmailreset
+ }
+ }
+
+ if {$ppg > 50} {
+ set postmethod post
+ set enctype "multipart/form-data"
+ } else {
+ set postmethod get
+ set enctype "application/x-www-form-urlencoded"
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=$postmethod enctype=$enctype name=index $onsubmit target=body {
+
+ # context line
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class="context" {
+ if {[llength $newmail]} {
+ cgi_table_row {
+ cgi_table_data height=1 bgcolor="#000000" width="100%" colspan=8 {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ }
+ }
+
+ cgi_table_row bgcolor="#999999" {
+ if {$zoomed} {
+ if {[catch {WPCmd PEMailbox messagecount after [lindex [lindex $miv end] 0]} messagesremaining]} {
+ unset messagesremaining
+ }
+
+ set z "[cgi_span class="marked" marked] "
+ set t $zoomed
+ } else {
+ set messagesremaining [expr {$messagecount - ($first + $ppg - 1)}]
+ set t $messagecount
+ set z ""
+ }
+
+ if {[catch {WPCmd PEMailbox messagecount before [lindex [lindex $miv 0] 0]} messagesbefore] == 0 && $messagesbefore > 0} {
+ if {$messagesbefore > $ppg} {
+ set b $ppg
+ } else {
+ set b $messagesbefore
+ }
+
+ switch $b {
+ 1 {
+ set c One
+ set p ""
+ }
+ default {
+ set c $b
+ set p s
+ }
+ }
+
+ set prevtext " [cgi_unbreakable_string "($c on [cgi_url previous wp.tcl?page=body&bod_prev=1 "onClick=return flip('prev')"] page)"]"
+ } else {
+ set messagesbefore 0
+ set prevtext ""
+ }
+
+ if {$messagesbefore <= 0 && $messagesremaining <= 0} {
+ switch $t {
+ 0 {
+ set counttext "[cgi_bold No] ${z}messages in folder"
+ }
+ 1 {
+ set counttext "[cgi_bold Only] ${z}message in folder"
+ }
+ 2 {
+ set counttext "[cgi_bold Both] ${z}messages in folder"
+ }
+ default {
+ set counttext "[cgi_bold All] $t ${z}messages in folder"
+ }
+ }
+ } elseif {$zoomed} {
+ if {$messagesbefore > 0} {
+ if {$messagesremaining > 0} {
+ set counttext "[expr {$messagesbefore + 1}] thru [expr {$zoomed - $messagesremaining}] of $zoomed [cgi_span class="marked" marked] messages"
+ } else {
+ if {[set p [llength $miv]] == 1} {
+ set lasttext ""
+ } else {
+ set lasttext " $p"
+ }
+
+ set counttext "[cgi_bold Last]${lasttext} of $zoomed [cgi_span class="marked" marked] messages"
+ }
+ } else {
+ set counttext "[cgi_bold First] $ppg of $zoomed [cgi_span class="marked" marked] messages"
+ }
+ } else {
+ set n [WPcomma $messagecount]
+
+ if {[lindex [lindex $miv 0] 0] == 1} {
+ set counttext "[cgi_bold First] $ppg of $n messages"
+ } else {
+ set l [lindex [lindex $miv end] 0]
+ if {$l == $messagecount} {
+ if {[set p [llength $miv]] == 1} {
+ set lasttext ""
+ } else {
+ set lasttext " $p"
+ }
+
+ set counttext "[cgi_bold Last]${lasttext} of $n messages"
+ } else {
+ set counttext "Message [WPcomma $first] - [WPcomma $l] of $n"
+ }
+ }
+ }
+
+ cgi_table_data align=left class="context" "style=\"padding-left: 4\"" {
+ cgi_unbreakable {
+ cgi_put "${counttext}[cgi_breakable]${prevtext}"
+ }
+ }
+
+ cgi_table_data align=right {
+ cgi_unbreakable {
+ if {[WPCmd PEInfo feature expunge-without-confirm-everywhere]
+ || ([WPCmd PEInfo feature expunge-without-confirm]
+ && [string compare [string tolower [WPCmd PEMailbox mailboxname]] inbox] == 0)} {
+ set butname expunge
+ cgi_text "emptyit=1" type=hidden notab
+ } else {
+ set butname queryexpunge
+ }
+
+ if {$aggops} {
+ cgi_submit_button "mark=Mark All in Folder" class="navbutton"
+ cgi_submit_button "unmark=Unmark All" class="navbutton"
+
+ cgi_put [cgi_breakable]
+ cgi_submit_button "setflag=Delete" class="navbutton"
+ cgi_submit_button "setflag=Undelete" class="navbutton"
+ if {([info exists _wp(spamaddr)] && [string length $_wp(spamaddr)])
+ || ([info exists _wp(spamfolder)] && [string length $_wp(spamfolder)])} {
+ cgi_submit_button "spamit=Report Spam" class="navbutton" "style=\" color: white; background-color: black\""
+ }
+ }
+
+ cgi_submit_button "${butname}=Expunge" class="navbutton"
+ }
+ }
+ }
+ }
+
+ cgi_text "page=index" type=hidden notab
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "first=$first" type=hidden notab
+ cgi_text "uid=0" type=hidden notab
+ cgi_text "top=$top" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+ cgi_text "submitted=0" type=hidden notab
+
+ if {$aggops} {
+ if {[llength $miv]} {
+ foreach v $miv {
+ lappend uv [lindex $v 1]
+ }
+
+ set uidpage [join $uv ","]
+ } else {
+ set uidpage ""
+ }
+
+ cgi_text "uidpage=${uidpage}" type=hidden notab
+
+ if {$aggtabstate & $aggbar} {
+ # commands
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=ops {
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 align=left {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ cgi_table_row {
+ cgi_put "
"
+
+ cgi_table_data align=center valign=middle nowrap class=aggop width=30% {
+ cgi_puts ""
+ }
+
+ cgi_table_data align=center valign=middle nowrap class=aggop width=30% {
+ cgi_puts ""
+ }
+
+ cgi_table_data align=center valign=middle class=aggop width=40% {
+ cgi_puts ""
+ }
+ }
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ } elseif {$aggtabstate & $sortbar} {
+ # aggop bar
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=ops {
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 align=left {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_image_button aggon=[WPimg baropen] border=0 alt=\"Show Search/Save Commands\"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table cellspacing=0 cellpadding=0 width="100%" class="itable" {
+ if {$messagecount < 1} {
+ # special case for mailbox with no messges
+ cgi_table_row {
+ cgi_table_data class=body valign=middle height=[expr {($ppg + 1) * $indexheight}] {
+ cgi_center {
+ cgi_puts [cgi_font size=+2 "\[Folder \"[WPCmd PEMailbox mailboxname]\" contains no messages\]"]
+ }
+ }
+ }
+ } else {
+
+ # get the desired index item order and spacing
+ set iformat [WPCmd PEMailbox indexformat]
+
+ set colspan [expr {[llength $iformat] + 1}]
+
+ # setup per-column layout parameters
+ foreach fmt $iformat {
+
+ if {[info exists oncethru]} {
+ if {![info exists firstcell]} {
+ set class icell0
+ set firstcell 1
+ } else {
+ set class icell
+ }
+
+ append layout " $class "
+ }
+
+ set oncethru 1
+
+ switch -regexp -- [lindex $fmt 0] {
+ [Ss]tatus {
+ # fixed with "envelope" icon
+ if {[string length [lindex $fmt 2]]} {
+ set width "1%"
+ } else {
+ set width "42px"
+ }
+ }
+ default {
+ # proportion computed by pith (may be user specified)
+ if {[regexp {[0123456789]+[%]} [lindex $fmt 1]]} {
+ set width [lindex $fmt 1]
+ } else {
+ set width "1%"
+ }
+ }
+ }
+
+ append layout "$width"
+ }
+
+ append layout " icell0"
+
+ #set doscrollbar [expr {($zoomed && $zoomed > $ppg) || (!$zoomed && $messagecount > $ppg)}]
+ set linenum 1
+
+ # paint the index line column headers
+ cgi_table_row class=\"gradient\" {
+ if {($aggtabstate & $sortbar) == 0} {
+ if {!([info exists headertab] && [string length $headertab])} {
+ cgi_table_data class=indexhdr align=left width=48px background=[WPimg baropen_mid] {
+ if {$aggops && ($aggtabstate & $aggbar) == 0} {
+ cgi_image_button aggon=[WPimg baropen] border=0 alt=\"Show Search/Save Commands\"
+ }
+
+ cgi_image_button hdron=[WPimg baropen] border=0 alt=\"Show List Headers\"
+ }
+
+ foreach fmt $iformat {width class} $layout {
+ cgi_table_data class=indexhdr align=left width=$width background=[WPimg baropen_mid] {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ } else {
+ if {$aggops} {
+ cgi_table_data height=100% align=left valign=bottom class=indexhdr width=\"40px\" {
+ cgi_table width=\"100%\" cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data align=left valign=bottom {
+ cgi_image_button hdroff=[WPimg barclose] border=0 "alt=\"Hide List Headers\""
+ }
+ cgi_table_data align=center valign=middle "style=\"padding-right: 14px\"" {
+ set marked 1
+ foreach v $miv {
+ set u [lindex $v 1]
+ if {$u == 0 || ![WPCmd PEMessage $u select]} {
+ set marked 0
+ break
+ }
+ }
+
+ if {$marked} {
+ cgi_image_button unmark=[WPimg marknone3] border=0 alt=\"Unmark Messages on Page\" "onClick=return toggleMarks(this);"
+ } else {
+ cgi_image_button mark=[WPimg markall3] border=0 alt=\"Mark Messages on Page\" "onClick=return toggleMarks(this);"
+ }
+ }
+ }
+ }
+ }
+ } else {
+ cgi_td class=indexhdr [cgi_nbspace]
+ }
+
+ set sorts [string tolower [WPCmd PEMailbox sortstyles]]
+
+ foreach fmt $iformat {width class} $layout {
+ set title [lindex $fmt 0]
+ catch {unset sortlist}
+
+ if {[lsearch -exact $sorts [string tolower $title]] >= 0} {
+ if {[string compare [string tolower [lindex $currentsort 0]] [string tolower $title]] == 0} {
+ lappend sortlist [list indexsort [sortname $title 1]]
+ } else {
+ lappend sortlist [list indexhdr [cgi_url [sortname $title] wp.tcl?page=index&sort[string tolower $title]=1 class=indexhdr title='Sort by $title' target=body]]
+ }
+
+ # special subject sort handling
+ switch -regexp -- $title {
+ [Ss]ubject { lappend extrasort OrderedSubj ; lappend extrasort Thread }
+ [Ff]rom { lappend extrasort To }
+ x[Dd]ate { lappend extrasort Arrival }
+ }
+
+ if {[info exists extrasort]} {
+ foreach s $extrasort {
+ lappend sortlist [list indexhdr [cgi_bold "|"]]
+ # append text [cgi_nbspace][cgi_bold "|"][cgi_nbspace]
+ if {[string compare [string tolower [lindex $currentsort 0]] [string tolower $s]] == 0} {
+ if {[string compare [string tolower $s] thread] == 0} {
+ set threadsort 1
+ }
+ lappend sortlist [list indexsort [sortname $s 1]]
+ } else {
+ lappend sortlist [list indexhdr [cgi_url [sortname $s] wp.tcl?page=index&sort[string tolower $s]=1 class=indexhdr title='Sort by $s' target=body]]
+ }
+ }
+
+ # clear for next time
+ unset extrasort
+ }
+ } else {
+ lappend sortlist [list indexhdr [sortname $title]]
+ }
+
+ cgi_table_data class=indexhdr valign=middle class=$class width="$width" {
+ cgi_table border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ foreach s $sortlist {
+ cgi_table_data class=[lindex $s 0] nowrap {
+ cgi_puts [lindex $s 1]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {[info exists use_plus_minus_to_grow_shrink]} {
+ # grow/shrink controls
+ cgi_table_data class=indexhdr {
+ cgi_image_button growpage=[WPimg plus2] height=12 border=0 alt="Grow"
+ cgi_image_button shrinkpage=[WPimg minus2] height=12 border=0 alt="Shrink"
+ }
+ }
+ }
+ }
+
+ if {$zoomed} {
+ cgi_table_row {
+ cgi_table_data class=marked0 colspan=$colspan align=center {
+ cgi_puts "Unmarked Messages are NOT Shown - Click [cgi_url "Show All Messages" wp.tcl?page=body&zoom=0] to View All"
+ #cgi_puts "Unmarked Messages Are Excluded From View"
+ }
+ }
+ }
+
+ # get ready to map thread images
+ if {[string compare [string tolower [lindex $currentsort 0]] thread] == 0} {
+ set barblank [WPThreadImageLink barblank $indexheight]
+ set barvert [WPThreadImageLink barvert $indexheight]
+ if {[lindex $currentsort 1]} {
+ set barmsg [WPThreadImageLink ibarmsg $indexheight]
+ } else {
+ set barmsg [WPThreadImageLink barmsg $indexheight]
+ }
+
+ if {[lindex $currentsort 1]} {
+ set barvertmsg [WPThreadImageLink ibarvertmsg $indexheight]
+ } else {
+ set barvertmsg [WPThreadImageLink barvertmsg $indexheight]
+ }
+ }
+
+ foreach v $miv {
+ set n [lindex $v 0]
+ set u [lindex $v 1]
+ set msg [lindex [lindex $v 2] 0]
+ set linecolor [lindex [lindex $v 2] 1]
+ set stat [lindex [lindex $v 2] 2]
+ set statbits [lindex [lindex $v 2] 3]
+
+ set class [lineclass [incr linenum]]
+
+ if {$n > $messagecount} {
+ break
+ }
+
+ if {[llength $linecolor] == 2 && [string compare [lindex $linecolor 0] [lindex $linecolor 1]]} {
+ set style "color: #[lindex $linecolor 0] ; background-color: #[lindex $linecolor 1]"
+ } else {
+ set style ""
+ }
+
+ cgi_table_row class=$class "style=\"$style\"" {
+ if {$u == 0} {
+ cgi_table_data colspan=$colspan height=$indexheight {
+ cgi_put "Data for message $n no longer available"
+ }
+ } else {
+ if {$aggops} {
+ cgi_table_data valign=middle align=center height=$indexheight {
+ if {[WPCmd PEMessage $u select]} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_checkbox "uidList=$u" $checked class=$class id=cb$u "style=\"$style; margin-left: 16\""
+ }
+ } else {
+ cgi_td height=$indexheight width=2% [cgi_nbspace]
+ }
+
+ set deleted [string index $stat 0]
+ set recent [expr {[string range $stat 0 2] == "010"}]
+
+ foreach part $msg fmt $iformat {width class} $layout {
+
+ set align ""
+ set onclick ""
+
+ switch -exact -- [lindex $fmt 0] {
+ Subject {
+ set parttext ""
+ set leading ""
+ foreach p $part {
+ switch -- [lindex $p 2] {
+ threadinfo {
+ append leading [lindex $p 0]
+ regsub -all {[ ][ ]} $leading $barblank leading
+ regsub -all {[|][-]} $leading $barvertmsg leading
+ regsub -all {[\\][-]} $leading $barmsg leading
+ regsub -all {[|]} $leading $barvert leading
+ }
+ xthreadinfo {
+ set t [lindex $p 0]
+ append leading "$t"
+ for {set i 0} {$i < [string length $t]} {incr i} {
+ switch -- [string index $t $i] {
+ " " {
+ append leading [WPThreadImageLink barblank $indexheight]
+ }
+ ">" {
+ }
+ "-" {
+ if {[lindex $currentsort 1]} {
+ append leading [WPThreadImageLink ibarmsg $indexheight]
+ } else {
+ append leading [WPThreadImageLink barmsg $indexheight]
+ }
+ }
+ "|" {
+ append leading [WPThreadImageLink barvert $indexheight]
+ }
+ }
+ }
+ }
+ default {
+ append parttext [index_part_color [index_quote [lindex $p 0]] [lindex $p 1]]
+ }
+ }
+ }
+
+ if {[string length [set label $parttext]] == 0} {
+ set label {[Empty Subject]}
+ }
+
+ set text [cgi_url $label "fr_view.tcl?&uid=$u&c=[string range $cid 0 5]" target=$vtarget "onClick=return view($u)"]
+
+ if {![info exists do_status_icons] && $deleted} {
+ set text [cgi_span "style=text-decoration: line-through" $text]
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"height: $indexheight; overflow: hidden;\"" {
+ cgi_put "${leading}${text}"
+ }
+ }]
+ }
+ Status {
+ if {[string length [lindex $fmt 2]]} {
+ set text ""
+ foreach i $part {
+ regsub -all { } [lindex $i 0] {\ } statstr
+ if {[llength [lindex $i 1]]} {
+ append text [cgi_span "style=background-color: #[lindex [lindex $i 1] 1]; color: #[lindex [lindex $i 1] 0]" $statstr]
+ } else {
+ append text $statstr
+ }
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"font-family: monospace\"" {
+ cgi_put $text
+ }
+ }]
+ } elseif {[info exists do_status_icons]} {
+ set text [WPStatusImg $u]
+ } else {
+ set text [lindex [WPStatusIcon $u gif $statbits] 2]
+ set align align=center
+ }
+
+ if {$flagcmd} {
+ set text [cgi_url $text fr_flags.tcl?uid=$u target=body]
+ }
+ }
+ Size {
+ set text [index_part_color [index_quote [lindex [lindex $part 0] 0]] [lindex $part 1]]
+ set class isize
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ Number {
+ set text [index_part_color [index_quote [WPcomma [string trim [lindex [lindex $part 0] 0]]]] [lindex $part 1]]
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ From -
+ To {
+ set t [index_quote [lindex [lindex $part 0] 0]]
+ if {$recent} {
+ set t [cgi_bold $t]
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"height: $indexheight; overflow: hidden;\"" {
+ cgi_put [index_part_color $t [lindex $part 1]]
+ }
+ }]
+
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ default {
+ set text [index_part_color [index_quote [lindex [lindex $part 0] 0]] [lindex $part 1]]
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ }
+
+ if {![info exists text]} {
+ set text doh
+ }
+
+ cgi_td $align class="$class" $onclick "$text"
+ }
+
+ if {[info exists use_plus_minus_to_grow_shrink]} {
+ cgi_td [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ for {} {$linenum <= $ppg} {incr linenum} {
+ cgi_table_row class="[lineclass [expr $linenum + 1]]" {
+ cgi_table_data colspan=$colspan height=$indexheight {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ if {[info exists use_bottom_text_to_grow_shrink]} {
+ cgi_table_row height=1 {
+ cgi_table_data bgcolor=#000000 colspan=$colspan {
+ cgi_put [cgi_img [WPimg blackdot] height=1]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle colspan=$colspan class=indexhdr {
+ cgi_put "[WPcomma $ppg] messages are in the list above. Press either "
+ cgi_submit_button growpage=$growverb class=indexhdr "style=\"vertical-align:middle\""
+ cgi_put " or "
+ cgi_submit_button shrinkpage=$shrinkverb class=indexhdr "style=\"vertical-align:middle\""
+ cgi_put " to change this by "
+ cgi_select grownum class=indexhdr "style=\"vertical-align:middle\"" {
+ set growsizes {1 5 10 25 50}
+
+ if {[catch {WPCmd PEInfo set grownum} lastsize]} {
+ set lastsize 0
+ }
+
+ foreach size $growsizes {
+ if {$size == $lastsize} {
+ set sel selected
+ } else {
+ set sel ""
+ }
+
+ cgi_option $size value=$size $sel
+ }
+ }
+ cgi_put "."
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table width=100% cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data align=left class=context {
+ if {[info exists messagesremaining] && $messagesremaining > 0} {
+ if {$messagesremaining > $ppg} {
+ set moretext ", $ppg"
+ } else {
+ set moretext ""
+ }
+
+ if {$zoomed} {
+ set marked " [cgi_bold marked]"
+ } else {
+ set marked ""
+ }
+
+ set nexttext " ([WPcomma $messagesremaining] more${marked} message[WPplural $messagesremaining]${moretext} on [cgi_url next wp.tcl?page=body&bod_next=1 "onClick=return flip('next')"] page)"
+ } else {
+ set nexttext ""
+ }
+
+ cgi_puts "[cgi_nbspace]${counttext}${nexttext}"
+ }
+ cgi_table_data align=right class=context {
+ cgi_put "Powered by [cgi_url Alpine "http://www.washington.edu/alpine/" target="_blank"] - [cgi_copyright] 2007 University of Washington"
+ if {[info exists _wp(ui2dir)]} {
+ cgi_puts " - [cgi_url "Standard Version " "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/browse" target=_top]"
+ }
+ }
+ }
+ }
+
+ if {[info exists _wp(cumulative)]} {
+ set l [string length $_wp(cumulative)]
+ if {$l < 6} {
+ set sl "."
+ while {$l < 6} {
+ append sl "0"
+ incr l
+ }
+ append sl $_wp(cumulative)
+ } else {
+ set sl "[string range $_wp(cumulative) 0 [expr $l - 7]].[string range $_wp(cumulative) [expr $l - 6] end]"
+ }
+
+ set servlettime "servlet = $sl"
+
+ if {[info exists wp_global_loadtime]} {
+ set clickdiff [expr {[clock clicks] - $wp_global_loadtime}]
+ # 500165 clicks/second
+ set st [expr ([string range $clickdiff 0 [expr [string length $clickdiff] - 4]] * 1000) / 500]
+ set l [string length $st]
+ set scripttime "tcl = [string range $st 0 [expr $l - 4]].[string range $st [expr $l - 3] end], "
+ } else {
+ set scripttime ""
+ }
+
+ cgi_puts [cgi_font size=-2 "style=font-family:arial;font-weight:bold" "\[time: ${scripttime}${servlettime}\]"]
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapbrowse.tcl b/web/cgi/alpine/1.0/ldapbrowse.tcl
new file mode 100755
index 00000000..e8436fd3
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapbrowse.tcl
@@ -0,0 +1,220 @@
+#!./tclsh
+# $Id: ldapbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapbrowse.tcl
+#
+# Purpose: CGI script to browse ldap results
+
+# Input: [expected to be set when we get here]
+set browse_vars {
+ {field "Missing Field Name"}
+ {ldapquery "Missing LDAP Query Number"}
+ {addresses "" ""}
+ {oncancel "" ""}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set ldapres_cmds {
+ {
+ {}
+ {
+ {
+ # * * * * USE ADDRESSES * * * *
+ cgi_submit_button "address=Address" class="navtext"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button "cancel=Cancel" class="navtext"
+ }
+ }
+ }
+}
+
+WPEval $browse_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ if {$ldapquery != 0} {
+ if {[catch {WPCmd PELdap results $ldapquery} results]} {
+ WPCmd PEInfo statmsg "Some sort of ldap problem"
+ }
+ }
+
+ cgi_head {
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=ldapaddr target=_top {
+ cgi_text "page=ldappick" type=hidden notab
+ cgi_text "ldapquery=$ldapquery" type=hidden notab
+ cgi_text "field=$field" type=hidden notab
+ cgi_text "addresses=[cgi_unquote_input $addresses]" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu ldapres_cmds {}
+ }
+ }
+
+ cgi_table_data valign=top width=100% class=dialog {
+ if {$ldapquery == 0} {
+ cgi_puts [cgi_italic "No matches found"]
+ } else {
+ cgi_table align=center width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=middle {
+ cgi_br
+ cgi_put "Below are directory entries matching text expanded from your message's $field field. Choose the addressees you want, then Click [cgi_bold Address]."
+ cgi_br
+ cgi_br
+ }
+ }
+ }
+
+ set numboxes 0
+ set srchindex 0
+ cgi_table border=0 cellpadding=0 cellspacing=0 align=center width=96% {
+ foreach searchres $results {
+ set srchstr [lindex $searchres 0]
+ set retdata [lindex $searchres 1]
+ set expstr ""
+ cgi_table_row {
+ cgi_table_data {
+
+ if {$srchstr != ""} {
+ set expstr " for \"[cgi_bold $srchstr]\""
+ }
+
+ cgi_text "str${srchindex}=${srchstr}" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=1 width=100% {
+ cgi_table_row {
+ cgi_table_data colspan=32 valign=middle height=20 class=ops {
+ cgi_puts "[cgi_nbspace]Directory Search Results${expstr}"
+ }
+ }
+
+ set whitebg 1
+ set nameindex 0
+ set onetruebox 0
+ set numsrchboxes 0
+ foreach litem $retdata {
+ if {[llength [lindex $litem 4]] > 0} {
+ incr numsrchboxes
+ if {$numsrchboxes > 1} {
+ break
+ }
+ }
+ }
+ if {$numsrchboxes == 1} {
+ set onetruebox 1
+ }
+ foreach litem $retdata {
+ set name [lindex $litem 0]
+ set email [lindex $litem 4]
+ set nomail 0
+ if {$whitebg == 1} {
+ set bgcolor #FFFFFF
+ set whitebg 0
+ } else {
+ set bgcolor #EEEEEE
+ set whitebg 1
+ }
+ if {[llength $email] < 1} {
+ incr nameindex
+ continue
+ set nomail 1
+ }
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data valign=top nowrap {
+ if {$nomail == 1} {
+ cgi_puts " "
+ } else {
+ if {$onetruebox == 1} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+ cgi_checkbox "ldapList=${srchindex}.${nameindex}" style="background-color:$bgcolor" $checked
+ incr numboxes
+ }
+ }
+
+ cgi_table_data valign=top nowrap {
+ regsub -all "<" $name "\\<" name
+ regsub -all ">" $name "\\>" name
+ cgi_puts "$name"
+ }
+ cgi_table_data valign=top nowrap {
+ if {[llength $email] > 1} {
+ cgi_table width=100% {
+ foreach eaddr $email {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_font size=-1 "style=font-family:courier_new,monospace" "[cgi_lt]${eaddr}[cgi_gt]"]
+ }
+ }
+ }
+ }
+ } else {
+ if {$nomail == 1} {
+ cgi_puts "\[No email information\]"
+ } else {
+ cgi_puts [cgi_font size=-1 "style=font-family:courier_new,monospace" "[cgi_lt][lindex $email 0][cgi_gt]"]
+ }
+ }
+ }
+ }
+ incr nameindex
+ }
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ incr srchindex
+ }
+ }
+ cgi_text "numboxes=${numboxes}" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapentry.tcl b/web/cgi/alpine/1.0/ldapentry.tcl
new file mode 100755
index 00000000..a483f165
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapentry.tcl
@@ -0,0 +1,315 @@
+#!./tclsh
+# $Id: ldapentry.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapentry.tcl
+#
+# Purpose: CGI script to submit ldap search
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {qn "Missing Query Number"}
+ {si "Missing Search Index"}
+ {ni "Missing Name Index"}
+ {email "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+# Command Menu definition for Message View Screen
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * ldap Query * * * *
+ cgi_puts [cgi_url "Back to Search Results" ldapresult.tcl?dir=${dir}&qn=${qn} class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {expr {$email > 0}}
+ {
+ {
+ # * * * * Compose To * * * *
+ cgi_puts [cgi_url "Send Mail To This Person" compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&cid=[WPCmd PEInfo key]&oncancel=addrbook class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ if {$qn != 0} {
+ if {[catch {WPCmd PELdap results $qn} results]} {
+ WPCmd PEInfo statmsg "Some sort of ldap problem"
+ }
+ }
+
+ cgi_head {
+ WPStdHtmlHdr "LDAP Entry"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ cgi_table_data valign=top rowspan=4 class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=\"margin-top:4;margin-bottom:4\"" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu ldap_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+
+ cgi_table_data valign=top align=center class=dialog width=100% {
+ if {$qn == 0} {
+ cgi_puts [cgi_italic "No matches found"]
+ } else {
+ if {[catch {WPCmd PELdap ldapext $qn "${si}.${ni}"} leinfo]} {
+ cgi_br
+ cgi_puts [cgi_italic "Error getting entry: $leinfo"]
+ } else {
+
+ set lehead [lindex $leinfo 0]
+ set ledata [lindex $leinfo 1]
+
+ foreach item $ledata {
+ if {[string compare [string tolower [lindex $item 0]] name] == 0} {
+ set entry_name [lindex [lindex $item 1] 0]
+ break
+ }
+ }
+
+ cgi_division "style=\"padding:10\"" {
+ cgi_puts [cgi_font size=+1 "Directory Entry for \"$entry_name\""]
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=80% "style=\"border: 1px solid goldenrod; padding: 2\"" {
+
+ set bgwhite 1
+ foreach item $ledata {
+ switch -exact -- [string tolower [lindex $item 0]] {
+ name {
+ continue;
+ }
+ voicemailtelephonenumber {
+ set fieldname "Voice Mail"
+ }
+ "email address" {
+ set do_email 1
+ set fieldname [lindex $item 0]
+ }
+ "fax telephone" {
+ set do_fax 1
+ set fieldname [lindex $item 0]
+ }
+ default {
+ set fieldname [lindex $item 0]
+ }
+ }
+
+ set itematt ""
+ if {[llength $item] > 2} {
+ set itematt [lindex $item 2]
+ }
+ if {$itematt == "objectclass"} {
+ set vals [lindex $item 1]
+ continue
+ }
+
+ if {$bgwhite == 1} {
+ set bgcolor #ffffff
+ set bgwhite 0
+ } else {
+ set bgcolor #eeeeee
+ set bgwhite 1
+ }
+
+ set vals [lindex $item 1]
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data width=25% nowrap valign=top rowspan=[llength $vals] {
+ cgi_division "style=\"padding-top:2\"" {
+ cgi_puts [cgi_bold $fieldname]
+ }
+ }
+
+ cgi_table_data rowspan=[llength $vals] {
+ cgi_puts [cgi_img [WPimg dot2] width=8]
+ }
+
+ cgi_table_data height=20px {
+ if {[info exists do_fax]} {
+ set n {[0-9]}
+ set n3 $n$n$n
+ set n4 $n$n$n$n
+ if {[regexp "^\\\+1 ($n3) ($n3)-($n4)\$" [lindex $vals 0] dummy areacode prefix number] && [lsearch -exact {206 425} $areacode] >= 0} {
+ cgi_puts [cgi_url [lindex $vals 0] compose.tcl?ldap=1&fax=yes&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [lindex $vals 0]
+ }
+
+ unset do_fax
+ } elseif {[info exists do_email]} {
+ cgi_puts [cgi_url [cgi_font size=-1 face=courier [lindex $vals 0]] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [lindex $vals 0]
+ }
+
+ set extrarows [lrange $vals 1 end]
+ }
+ }
+
+ if {[info exists extrarows]} {
+ cgi_table_row bgcolor=$bgcolor {
+ set ei 0
+ foreach extra $extrarows {
+ cgi_table_data height=20px {
+ if {[info exists do_email]} {
+ cgi_puts [cgi_url [cgi_font size=-1 face=courier $extra] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&ei=[incr ei]&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts $extra
+ }
+ }
+ }
+ }
+
+ unset extrarows
+ }
+
+ catch {unset do_email}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/ldappick.tcl b/web/cgi/alpine/1.0/ldappick.tcl
new file mode 100755
index 00000000..4a485266
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldappick.tcl
@@ -0,0 +1,76 @@
+# $Id: ldappick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldappick.tcl
+#
+# Purpose: CGI script to handle LDAP result choices from the
+# via the LDAP result browser generated form
+
+# Input:
+set pick_vars {
+ {cid "Missing Command ID"}
+ {field "Missing Field Name"}
+ {ldapquery "Missing LDAP Query"}
+ {ldapList "" ""}
+ {addresses "" ""}
+ {addrop {} ""}
+ {cancel {} 0}
+}
+
+# Output:
+#
+
+# read vars
+foreach item $pick_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+if {$cancel != 1 && !([string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $addrop]] == 0) && [string length $ldapList] > 0} {
+ set ldapListStr [join $ldapList ","]
+ if {[catch {WPCmd PELdap setaddrs $ldapquery $ldapListStr $addresses 0} newaddrlist]} {
+ WPCmd PEInfo statmsg "LDAP Error: $newaddrlist"
+ } else {
+ regsub -all "'" $newaddrlist "\\'" newaddrs
+
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata]} {
+ WPCmd PEInfo statmsg "Cannot read message data: $msgdata"
+ } else {
+ if {[info exists newaddrs]} {
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ set orig_field [lindex [lindex $msgdata $i] 0]
+ regsub -all -- - [string tolower $orig_field] _ fn
+
+ if {[string compare $fn $field] == 0} {
+ set msgdata [lreplace $msgdata $i $i [list $orig_field $newaddrs]]
+ break
+ }
+ }
+
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} result]} {
+ WPCmd PEInfo statmsg "Cannot Update $field field: $result"
+ }
+ }
+ }
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/ldapquery.tcl b/web/cgi/alpine/1.0/ldapquery.tcl
new file mode 100755
index 00000000..c9ca6936
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapquery.tcl
@@ -0,0 +1,144 @@
+#!./tclsh
+# $Id: ldapquery.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapquery.tcl
+#
+# Purpose: CGI script to handle ldap query
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_puts [cgi_url "Get Help" "wp.tcl?page=help&oncancel=addrbook" target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/ldapresult.tcl?dir=${dir}&srchstr=[WPPercentQuote ${srchstr}]&field=${field}&op=${op}&searchtype=${searchtype}&sessid=${sessid}"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top rclass=navbar {
+ WPTFCommandMenu {} {}
+ }
+
+ cgi_table_data valign=top bgcolor=#ffffff width=100% {
+ cgi_table border=0 width=500 cellpadding=3 {
+ cgi_table_row {
+ cgi_table_data align=center "style=\"padding-top:120px\"" {
+ cgi_put "[cgi_font "style=\"font-family: arial, sans-serif; font-size:18pt; font-weight: bold\"" "Searching Directory "][cgi_img [WPimg dotblink]]"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapresult.tcl b/web/cgi/alpine/1.0/ldapresult.tcl
new file mode 100755
index 00000000..efdce665
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapresult.tcl
@@ -0,0 +1,375 @@
+#!./tclsh
+# $Id: ldapresult.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapquery.tcl
+#
+# Purpose: CGI script to submit ldap search
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+ {qn {} -1}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Command Menu definition for Message View Screen
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_puts [cgi_url "Get Help" "wp.tcl?page=help&oncancel=addrbook" target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ if {$qn == -1} {
+ set ldapfilt ""
+ set numfields 0
+ if {$searchtype == 1} {
+ set srchstr ""
+ source ldapadvsrch.tcl
+ foreach item $ldap_advanced_search {
+ WPLoadCGIVarAs [lindex $item 1] tmpval
+ regsub {^ *([^ ]|[^ ].*[^ ]) *$} $tmpval "\\1" tmpval
+ if {$tmpval != ""} {
+ set ldapfilt "${ldapfilt}([lindex $item 2]=${tmpval})"
+ incr numfields
+ }
+ }
+ if {$numfields > 1} {
+ set ldapfilt "(&${ldapfilt})"
+ }
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "LDAP Query Result"
+ WPStyleSheets
+ cgi_puts ""
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=addrbook'}}
+ }
+
+ lappend kequiv
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv]"
+ } else {
+ set onload ""
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" $onload {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ cgi_table_data valign=top rowspan=4 class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=\"margin-top:4;margin-bottom:4\"" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu ldap_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog width=100% {
+
+ if {$qn == -1 && [catch {WPCmd PELdap query $dir $srchstr $ldapfilt} qn]} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts "A problem has occured while trying to search the directory server."
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_italic [cgi_bold "$qn"]]
+ cgi_br
+ cgi_br
+ cgi_puts "Try searching again by clicking [cgi_url "Address Book" wp.tcl?page=addrbook target=_top] at the left."
+ }
+ } elseif {$qn == 0} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts [cgi_bold "No matches for \"$srchstr\" found."]
+ cgi_br
+ cgi_br
+ cgi_puts "You can try another search below, or click a link at the left to continue your WebPine session."
+ cgi_br
+ cgi_br
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=ldapsearch target=_top {
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "page=ldapquery" type=hidden notab
+ cgi_text "searchtype=0" type=hidden notab
+ cgi_text "dir=$dir" type=hidden notab
+
+ cgi_puts "Search Directory :"
+ cgi_text "srchstr=${srchstr}" size=35
+ cgi_submit_button "search=Search"
+ }
+
+ cgi_br
+ cgi_br
+ }
+ } elseif {[catch {WPCmd PELdap results $qn} results]} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts "A problem has occured while trying to retrieve the results of your directory search."
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_italic [cgi_bold "$results"]]
+ cgi_br
+ cgi_br
+ cgi_puts "Try searching again by clicking [cgi_url "Address Book" wp.tcl?page=addrbook target=_top] at the left."
+ }
+ } else {
+ set numboxes 0
+ set srchindex 0
+ cgi_table border=0 cellpadding=0 cellspacing=10 width=100% {
+
+ foreach searchres $results {
+ set srchstr [lindex $searchres 0]
+ set retdata [lindex $searchres 1]
+ set expstr ""
+ cgi_table_row {
+ cgi_table_data valign=middle align=center {
+
+ if {$srchstr != ""} {
+ set expstr " for \"[cgi_bold $srchstr]\""
+ }
+
+ cgi_puts [cgi_font size=+1 "Directory Search Results${expstr}"]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 bgcolor=white cellspacing=0 cellpadding=0 width=90% "style=\"border: 1px solid goldenrod; padding: 1\"" {
+ set whitebg 1
+ set nameindex 0
+ set onetruebox 0
+ set numsrchboxes 0
+ foreach litem $retdata {
+ if {[llength [lindex $litem 4]] > 0} {
+ incr numsrchboxes
+ if {$numsrchboxes > 1} {
+ break
+ }
+ }
+ }
+ if {$numsrchboxes == 1} {
+ set onetruebox 1
+ }
+
+ cgi_table_row class=\"gradient\" {
+ cgi_table_data align=left class=indexhdr colspan=2 {
+ cgi_put "Full Name"
+ }
+ cgi_table_data align=left class=indexhdr height=30 {
+ cgi_put "Address (Click to Compose To)"
+ }
+ }
+
+ foreach litem $retdata {
+ set name [lindex $litem 0]
+ set email [lindex $litem 4]
+ set nomail 0
+ if {$whitebg == 1} {
+ set bgcolor #FFFFFF
+ set whitebg 0
+ } else {
+ set bgcolor #EEEEEE
+ set whitebg 1
+ }
+
+ if {[llength $email] < 1} {
+ set nomail 1
+ }
+
+ if {[llength $email]} {
+ set rowspan rowspan=[llength $email]
+ } else {
+ set rowspan ""
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data valign=top nowrap $rowspan {
+ regsub -all "<" $name "\\<" name
+ regsub -all ">" $name "\\>" name
+ # cgi_puts "$name"
+ cgi_puts "[WPurl "ldapentry.tcl?dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&email=[llength $email]" "" "$name" ""]"
+ }
+
+ cgi_table_data $rowspan {
+ cgi_puts [cgi_img [WPimg dot2] width=8]
+ }
+
+ cgi_table_data nowrap height=20px {
+ if {[llength $email] >= 1} {
+ set extrarows [lrange $email 1 end]
+ cgi_put [cgi_url [cgi_font size=-1 face=courier [lindex $email 0]] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [cgi_italic "<No email information>"]
+ }
+ }
+ }
+
+ if {[info exists extrarows] && [llength $extrarows]} {
+ cgi_table_row bgcolor=$bgcolor {
+ set ei 0
+ foreach extra $extrarows {
+ cgi_table_data height=20px {
+ cgi_put [cgi_url [cgi_font size=-1 face=courier $extra] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ }
+ }
+ }
+
+ unset extrarows
+ }
+
+ incr nameindex
+ }
+ }
+ }
+ }
+ incr srchindex
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/main.tcl b/web/cgi/alpine/1.0/main.tcl
new file mode 100755
index 00000000..24881868
--- /dev/null
+++ b/web/cgi/alpine/1.0/main.tcl
@@ -0,0 +1,84 @@
+# $Id: main.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+
+# Input:
+
+# Output:
+#
+
+proc save_hack {} {
+ if {[catch {WPImport f_name "x"}] == 0 && [catch {WPImport f_colid "x"}] == 0} {
+ append parms "&f_name=${f_name}&f_colid=${f_colid}"
+
+ if {[catch {WPImport send "x"}] == 0} {
+ append parms "&send=${send}"
+ }
+
+ return $parms
+ }
+
+ error "not saving"
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+ WPExportCookie sessid "$_wp(sessid)@[info hostname]" $_wp(appdir)/$_wp(ui1dir)
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "WebPine"
+ }
+
+ cgi_frameset "cols=112,*" frameborder=0 framespacing=0 {
+ cgi_frame gen=common.tcl?m=[WPCmd PEMailbox mailboxname]&c=[WPCmd PEInfo key]&v=[WPScriptVersion common]&q=[WPCmd PEInfo feature quit-without-confirm] title="Navigation Commands"
+
+ if {[catch {WPCmd PEInfo set wp_spec_script} script]} {
+ set script fr_index.tcl
+ }
+
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ switch -regexp $script {
+ ^fr_view.tcl$ {
+ if {[catch {save_hack} x] == 0} {
+ append parms "&$x"
+ }
+
+ if {[catch {WPCmd PEInfo set uid} uid] == 0} {
+ append parms "&uid=$uid"
+ }
+
+ if {[catch {WPCmd PEInfo set op} op] == 0} {
+ append parms "&op=$op"
+ }
+ }
+ ^fr_index.tcl$ -
+ ^fr_main.tcl$ {
+ if {[catch {save_hack} x] == 0} {
+ append parms "&$x"
+ }
+ }
+ }
+
+ cgi_frame spec=${script}?c=[WPCmd PEInfo key]${parms} frameborder=0 title="Message List and View"
+ }
+}
diff --git a/web/cgi/alpine/1.0/open.tcl b/web/cgi/alpine/1.0/open.tcl
new file mode 100755
index 00000000..2add6db5
--- /dev/null
+++ b/web/cgi/alpine/1.0/open.tcl
@@ -0,0 +1,33 @@
+#!./tclsh
+# $Id: open.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# open.tcl
+#
+# Purpose: CGI script to perform folder opening via folders.tcl
+
+# Input:
+set open_vars {
+ {cid "Missing Command ID"}
+ {oncancel "" "folders"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $open_vars {
+ source do_open.tcl
+}
diff --git a/web/cgi/alpine/1.0/post.tcl b/web/cgi/alpine/1.0/post.tcl
new file mode 100755
index 00000000..dcd7c37b
--- /dev/null
+++ b/web/cgi/alpine/1.0/post.tcl
@@ -0,0 +1,651 @@
+# $Id: post.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {action {} ""}
+ {send {} 0}
+ {postpone {} 0}
+ {cancel {} 0}
+ {check {} 0}
+ {br_to {} 0}
+ {br_cc {} 0}
+ {br_bcc {} 0}
+ {br_reply_to {} 0}
+ {br_fcc {} 0}
+ {ex_to {} ""}
+ {ex_cc {} ""}
+ {ex_bcc {} ""}
+ {ex_reply_to {} ""}
+ {sendop {} ""}
+ {queryattach {} 0}
+ {attach {} 0}
+ {detach {} 0}
+ {extrahdrs {} ""}
+ {help {} ""}
+ {postpost {} "main.tcl"}
+ {fccattach {} 0}
+ {form_charset {} ""}
+ {form_flowed {} ""}
+}
+
+# NOT Input
+catch {
+ unset src
+}
+
+# Output:
+#
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc expand_address_field {field _msgdata} {
+ global has_fcc
+
+ upvar 1 $_msgdata msgdata
+
+ set fn [fieldname $field]
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set fld [lindex $msgdata $i]
+ if {[string compare [fieldname [lindex $fld 0]] $fn] == 0} {
+ if {[catch {WPCmd PEAddress expand [lindex $fld 1] fcc} expaddr]} {
+ WPCmd PEInfo statmsg "Can't expand $field: $expaddr"
+ } else {
+ if {[lindex $expaddr 1] != 0} {
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # addresses and ldapaddrs should be set at this point
+ upvar 1 addresses a
+ upvar 1 ldapquery l
+ upvar 1 field f
+ set a [lindex $expaddr 0]
+ set l [lindex $expaddr 1]
+ set f $fn
+ return 1
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ break
+ }
+ } elseif {[string compare [lindex $expaddr 0] [lindex $fld 1]]} {
+ set msgdata [lreplace $msgdata $i $i [list [lindex $fld 0] [lindex $expaddr 0]]]
+
+ # set fcc?
+ set fccfn [lindex $expaddr 2]
+ set fccdef [WPCmd PECompose fccdefault]
+ if {[string compare to [string tolower $fn]] == 0 && [string length $fccfn]
+ && (![info exists has_fcc] || 0 == [string compare [lindex $fccdef 1] [lindex $has_fcc 1]])} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [fieldname [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set colid [lindex $fccdef 0]
+ if {[info exists fcc_index]} {
+ if {[string compare $fccfn [lindex [lindex [lindex $msgdata $fcc_index] 1] 1]]} {
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $fccfn]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $fccfn]]
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set has_fcc [list $colid $fccfn]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return 0
+}
+
+proc chartest_value {entity} {
+ global _cgi
+
+ if {[catch {cgi_import_as ke_${entity} tc}] == 0} {
+ set tcval ""
+ if {[set j [string length $tc]]} {
+ for {set i 0} {$i < $j} {incr i} {
+ binary scan [string index $tc $i] c x
+ set x [expr ($x & 0xff)]
+ lappend tcval [format {%o} $x]
+ }
+ }
+
+ return $tcval
+ } else {
+ error "Unset testchar_$entity"
+ }
+}
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+# collect message data
+
+# For now the input headers have to match the postheaders
+# list. Any outside the list are ignored (and probably should
+# be to avoid hostile input). Note, postheaders is a
+# super-set of composeheaders as not all headers are meant
+# to be shown the user for composition
+if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "User Headers" $headers "Click browser's Back button to try again."]
+}
+
+if {[catch {WPCmd PECompose syshdrs} otherhdrs]} {
+ error [list _action "System Headers" $otherhdrs "Click browser's Back button to try again."]
+} else {
+ eval "lappend headers $otherhdrs"
+}
+
+foreach field $headers {
+ set hdr [string tolower [lindex $field 0]]
+ regsub -all -- {-} $hdr {_} hdr
+ WPLoadCGIVarAs $hdr val
+ switch -- $hdr {
+ attach {
+ # disregard: u/i convenience (attachments marshalled below)
+ }
+ fcc {
+ if {[string length $val]} {
+ WPLoadCGIVar colid
+ set has_fcc [list $colid $val]
+ lappend msgdata [list Fcc $has_fcc]
+ }
+ }
+ default {
+ if {[string length $val] || [lsearch -exact {subject} $hdr] >= 0} {
+ set hdrvals($hdr) $val
+ lappend msgdata [list [lindex $field 0] $val]
+ if {[lsearch -exact {to cc bcc} $hdr] >= 0} {
+ set has_$hdr 1
+ }
+ }
+ }
+ }
+}
+
+if {[info exists env(REMOTE_ADDR)]} {
+ lappend msgdata [list x-auth-received "from \[$env(REMOTE_ADDR)\] by [info hostname] via HTTP; [clock format [clock seconds] -format "%a, %d %b %Y %H:%M:%S %Z"]"]
+}
+
+if {[catch {cgi_import attachments}] == 0} {
+ foreach id [split $attachments ","] {
+ lappend msgdata [list attach $id]
+ }
+}
+
+WPLoadCGIVar body
+lappend msgdata [list body [split $body "\n"]]
+
+
+switch -exact -- $fccattach {
+ 0 -
+ 1 {
+ lappend msgdata [list postoption [list fcc-without-attachments [expr {!$fccattach}]]]
+ }
+}
+
+# pass on form's charset?
+# TURNED OFF since all compose form interaction BETTER be UTF-8
+if {0 && [string length $form_charset]} {
+ # messy charset heuristics
+ # idea is to look for planted HTML entities and see if known
+ # encoding transliterations have occured. inspired by:
+ #
+
+ # test for:
+ # entity values
+ # euro (#8364)
+ # cyrillic shcha (#1060)
+ # iso-8859-15 (Latin0): euro IS 200
+ # iso-8859-1 (Latin1): thorn IS 376 or U+C3BE BUT NOT “ þ OR þ
+ # Unicode literal full width yen: U+FFE5 IS 215F (ISO-2022-JP), A1EF (EUC-JP), or 818F (Shift-JIS) and so on
+
+ # remember, the first element of each group MUST appear in compose.tcl, too
+ set cstests {}
+ set xcstests {
+ {#8364 {{{40 254} ISO-10646} {{342 202 254} UTF-8} {244 ISO-8859-15} {325 IBM-850}} {}}
+ {#1066 {{{377} KOI8-R} {312 ISO-8859-5}} {}}
+ {thorn {{376 ISO-8859-1}} {{303 276} UTF-8} {iso-8859-1 {{46 43 70 62 62 60 73} {46 43 62 65 64 73} {46 164 150 157 162 156 73}}}}
+ {tcedil {{376 ISO-8859-2}} {{46 164 143 145 144 151 154 73}}}
+ {#65509 {{{302 245} UTF-8} {{241 315} EUC-KR} {{243 244} GB2312} {{242 104} BIG5} {{241 357} EUC-JP} {{201 217} Shift-JIS} {{33 44 102 41 157 33 50 102} ISO-2022-JP}} {}}
+ }
+
+ catch {unset test_charset}
+ foreach cs $cstests {
+ # asked for test entity available?
+ if {[catch {chartest_value [lindex $cs 0]} ctest] == 0} {
+ # test for positive [re]encoding assertions
+ foreach testpos [lindex $cs 1] {
+ if {[regexp "^[lindex $testpos 0]\$" $ctest]} {
+ set test_charset [lindex $testpos 1]
+ break
+ }
+ }
+
+ if {![info exists test_charset]} {
+ set csneg [lindex [lindex $cs 2] 0]
+ foreach testneg [lindex [lindex $cs 2] 1] {
+ if {[regexp "^$testneg\$" $ctest]} {
+ if {[info exists form_charset]
+ && [string compare [string tolower $form_charset] $csneg] == 0} {
+ unset form_charset
+ break
+ }
+ }
+ }
+ } else {
+ break
+ }
+ }
+ }
+
+ if {[info exists test_charset]} {
+ lappend msgdata [list postoption [list charset $test_charset]]
+ } elseif {[info exists form_charset]} {
+ lappend msgdata [list postoption [list charset $form_charset]]
+ } else {
+ lappend msgdata [list postoption [list charset "X-UNKNOWN"]]
+ }
+} else {
+ lappend msgdata [list postoption [list charset "UTF-8"]]
+}
+
+# pass on text fomat=flowed?
+if {[string length $form_flowed]} {
+ lappend msgdata [list postoption [list flowed yes]]
+}
+
+# figure out what to do with data
+if {[string compare OK [string trim $action]] == 0 && ($send || [string compare $sendop send] == 0)} {
+ if {[info exists has_to] || [info exists has_cc] || [info exists has_bcc] || [info exists has_fcc]} {
+ # expand any nicknames
+ if {[catch {
+ set fccdef [WPCmd PECompose fccdefault]
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set fld [lindex $msgdata $i]
+ set fn [string tolower [lindex $fld 0]]
+ switch -- $fn {
+ [Ff]cc {
+ if {[string length [lindex [lindex $fld 1] 1]]} {
+ # setup for send confirmation
+ set colidval [lindex [lindex $fld 1] 0]
+ set fccval [lindex [lindex $fld 1] 1]
+ }
+ }
+ to -
+ cc -
+ bcc -
+ reply-to {
+ set expaddr [WPCmd PEAddress expand [lindex $fld 1] {}]
+ if {[string compare [lindex $expaddr 0] [lindex $fld 1]]} {
+ set msgdata [lreplace $msgdata $i $i [list [lindex $fld 0] [lindex $expaddr 0]]]
+
+ # if expanded, update fcc?
+ if {[string compare to $fn] == 0 && [string length $fn]} {
+ set expanded_fcc [lindex $expaddr 2]
+ }
+ }
+ }
+ body {
+ if {[string length $form_flowed]} {
+ set ws "\[ \t]"
+ set nws "\[^ \t]"
+
+ set nextline [lindex [lindex $fld 1] 0]
+ for {set j 1} {$j <= [llength [lindex $fld 1]]} {incr j} {
+ set line $nextline
+ # space stuff?
+ if {[regexp "^${ws}+" $line]} {
+ set line " $line"
+ }
+
+ set nextline [lindex [lindex $fld 1] $j]
+ if {[regexp {^-- $} $line] == 0} {
+ catch {unset linetext}
+ # trim trailing WS from lines preceding those with LWS (space-stuff as needed)
+ if {[string length $nextline] == 0 || [regexp "^${ws}+(${nws}?.*)\$" $nextline dummy linetext]} {
+ set line [string trimright $line]
+ if {[info exists linetext] == 0 || [string length $linetext] == 0} {
+ set nextline ""
+ }
+ }
+
+ # break overly long lines in a flowed way
+ if {[regexp {^[^>]} $line] && [string length $line] > 1000} {
+ while {[regexp "^(${ws}*${nws}+${ws}+)$nws" [string range $line 900 end] dummy linex]} {
+ set cliplen [expr {900 + [string length $linex]}]
+ lappend newbody [string range $line 0 [expr {$cliplen - 1}]]
+ set line [string range $line $cliplen end]
+ }
+ }
+ }
+
+ lappend newbody $line
+ }
+
+ set msgdata [lreplace $msgdata $i $i [list body $newbody]]
+ }
+ }
+ default {
+ }
+ }
+ }
+ }
+ } result]} {
+ WPCmd PEInfo statmsg "Address problem: $result"
+ } else {
+ # update fcc?
+ if {[info exists expanded_fcc]
+ && (![info exists has_fcc] || 0 == [string compare [lindex $fccdef 1] [lindex $has_fcc 1]])} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [fieldname [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set colid [lindex $fccdef 0]
+ if {[info exists fcc_index]} {
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $expanded_fcc]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $expanded_fcc]]
+ }
+ }
+
+ # do the sending...
+ set verb Send
+ set verbpast Sent
+ set postcmd PECompose
+ set postcmdopt post
+ }
+ } else {
+ WPCmd PEInfo statmsg "Send MUST include Recipients (To, Cc, Bcc, or Fcc)"
+ }
+} elseif {[string compare OK [string trim $action]] == 0 && ($postpone || [string compare $sendop postpone] == 0)} {
+ set verb Postpone
+ set verbpast Postponed
+ set postcmd PEPostpone
+ set postcmdopt append
+} elseif {$help == 1 || [string compare "get help" [string tolower $help]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ _cgi_set_uservar oncancel "compose&restore=1"
+ set src help
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$check == 1 || [string compare spell [string tolower [string range $check 0 4]]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ set src spell
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$queryattach == 1 || [string compare "add attachment" [string tolower $queryattach]] == 0 || [string compare "attach" [string tolower $queryattach]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set src askattach
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_to == 1 || [string compare browse [string tolower $br_to]] == 0 || [string compare to [string tolower $br_to]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field to
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_cc == 1 || [string compare browse [string tolower $br_cc]] == 0 || [string compare cc [string tolower $br_cc]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field cc
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_bcc == 1 || [string compare browse [string tolower $br_bcc]] == 0 || [string compare bcc [string tolower $br_bcc]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field bcc
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_reply_to == 1 || [string compare browse [string tolower $br_reply_to]] == 0 || [string compare "reply_to" [string tolower $br_reply_to]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field reply-to
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_fcc == 1 || ($br_fcc > 0 && [string length $br_fcc] > 0)} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ _cgi_set_uservar onselect compose
+ _cgi_set_uservar oncancel compose
+ set src fldrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {[string compare expand [string tolower $ex_to]] == 0} {
+ if {[expand_address_field To msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_cc]] == 0} {
+ if {[expand_address_field Cc msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_bcc]] == 0} {
+ if {[expand_address_field Bcc msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_reply_to]] == 0} {
+ if {[expand_address_field Reply-To msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string length $extrahdrs] > 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ if {[catch {WPCmd PEInfo set wp_extra_hdrs} extras] || $extras == 1} {
+ set toggle 0
+ } else {
+ set toggle 1
+ }
+
+ catch {WPCmd PEInfo set wp_extra_hdrs $toggle}
+
+ _cgi_set_uservar restore 1
+ set src compose
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {[string compare OK [string trim $action]] == 0 && ($cancel || [string compare $sendop cancel] == 0)} {
+ # clean up attachments
+ WPCmd PEInfo statmsg "Message cancelled"
+ catch {WPCmd PEInfo unset suspended_composition}
+ catch {WPCmd PEInfo unset wp_extra_hdrs}
+ set src ""
+} else {
+ # check for per-attachment ops
+ if {[info exists attachments]} {
+ set a [split $attachments ","]
+ for {set i 0} {$i < [llength $a]} {incr i} {
+ if {[catch {cgi_import detach_[lindex $a $i].x}] == 0} {
+ if {[catch {WPCmd PECompose unattach [lindex $a $i]} result]} {
+ WPCmd PEInfo statmsg "Unattach: $result"
+ } else {
+ set attachment_deleted [lindex $a $i]
+
+ set a [lreplace $a $i $i]
+ set attachments [join $a ","]
+
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string compare attach [lindex [lindex $msgdata $i] 0]] == 0 && [lindex [lindex $msgdata $i] 1] == $attachment_deleted} {
+ set msgdata [lreplace $msgdata $i $i]
+ break
+ }
+ }
+
+ WPCmd PEInfo statmsg "Attachment Removed"
+ }
+
+ break
+ }
+ }
+ }
+
+ if {![info exists attachment_deleted]} {
+ WPCmd PEInfo statmsg "Unrecognized Action"
+ }
+}
+
+#do what was asked
+if {[info exists postcmd]} {
+ if {[info exists msgdata]} {
+ if {[catch {WPCmd $postcmd $postcmdopt $msgdata} errstr]} {
+ # if auth problem, save msgdata for after we ask for credentials
+ if {([string compare NOPASSWD [string range $errstr 0 7]] == 0 || [string compare BADPASSWD [string range $errstr 0 8]] == 0)
+ && [catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+
+ if {[catch {WPCmd PEInfo authrequestor} server]} {
+ append reason "Unknown server asking for authentication. Press cancel to abort if you think this message is in error."
+ } else {
+ append reason "[cgi_nl]Enter Username and Password to connect to [cgi_bold $server]"
+ lappend params [list server $server]
+ }
+
+ if {[catch {WPCmd PESession creds 0 "{$server}"} creds] == 0 && $creds != 0} {
+ catch {WPCmd PEInfo statmsg "Invalid Username or Password"}
+ WPCmd PESession nocred 0 "{$server}"
+ }
+
+ WPCmd set reason "The server ($server) used to send this message requires authentication.[cgi_nl]"
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol 0
+ WPCmd set authfolder "{$server}"
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=dosend"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=compose&restore=1&cid=$cid"]
+
+ set src auth
+
+ } else {
+ # regurgitate the compose window
+ set style ""
+ set title "$verb Error: [cgi_font class=notice "$errstr"]"
+ if {[string length $errstr]} {
+ set notice "$verb FAILED: $errstr"
+ } else {
+ set notice "$verb FAILED: [WPCmd PEInfo statmsg]"
+ }
+
+ WPCmd PEInfo statmsg "$notice"
+
+ # regurgitate the compose window
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ _cgi_set_uservar restore 1
+ set src compose
+
+ unset body
+ } else {
+ }
+
+ set src compose
+ }
+ } else {
+ catch {WPCmd PEInfo unset suspended_composition}
+ WPCmd PEInfo statmsg "Message $verbpast!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No Message $verbpast!"
+ }
+
+ if {[info exists delete_me]} {
+ foreach i $delete_me {
+ catch {file delete $i}
+ }
+ }
+} elseif {![info exists src]} {
+ set style ""
+ set title "Compose Message"
+ catch {unset attachments}
+
+ # regurgitate the compose window
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ _cgi_set_uservar restore 1
+ set src compose
+
+ unset body
+ }
+}
+
+if {[info exists src] && [string length $src]} {
+ source [WPTFScript $src]
+} else {
+ cgi_redirect "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=$postpost"
+}
diff --git a/web/cgi/alpine/1.0/promptsave.tcl b/web/cgi/alpine/1.0/promptsave.tcl
new file mode 100755
index 00000000..c7e7c2d8
--- /dev/null
+++ b/web/cgi/alpine/1.0/promptsave.tcl
@@ -0,0 +1,149 @@
+#!./tclsh
+# $Id: promptsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# promptsave.tcl
+#
+# Purpose: CGI script to generate html form used to gather folder
+# name and collection for aggregate save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel dialog
+set psave_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form for save folder dialog
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button save=[WPimg but_save] border=0 alt="Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $psave_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Aggregate Save"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context promptsave}
+ catch {WPCmd PEInfo set wp_index_script fr_promptsave.tcl}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=body type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to save messages to a folder"
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Save for messages "]
+
+ cgi_put "Save "
+
+ if {!$uid} {
+ set n [WPCmd PEMailbox selected]
+ cgi_put "all [cgi_bold [WPcomma $n]] marked message[WPplural $n] "
+ if {[catch {WPCmd PEMessage $uid savedefault} savedefault]} {
+ set savedefault [list 1 saved-messages]
+ }
+ } else {
+ set savedefault [list 1 saved-messages]
+ }
+
+ cgi_put "to "
+ cgi_br
+
+ cgi_text "savename=[lindex $savedefault 1]" type=text size=14 maxlength=256 class=aggop style=vertical-align:middle onFocus=this.select()
+ if {[catch {WPCmd PEFolder collections} collections] == 0 && [llength $collections] > 1} {
+ cgi_put "[cgi_nbspace]in "
+ cgi_select savecolid class=aggop style=vertical-align:middle {
+ set defcol [lindex $savedefault 0]
+ set j 0
+ foreach i $collections {
+ if {$j == $defcol} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+ if {[string length [set f [lindex $i 1]]] > 12} {
+ set f "[string range $f 0 10]..."
+ }
+
+ cgi_option $f value=$j $selected
+ incr j;
+ }
+ }
+ } else {
+ cgi_text "savecolid=0" type=hidden notab
+ }
+
+ cgi_br
+ cgi_puts "[cgi_nl]Click [cgi_italic Save] to save the message the folder, or [cgi_italic Cancel] to abort the save."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center colspan=2 {
+ cgi_br
+ cgi_submit_button save=Save
+ cgi_submit_button savecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/prune.tcl b/web/cgi/alpine/1.0/prune.tcl
new file mode 100755
index 00000000..c35552e3
--- /dev/null
+++ b/web/cgi/alpine/1.0/prune.tcl
@@ -0,0 +1,74 @@
+# $Id: prune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform monthly message pruning via prunetime.tcl
+# generated form
+
+# Input:
+set prune_vars {
+ {cid "Missing Command ID"}
+ {mvcnt "Missing Move Count"}
+ {delList "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $prune_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+set mvvals {}
+for {set i 0} {$i < $mvcnt} {incr i} {
+ WPLoadCGIVarAs "mv${i}" tmpmv
+ if {[string compare $tmpmv ""]} {
+ lappend mvvals $tmpmv
+ }
+}
+
+foreach mvval $mvvals {
+ set mvfrm [lindex $mvval 1]
+ set mvto [lindex $mvval 2]
+
+ if {[catch {WPCmd PEFolder rename default $mvfrm $mvto} result]} {
+ set msg "Can't Rename $mvfrm: $result"
+ } else {
+ set msg "Renaming \"${mvfrm}\" at start of month"
+ catch {WPCmd PEFolder create default $mvfrm} result
+ }
+ WPCmd PEInfo statmsg $msg
+}
+
+foreach delfldr $delList {
+ set msg ""
+ if {[catch {WPCmd PEFolder delete default $delfldr} result]} {
+ set msg "Can't delete ${delfldr}: $result"
+ } else {
+ set msg "Deleted $delfldr"
+ }
+ WPCmd PEInfo statmsg $msg
+}
+
+source [WPTFScript main]
diff --git a/web/cgi/alpine/1.0/queryattach.tcl b/web/cgi/alpine/1.0/queryattach.tcl
new file mode 100755
index 00000000..9cd7028c
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryattach.tcl
@@ -0,0 +1,145 @@
+#!./tclsh
+# $Id: queryattach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryattach.tcl
+#
+# Purpose: CGI script to generate html form used to ask for
+# attachment to composition
+
+# Input:
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# make sure form's in Unicode
+set charset "UTF-8"
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_submit_button "attach=Add Attachment" class="navbar"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button cancel=Cancel class="navbar"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * Address/Cancel * * * *
+ cgi_submit_button doit=Done class="navbar"
+ cgi_br
+ cgi_select attachop class=navtext {
+ cgi_option "Action..." value=null
+ cgi_option Attach value=attach
+ cgi_option Cancel value=cancel
+ }
+ }
+ }
+ }
+}
+
+WPEval {} {
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+ WPStdHtmlHdr "Attach"
+ WPStyleSheets
+ cgi_put ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text page=attach type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table border=0 width=75% cellpadding=15 {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To attach a file to your message, enter its path and file name below, or use the [cgi_italic Browse] button to choose the file, then click [cgi_italic "Add Attachment"], or click [cgi_italic Cancel] to return to your composition without attaching anything."
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_file_button file "accept=*/*" size=30 class=filename
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "You can also provide a short description to help the message's recipient figure out what the attachment is :"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_text description= maxlength=256 size=40 class=filename
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "attach=Add Attachment"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querycreate.tcl b/web/cgi/alpine/1.0/querycreate.tcl
new file mode 100755
index 00000000..b3057ab3
--- /dev/null
+++ b/web/cgi/alpine/1.0/querycreate.tcl
@@ -0,0 +1,114 @@
+#!./tclsh
+# $Id: querycreate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querycreate.tcl
+#
+# Purpose: CGI script to generate html form used to confirm folder
+# creation for Save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel confirmation
+set qcreate_vars {
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button create=[WPimg but_create] border=0 alt="Create"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $qcreate_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ if {[catch {WPCmd PEInfo set querycreate_state} qstate]} {
+
+ } else {
+ catch {WPCmd PEInfo unset querycreate_state}
+
+ set folder [lindex $qstate 0]
+ set params [lindex $qstate 1]
+
+ catch {WPCmd PEInfo set help_context create_save}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=spec {
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=30 width="100%" height="100%" class=dialog {
+ cgi_table_row {
+ cgi_table_data align=center valign=top {
+ cgi_table width="80%" border=0 {
+ cgi_table_row {
+ cgi_table_data valign=top align=center {
+ cgi_puts "You are attempting to Save to a folder, [cgi_bold $folder], that does not exist."
+ cgi_br
+ cgi_puts "[cgi_nl]Click [cgi_italic Create] to create [cgi_bold $folder] and save the message, or [cgi_italic Cancel] to create nothing and return to the Message View."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_submit_button create=Create
+ cgi_submit_button savecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querydelfldr.tcl b/web/cgi/alpine/1.0/querydelfldr.tcl
new file mode 100755
index 00000000..e0fa960a
--- /dev/null
+++ b/web/cgi/alpine/1.0/querydelfldr.tcl
@@ -0,0 +1,121 @@
+#!./tclsh
+# $Id: querydelfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querydelfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder deletion
+
+# Input:
+set fldr_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Delete"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+
+ regsub -all { } [lindex $fid end] {\ } dfn
+
+ cgi_puts "Please confirm that you would like to permanently remove [cgi_bold $dfn]"
+
+ if {[llength $fid] > 2} {
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} delim]} {
+ set delim /
+ }
+
+ set dirname ""
+ for {set i 1} {$i < ([llength $fid] - 1)} {incr i} {
+ append dirname "[lindex $fid $i]$delim"
+ }
+
+ if {[string length $dirname]} {
+ cgi_put " from the directory [cgi_bold $dirname] "
+ }
+ }
+ if {[llength $collections] > 1} {
+ cgi_put "in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+
+ cgi_br
+ cgi_br
+ cgi_puts "Click [cgi_italic Delete] to remove the folder permanently, or [cgi_italic Cancel] to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button delete=Delete
+ cgi_submit_button delete=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryexpunge.tcl b/web/cgi/alpine/1.0/queryexpunge.tcl
new file mode 100755
index 00000000..c3e552d6
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryexpunge.tcl
@@ -0,0 +1,203 @@
+#!./tclsh
+# $Id: queryexpunge.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryexpunge.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# deleted message expunge
+
+# Input (Assumed set by sourcing script):
+# fn : Name of folder getting expunged
+# delcount : Number of deleted messages
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval {} {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Expunge"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context expunge}
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/fr_index method=get name=confirm target=spec {
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ set mbn [WPCmd PEMailbox mailboxname]
+ cgi_table border=0 cellspacing=8 cellpadding=8 width="75%" {
+
+ if {[catch {WPCmd PEMailbox flagcount deleted} delcount] == 0 && $delcount > 0
+ && [catch {WPCmd PEMailbox messagecount} messcount] == 0} {
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle height=50 {
+ cgi_table bgcolor=yellow background=[WPimg dstripe] cellpadding=6 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table bgcolor=black cellpadding=6 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_font size=+2 color=yellow [cgi_bold "CAUTION!"]]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {$delcount == $messcount} {
+ switch $delcount {
+ 1 {
+ set m1 "The [cgi_bold only] message in the folder [cgi_bold $mbn] is deleted."
+ set m2 "that [cgi_bold single] message"
+ }
+ 2 {
+ set m1 "[cgi_bold Both] messages in the folder [cgi_bold $mbn] are deleted."
+ set m2 "[cgi_bold "both"] messages"
+ }
+ default {
+ set m1 "[cgi_span "style=font-weight: bold; color: red" "All $messcount messages"] in the folder [cgi_bold $mbn] are marked for deletion. This includes any messages that might not be visible on the screen."
+ set m2 "[cgi_bold [cgi_span "style=font-size: bigger; color: red; text-decoration: underline" "all messages"]]"
+ }
+ }
+
+ append m1 "[cgi_nl][cgi_nl]Expunge now will leave this folder "
+ append m1 "[cgi_span "style=font-weight: bold; color: red" empty]. "
+ #append m1 "[cgi_nl][cgi_nl]Please acknowledge below that you understand there will be [cgi_span "style=font-weight: bold; color: red" "no more messages"] within this folder when the expunge is complete."
+ append m1 "[cgi_nl][cgi_nl][cgi_buffer {cgi_checkbox "emptyit=1"}] "
+ append m1 "I acknowledge expunge will leave folder [cgi_bold $mbn] [cgi_span "style=font-weight: bold; color: red" empty]."
+ set style "style=\"border: 1px solid #663333; background-color: #ffcc66;\""
+ set m3 ALL
+ } else {
+ if {$delcount > 1} {
+ set whch are
+ set plrl "s"
+ } else {
+ set whch is
+ set plrl ""
+ }
+
+ set m1 "Your folder [cgi_bold $mbn] contains $messcount messages, of which [cgi_bold $delcount] $whch deleted."
+ set m2 "[cgi_span "style=font-size: bigger; font-weight: bold" $delcount] message${plrl}"
+ set m3 $delcount
+ set style ""
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center $style {
+ cgi_puts $m1
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Do you wish to [cgi_span "style=color: red ; font-weight: bold" "permanently remove"] $m2 now?"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "expunge=Yes, Remove $m3 message[WPplural $delcount]" tabindex=2
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "cancel=No, Return to '$mbn'" tabindex=1 checked selected default
+ }
+ }
+ } else {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "There are [cgi_bold no] messages currently marked for deletion in the folder [cgi_bold [WPCmd PEMailbox mailboxname]]."
+ }
+ }
+
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ switch [WPCmd PEInfo aggtabstate] {
+ 0 {
+ lappend methods "Click the [cgi_img [WPimg slideout] style=vertical-align:middle] tab to expose aggregate operations"
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Click the [cgi_italic Delete] button"
+ }
+ 1 {
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Click the [cgi_italic Delete] button"
+ }
+ 2 {
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Within the Message Status box, choose [cgi_bold Deleted] from the drop-down list of flag choices"
+ lappend methods "Click the [cgi_italic Set] button"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark a message for deletion while viewing it, simply click the [cgi_italic Delete] button at the top of the Message View page."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark messages for deletion in the Message List:"
+ cgi_number_list {
+ foreach i $methods {
+ cgi_li $i
+ }
+ }
+ }
+ }
+ } else {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark a message for deletion, click the [cgi_italic Delete] button while viewing the message."
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Click [cgi_italic OK] to return to the Message List."
+ cgi_br
+ cgi_br
+ cgi_submit_button cancel=OK
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryimport.tcl b/web/cgi/alpine/1.0/queryimport.tcl
new file mode 100755
index 00000000..1f40bad2
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryimport.tcl
@@ -0,0 +1,146 @@
+#!./tclsh
+# $Id: queryimport.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryimport.tcl
+#
+# Purpose: CGI script to generate html form used to ask for
+# importing a folder
+
+# Input:
+set import_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {expr {0}}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $import_vars {
+
+ set colid [lindex $fid 0]
+ if {[llength $fid] > 1} {
+ set fpath [eval "file join [lrange $fid 1 end]"]
+ } else {
+ set fpath ""
+ }
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ catch {WPCmd PEInfo statmsg "Can't Import: $collections"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders.tcl
+ }
+ } elseif {$colid < 0 || $colid > [llength $collections]} {
+ catch {WPCmd PEInfo statmsg "Can't Import: Invalid collection: $colid"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders.tcl
+ }
+ } else {
+
+ if {[string length $fpath]} {
+ set coldesc "the directory [cgi_bold $fpath] within "
+ }
+
+ append coldesc "the collection [cgi_bold [lindex [lindex $collections $colid] 1]]"
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Import"
+ WPStyleSheets
+ cgi_put ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text page=folders type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ cgi_text fid=$fid type=hidden notab
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table border=0 width=75% cellpadding=15 {
+ cgi_table_row {
+ cgi_table_data align=center "style=\"padding-top:30\"" {
+ cgi_puts "Folder Import copies a mail folder, typically created by the Export command, from the computer your browser is running on into a new Web Alpine folder. [cgi_nbspace]Successful Import consists of three steps."
+ cgi_p
+ cgi_puts "First, enter the path and filename of the folder below. Use the [cgi_italic Browse] button to help choose the file."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_file_button file "accept=*/*" size=30 class=filename
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Second, provide a [cgi_bold unique] name for the imported folder to be assigned within $coldesc:"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_text iname= maxlength=256 size=40 class=filename
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Finally, click [cgi_italic "Import File"] to copy the folder into WebPine, or [cgi_italic Cancel] to return to the folder list."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "import=Import File" class=navtext
+ cgi_submit_button cancel=Cancel class=navtext
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewdir.tcl b/web/cgi/alpine/1.0/querynewdir.tcl
new file mode 100755
index 00000000..e2adeaae
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewdir.tcl
@@ -0,0 +1,113 @@
+#!./tclsh
+# $Id: querynewdir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context diradd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the name of the directory you would like to add"
+ if {[llength $fid] > 1} {
+ cgi_put " to the directory '[join [lrange $fid 1 end] /]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put "in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "New directory name: "
+ cgi_text directory= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Create' to add a new directory by that name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button newdir=Create
+ cgi_submit_button newdir=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewfldr.tcl b/web/cgi/alpine/1.0/querynewfldr.tcl
new file mode 100755
index 00000000..598b6db6
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewfldr.tcl
@@ -0,0 +1,112 @@
+#!./tclsh
+# $Id: querynewfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context foldadd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the name of the folder you would like to add"
+ if {[llength $fid] > 1} {
+ cgi_put " to the directory '[join [lrange $fid 1 end] /]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "New folder name: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Create' to add a new folder by that name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button newfolder=Create
+ cgi_submit_button newfolder=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewfoldir.tcl b/web/cgi/alpine/1.0/querynewfoldir.tcl
new file mode 100755
index 00000000..13c20126
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewfoldir.tcl
@@ -0,0 +1,131 @@
+#!./tclsh
+# $Id: querynewfoldir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfoldir.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder and directory creation
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context foldiradd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ if {[llength $fid] > 1} {
+ set Dirpref "Subd"
+ set dirpref "subd"
+ } else {
+ set Dirpref "D"
+ set dirpref "d"
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_put "Folders are used to contain messages. Typically, messages are placed in folders when you [cgi_italic Save] them from the Message View"
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_puts " or Message List pages."
+ } else {
+ cgi_puts "page."
+ }
+
+ cgi_put "To create a new folder"
+
+ if {[llength $fid] > 1} {
+ cgi_put " within the directory [cgi_bold [join [lrange $fid 1 end] /]]"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection [cgi_bold [lindex [lindex $collections [lindex $fid 0]] 1]]"
+ }
+
+ cgi_put ", enter the name below and click [cgi_italic "Create New Folder"]."
+ cgi_br
+ cgi_br
+
+ cgi_put "Furthermore, folders can be created within directories. The directory can either be one that now exists "
+ cgi_put " or one that you wish to create along with the new folder. "
+ cgi_put "Simply specify the directory name before the folder name separating the two with a "[WPCmd PEFolder delimiter [lindex $fid 0]]" character."
+ cgi_br
+ cgi_br
+ cgi_put "New folder name: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_submit_button "newfolder=Create New Folder" "style=\"margin-right: 10px\""
+ cgi_submit_button cancelled=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynick.tcl b/web/cgi/alpine/1.0/querynick.tcl
new file mode 100755
index 00000000..1e794822
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynick.tcl
@@ -0,0 +1,171 @@
+#!./tclsh
+# $Id: querynick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynick.tcl
+#
+# Purpose: CGI script to generate html form used to deal
+# with existing/taken nickname collision
+#
+
+# Input:
+set nick_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+# Command Menu
+set nick_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+# Output:
+# Query prompt to deal with existing/taken nickname collision
+#
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $nick_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Take to New Entry or List"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ #catch {WPCmd PEInfo set help_context samenick}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=samenick target=_top {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu nick_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top class=navbar {
+
+ cgi_text "page=addrsave" type=hidden notab
+ cgi_text "oncancel=main" type=hidden notab
+ cgi_text "take=1" type=hidden notab
+ cgi_text "ai=${ai}" type=hidden notab
+ cgi_text "book=${book}" type=hidden notab
+ cgi_text "nick=${nick}" type=hidden notab
+ cgi_text "fn=${fn}" type=hidden notab
+ cgi_text "addrs=${addrs}" type=hidden notab
+ cgi_text "fcc=${fcc}" type=hidden notab
+ cgi_text "comment=${comment}" type=hidden notab
+ cgi_text "newnick=${newnick}" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=15 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 "xstyle=padding-top:20;padding-bottom:20" {
+ cgi_puts "An address book entry with the nickname \"[cgi_bold $newnick]\" already exists. At this point you may click either:"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Replace Entry"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Replace the \"[cgi_bold $newnick]\" address book entry with your [cgi_italic Take] selection."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Add to Entry"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ if {[string first "," $addrs] >= 0} {
+ set plur "es"
+ } else {
+ set plur ""
+ }
+
+ cgi_puts "Add the address${plur} from your [cgi_italic Take] selection to the existing entry's addresses to create a list."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Edit"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Go back to editing your [cgi_italic Take] selection."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "cancel=Cancel"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Or, Cancel your [cgi_italic Take] selection altogether."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryprune.tcl b/web/cgi/alpine/1.0/queryprune.tcl
new file mode 100755
index 00000000..896bc333
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryprune.tcl
@@ -0,0 +1,170 @@
+#!./tclsh
+# $Id: queryprune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryprune.tcl
+#
+# After we've already determined that it's the
+# beginning of the month (logon.tcl), we check
+# what folders need pruning and offer them to
+# the user. Currently doesn't do automatic
+# reload.
+
+# Input:
+set prunetime_vars {
+ {cid "Missing Command ID"}
+ {start "Missing Start Page"}
+ {nojs "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set prune_menu {
+ {
+ {}
+ {
+ {
+ # * * * * DONE * * * *
+ cgi_submit_button prune=Continue
+ }
+ }
+ }
+}
+
+
+WPEval $prunetime_vars {
+ catch {WPCmd PEInfo prunetime} prunefldrs
+ set allclean 1
+ set delstuff 0
+ set askstuff 0
+ foreach prunefldr $prunefldrs {
+ if {[llength [lindex $prunefldr 1]] > 0 || [llength [lindex $prunefldr 2]] > 0} {
+ set allclean 0
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Monthly Folder Pruning"
+ WPStdScripts
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form [file join $_wp(appdir) $_wp(ui1dir) wp] method=post name=pruneit target=_top {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu prune_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog "style=\"padding: 20\"" {
+
+ if {$allclean == 1} {
+ catch {WPCmd PEInfo statmsg "Pruning Failed: $prunefldrs"}
+ cgi_puts "No folders appear to need cleaning up this month."
+ cgi_br
+ cgi_puts "Please click [cgi_url "here" $start target=_top] to continue your session."
+ } else {
+ cgi_puts "At the beginning of every month, you are asked if you would like to clean up your sent-mail folder(s). Please answer the following questions and click [cgi_italic Continue]."
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "op=pruneit" type=hidden notab
+ cgi_text "cid=${cid}" type=hidden notab
+ cgi_text "page=prune" type=hidden notab
+ set cnt 0
+ foreach prunefldr $prunefldrs {
+ set type [lindex $prunefldr 0]
+ set mv [lindex $prunefldr 1]
+ set dellist [lindex $prunefldr 2]
+
+ cgi_table border=0 cellpadding=8 cellspacing=0 "style=\"padding-top: 8\"" {
+ if {[llength $mv] > 1} {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_bold "Move current "[lindex $mv 0]" to "[lindex $mv 1]"?"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table "style=\"padding-left: 20\"" {
+ cgi_table_data {
+ cgi_radio_button "mv${cnt}=mv [lindex $mv 0] [lindex $mv 1]" checked class=body
+ }
+ cgi_table_data {
+ cgi_puts "Yes"
+ }
+ cgi_table_data {
+ cgi_radio_button "mv${cnt}=" class=body
+ }
+ cgi_table_data {
+ cgi_puts "No"
+ }
+ }
+ }
+ }
+ incr cnt
+ }
+ if {[llength $dellist] > 0} {
+ cgi_table_row {
+ cgi_table_data {
+ set plurtxt ""
+ set typetxt ""
+ if {[llength $dellist] > 1} {
+ set plurtxt "s"
+ }
+ if {[string compare $type ""] != 0} {
+ set typetxt "[string toupper $type] "
+ }
+ cgi_puts "[cgi_bold "To save disk space, delete the following ${typetxt}mail folder${plurtxt}:"] (Check to delete)"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table "style=\"padding-left: 20\"" {
+ foreach del $dellist {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_checkbox "delList=$del" "style=\"background-color: #FFFFFF; padding-right: 8\""
+ cgi_puts "$del "
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_text "mvcnt=${cnt}" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryquit.tcl b/web/cgi/alpine/1.0/queryquit.tcl
new file mode 100755
index 00000000..8c86078c
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryquit.tcl
@@ -0,0 +1,196 @@
+#!./tclsh
+# $Id: queryquit.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryquit.tcl
+#
+# Purpose: CGI script to generate html form used to confirm quitting
+# webpine while offering to expunge deleted
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel confirmation
+set quit_vars {
+ {cid "Command ID"}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button quit=[WPimg but_create] border=0 alt="Create"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $quit_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error "Invalid Command ID"
+ }
+
+ catch {WPCmd PESession expungecheck quit} prompts
+
+ set qhid ""
+ set delsexist 0
+ set askinbox 1
+ set askcurrent 1
+ set ewc [WPCmd PEInfo feature expunge-without-confirm]
+ set ewce [WPCmd PEInfo feature expunge-without-confirm-everywhere]
+
+ foreach prompt $prompts {
+ if {[lindex $prompt 1] > 0} {
+ set delsexist 1
+ }
+ if {[lindex $prompt 1] > 0 && ($ewc || $ewce) && [lindex $prompt 2] == 1} {
+ set askinbox 0
+ lappend qhid [cgi_buffer {cgi_text expinbox=1 type=hidden notab}]
+ } elseif {[lindex $prompt 1] > 0 && [lindex $prompt 2] == 0 && ($ewce || ($ewc && [lindex $prompt 3] == 1))} {
+ set askcurrent 0
+ lappend qhid [cgi_buffer {cgi_text expcurrent=1 type=hidden notab}]
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Quitting Web Alpine"
+ WPStdScripts
+ WPStyleSheets
+ cgi_put ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ #catch {WPCmd PEInfo set help_context quit}
+ cgi_table width=100% height=100% cellspacing=0 cellpadding=0 {
+ cgi_table_row {
+ cgi_table_data width=112 bgcolor=$_wp(bordercolor) {
+ cgi_put [cgi_img [WPimg dot2]]
+ }
+
+ cgi_table_data align=center valign=top bgcolor="$_wp(dialogcolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/do_quit method=get id=quitting target=_top {
+ cgi_text cid=$cid type=hidden notab
+ cgi_text sessid=$sessid type=hidden notab
+ foreach q $qhid {
+ cgi_puts $q
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=10 width="70%" class=dialog "style=padding-top:12%" {
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_puts [cgi_font size=+1 "Really Quit WebPine?"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_table cellpadding=10 border=0 {
+ if {$delsexist} {
+ cgi_table_row {
+ cgi_table_data valign=middle class=expungebox "style=\"border: 1px solid red\"" {
+ if {[llength $prompts] > 1} {
+ set ftext "[lindex [lindex $prompts 0] 0] and [lindex [lindex $prompts 1] 0]"
+ } else {
+ set ftext "[lindex [lindex $prompts 0] 0]"
+ }
+
+ cgi_put "This is a good opportunity to permanently remove from ${ftext} all of the messages you have marked for deletion."
+ cgi_br
+ cgi_br
+ cgi_table border=0 cellpadding=4 {
+ set expiexists 0
+ set expcexists 0
+ set inbhit 0
+ set curhit 0
+ foreach prompt $prompts {
+ set numdels [lindex $prompt 1]
+ set fname [lindex $prompt 0]
+ set inboxflag [lindex $prompt 2]
+ set incflag [lindex $prompt 3]
+ if {$inboxflag} {
+ incr inbhit
+ } else {
+ incr curhit
+ }
+ if {$numdels && (($askinbox && $inboxflag) || ($askcurrent && $inboxflag == 0))} {
+ cgi_table_row {
+ set cbn "cb[expr {$inbhit + $curhit}]"
+ cgi_table_data align=right valign=top {
+ if {$inboxflag} {
+ cgi_checkbox "expinbox" class=expungebox id=$cbn checked
+ incr expiexists
+ } else {
+ cgi_checkbox "expcurrent" class=expungebox id=$cbn checked
+ incr expcexists
+ }
+ }
+ cgi_table_data align=left {
+ set t "Expunge ${numdels} deleted message[expr {($numdels > 1) ? "s" : ""}] from ${fname}."
+ cgi_put [cgi_span class=clickit onclick=\"flipCheck('$cbn')\" $t]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle {
+ cgi_br
+ cgi_submit_button "quit=Yes, Quit Now"
+ cgi_put [cgi_img [WPimg dot2] width=10]
+ cgi_submit_button "cancel=No, Return to [WPCmd PEMailbox mailboxname]"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryrenfldr.tcl b/web/cgi/alpine/1.0/queryrenfldr.tcl
new file mode 100755
index 00000000..d84b303d
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryrenfldr.tcl
@@ -0,0 +1,109 @@
+#!./tclsh
+# $Id: queryrenfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryrenfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the new name of the folder '[lindex $fid end]'"
+ if {[llength $fid] > 2} {
+ cgi_put " in the directory '[join [lrange $fid 1 [expr {[llength $fid] - 2}]]]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "Rename [cgi_bold [lindex $fid end]] to: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Rename' to permanently change the folder name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button rename=Rename
+ cgi_submit_button rename=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querysave.tcl b/web/cgi/alpine/1.0/querysave.tcl
new file mode 100755
index 00000000..0bfdf59d
--- /dev/null
+++ b/web/cgi/alpine/1.0/querysave.tcl
@@ -0,0 +1,98 @@
+#!./tclsh
+# $Id: querysave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querysave.tcl
+#
+# Purpose: CGI script to generate html form used to gather folder
+# name and collection for aggregate save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel dialog
+set qsave_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing the form for save folder dialog
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button save=[WPimg but_save] border=0 alt="Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $qsave_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Aggregate Save"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get {
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_text "page=selsave" type=hidden notab
+ cgi_text "by=text" type=hidden notab
+ cgi_text "postpage=index" type=hidden notab
+
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "You are attempting to Save to a folder, '$folder', that does not exist."
+ cgi_br
+ cgi_puts "[cgi_nl]Click 'Create' to create the folder and save the message, or 'Cancel' to abort the save."
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_submit_button save=Save
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/web/cgi/alpine/1.0/resume.tcl b/web/cgi/alpine/1.0/resume.tcl
new file mode 100755
index 00000000..7a45333a
--- /dev/null
+++ b/web/cgi/alpine/1.0/resume.tcl
@@ -0,0 +1,169 @@
+#!./tclsh
+# $Id: resume.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# resume.tcl
+#
+# Purpose: CGI script to browse postponed messages
+
+# Input:
+set resume_vars {
+ {oncancel "" main.tcl}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set resume_cmds {
+ {
+ {}
+ {
+ {
+ cgi_puts [cgi_url "Get Help" wp.tcl?page=help&oncancel=resume target=_top class=navbar]
+ }
+ }
+ }
+}
+
+WPEval $resume_vars {
+
+ if {![info exists oncancel]} {
+ WPLoadCGIVarAs oncancel oncancel
+ }
+
+ if {[catch {WPCmd PEPostpone list} postponed]} {
+ error [list _action Resume $postponed "Click Back button to try again."]
+ }
+
+ set charset [lindex $postponed 1]
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+ WPStdHtmlHdr "Postponed Messages"
+ WPStyleSheets
+ cgi_puts ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context resume}
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu resume_cmds {}
+ }
+ }
+
+ cgi_table_data width=100% valign=top class=dialog {
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=100% {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top {
+ cgi_text "page=compose" type=hidden notab
+ cgi_text "style=Postponed" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+
+
+ set n 1
+ set fmt {{to Recipient} {date Date} {subj Subject}}
+ cgi_table_row class=\"gradient\" {
+ cgi_table_data class=indexhdr height=$_wp(indexheight) {
+ cgi_puts [cgi_nbspace]
+ }
+
+ foreach i $fmt {
+ cgi_table_data class=indexhdr {
+ cgi_puts [lindex $i 1]
+ }
+ }
+ }
+
+ set checked ""
+ set last [llength [lindex $postponed 0]]
+ for {set i 0} {$i < $last} {incr i} {
+
+ # cgi_html_comment [lindex [lindex $postponed 0] $i]
+ array set pa [join [lindex [lindex $postponed 0] $i]]
+
+ if {[info exists pa(uid)] == 0} {
+ continue;
+ }
+
+ if {$i % 2} {
+ set bgcolor #EEEEEE
+ } else {
+ set bgcolor #FFFFFF
+ }
+
+ if {[expr $i + 1] == $last} {
+ set checked checked
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data valign=top nowrap bgcolor=$bgcolor {
+ cgi_radio_button "uid=$pa(uid)" style="background-color:$bgcolor" $checked
+ }
+
+ foreach j $fmt {
+ cgi_table_data bgcolor=$bgcolor {
+ if {[info exists pa([lindex $j 0])]} {
+ cgi_puts $pa([lindex $j 0])
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ set checked ""
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center colspan=24 {
+ cgi_br
+ cgi_submit_button "resume=Resume Chosen Message"
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center colspan=24 {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top {
+ cgi_text "page=$oncancel" type=hidden notab
+ cgi_br
+ cgi_submit_button "cancel=Cancel"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ripcord.tcl b/web/cgi/alpine/1.0/ripcord.tcl
new file mode 100755
index 00000000..3514d20e
--- /dev/null
+++ b/web/cgi/alpine/1.0/ripcord.tcl
@@ -0,0 +1,64 @@
+#!./tclsh
+# $Id: ripcord.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ripcord.tcl
+#
+# Purpose: CGI script to generate html page used to arm
+# short server timeout
+
+# Input:
+set rip_vars {
+ {t "" 10}
+ {cid "Command ID"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $rip_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Adjusting Session Timeout"
+ }
+
+ cgi_body BGCOLOR=#ffffff {
+ if {[string compare $cid [WPCmd PEInfo key]]} {
+ cgi_put "Messing around, heh?"
+ } else {
+ cgi_put "Making Web Alpine Server Adjustments."
+ cgi_br
+ cgi_put "This should only take a momment..."
+ if {[catch {WPCmd PESession abandon 10}] == 0} {
+ set gonow 1
+ }
+ }
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ if {[info exists gonow]} {
+ cgi_puts "window.close();"
+ } else {
+ cgi_puts "window.setInterval('window.close()',5000);"
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/seldate.tcl b/web/cgi/alpine/1.0/seldate.tcl
new file mode 100755
index 00000000..e8e07c6f
--- /dev/null
+++ b/web/cgi/alpine/1.0/seldate.tcl
@@ -0,0 +1,193 @@
+#!./tclsh
+# $Id: seldate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# seldate.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for date selection
+
+# Input:
+set select_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing form for date select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search By Date"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_seldate.tcl}
+ catch {WPCmd PEInfo set help_context seldate}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=index type=hidden notab
+ cgi_text doselect=1 type=hidden notab
+ cgi_text by=date type=hidden notab
+ if {![WPCmd PEMailbox selected]} {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on arrival time."
+ cgi_puts "[cgi_nl][cgi_nl]Messages arriving [cgi_italic On] the date entered below will be marked with a check in the box next to their line in the Message List. Choosing [cgi_italic Since] marks messages arriving between today and the giving date (including the given date). Choosing [cgi_italic Before] marks messages arriving before (but not on) the given date."
+ cgi_puts "[cgi_nl][cgi_nl]Choose a date below and click 'Search' to choose messages, or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
+ }
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ cgi_br
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Messages dated "]
+
+ cgi_select datecase {
+ foreach i {On Since Before} {
+ cgi_option $i value=[string tolower $i]
+ }
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_select datemon {
+ if {$uid} {
+ set today [string tolower [WPCmd PEMessage $uid date month]]
+ } else {
+ set today [string tolower [clock format [clock seconds] -format %b]]
+ }
+
+ set months {
+ January jan
+ February feb
+ March mar
+ April Apr
+ May may
+ June jun
+ July jul
+ August aug
+ September sep
+ October oct
+ November nov
+ December dec
+ }
+
+ foreach {x y} $months {
+ if {$y == $today} {
+ cgi_option $x value=$y selected
+ } else {
+ cgi_option $x value=$y
+ }
+ }
+ }
+
+ cgi_select dateday {
+ if {$uid} {
+ set today [WPCmd PEMessage $uid date day]
+ } else {
+ set today [clock format [clock seconds] -format %d]
+ }
+
+ for {set i 1} {$i <= 31} {incr i} {
+ set v [format "%.2d" $i]
+ if {$v == $today} {
+ cgi_option $i value=$v selected
+ } else {
+ cgi_option $i value=$v
+ }
+ }
+ }
+
+ cgi_put ",[cgi_nbspace]"
+ cgi_select dateyear {
+ if {$uid} {
+ set now [WPCmd PEMessage $uid date year]
+ } else {
+ set now [clock format [clock seconds] -format "%Y"]
+ }
+
+ cgi_option $now value=$now selected
+ for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
+ cgi_option $n value=$n
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/select.tcl b/web/cgi/alpine/1.0/select.tcl
new file mode 100755
index 00000000..915254c7
--- /dev/null
+++ b/web/cgi/alpine/1.0/select.tcl
@@ -0,0 +1,303 @@
+#!./tclsh
+# $Id: select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# select.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for message searching selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ set selcount [WPCmd PEMailbox selected]
+
+ # given a uid, called from View page so use it for defaults
+ # otherwise if only one selected, use it for defaults
+ set thisuid 0
+ # leave disabled for now
+ if {0 && $uid > 0} {
+ set thisuid $uid
+ } elseif {$selcount == 1} {
+ }
+
+ if {$thisuid} {
+ if {[catch {WPCmd PEMessage $thisuid number} thisnum]} {
+ set thisuid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Select By Text"
+ WPStyleSheets
+ cgi_put ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" class=dialog "style=\"padding-left: 8%; padding-right: 8%\"" {
+
+ #catch {WPCmd PEInfo set wp_index_script fr_select.tcl}
+ catch {WPCmd PEInfo set help_context select}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ set mailboxname [WPCmd PEMailbox mailboxname]
+ cgi_division align=center class=dialog "style=\"padding-top:6; padding-bottom:8\"" {
+ cgi_puts "This page provides a way to search for specific messages within the currently open folder, [cgi_bold $mailboxname]. Simply fill in the criteria below and click the associated [cgi_italic Search] button. All messages matching the criteria will be marked with a check in the box next to their line in the Message List.[cgi_nl][cgi_nl]"
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching."
+ }
+
+ if {$selcount > 0} {
+ cgi_center {
+ cgi_division class=standout {
+ cgi_put "The folder '$mailboxname' has ${selcount} message"
+ if {[string length [WPplural $selcount]]} {
+ cgi_put "s with their checkboxes marked."
+ } else {
+ cgi_put " with its checkbox marked."
+ }
+
+ cgi_put "[cgi_nl]The Search specified below should"
+
+ cgi_select result {
+ cgi_option "apply to entire folder, adding result to those now marked" value=broad selected
+ cgi_option "apply only to marked messages, unmarking messages not matched" value=narrow
+ cgi_option "discard previous marks and search anew" value=new
+ }
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_put ""
+
+ cgi_put ""
+
+ cgi_put ""
+
+ cgi_center {
+ cgi_division class=standout {
+ cgi_puts "Note, if the number of messages in this folder is larger than the number of lines in the Message[cgi_nbspace]List, then some matching messages may not be visible without paging/scrolling."
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/select2.tcl b/web/cgi/alpine/1.0/select2.tcl
new file mode 100755
index 00000000..745254e7
--- /dev/null
+++ b/web/cgi/alpine/1.0/select2.tcl
@@ -0,0 +1,318 @@
+#!./tclsh
+# $Id: select2.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# select.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for message searching selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# coerce uid to zero since there's not method in WPL yet to initiate
+# a search from a particular message.
+set uid 0
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Select By Text"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_select.tcl}
+ catch {WPCmd PEInfo set help_context select}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for specific messsages within the currently open folder, [cgi_bold [WPCmd PEMailbox mailboxname]]. Simply fill in the criteria below and click the assoicated [cgi_italic Search] button. All messages matching the criteria will be marked with a check in the box next to their line in the Message List.[cgi_nl][cgi_nl]"
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching.[cgi_nl]"
+ }
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data {
+ cgi_table width=100% border=2 cellpadding=8 {
+ cgi_table_row {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=text
+ }
+
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_put [cgi_bold "Search for Text in Message Headers or Body"]
+ cgi_br
+ cgi_br
+ cgi_put "Select messages with text "
+ cgi_select textcase {
+ cgi_option "in" value=ton
+ cgi_option "NOT in" value=not
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_put [cgi_font face=tahoma,verdana,geneva "the message's "]
+ if {$uid} {
+ set fromaddr [WPCmd PEMessage $uid fromaddr]
+ set deftext $fromaddr
+ } else {
+ set deftext ""
+ }
+
+ set fields {
+ {Subject: field} subj ""
+ {From: field} from selected
+ {To: field} to ""
+ {Cc: field} cc ""
+ {recipient fields} recip ""
+ {participant fields} partic ""
+ {text, anywhere} any ""
+ }
+
+ cgi_select field {
+ foreach {x y z} $fields {
+ cgi_option $x value=$y $z
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_put [cgi_font face=tahoma,verdana,geneva "matching "]
+ cgi_text text=$deftext size=20 maxlength=256
+
+ if {$uid} {
+ set ft [WPJSQuote $fromaddr]
+ set tt [WPJSQuote [WPCmd PEMessage $uid toaddr]]
+ set st [WPJSQuote [WPCmd PEMessage $uid subject]]
+ if {[string length $ft] || [string length $tt] || [string length $st]} {
+ cgi_put "[cgi_nl]Using "
+ cgi_select defs {
+ cgi_option "- Nothing -" ""
+ if {[string length $ft]} {
+ cgi_option "From Address" value=$ft selected
+ }
+ if {[string length $tt]} {
+ cgi_option "To Address" value=$tt
+ }
+ if {[string length $st]} {
+ cgi_option "Subject Text" value=$st
+ }
+ }
+ cgi_put " of message ${thisnum}"
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=date
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_put [cgi_bold "Search for Messages by Date"]
+ cgi_br
+ cgi_br
+ cgi_put "Messages dated "
+
+ cgi_select datecase {
+ foreach i {On Since Before} {
+ cgi_option $i value=[string tolower $i]
+ }
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_select datemon {
+ if {$uid} {
+ set today [string tolower [WPCmd PEMessage $uid date month]]
+ } else {
+ set today [string tolower [clock format [clock seconds] -format %b]]
+ }
+
+ set months {
+ January jan
+ February feb
+ March mar
+ April Apr
+ May may
+ June jun
+ July jul
+ August aug
+ September sep
+ October oct
+ November nov
+ December dec
+ }
+
+ foreach {x y} $months {
+ if {$y == $today} {
+ cgi_option $x value=$y selected
+ } else {
+ cgi_option $x value=$y
+ }
+ }
+ }
+
+ cgi_select dateday {
+ if {$uid} {
+ set today [WPCmd PEMessage $uid date day]
+ } else {
+ set today [clock format [clock seconds] -format %d]
+ }
+
+ for {set i 1} {$i <= 31} {incr i} {
+ set v [format "%.2d" $i]
+ if {$v == $today} {
+ cgi_option $i value=$v selected
+ } else {
+ cgi_option $i value=$v
+ }
+ }
+ }
+
+ cgi_put ",[cgi_nbspace]"
+ cgi_select dateyear {
+ if {$uid} {
+ set now [WPCmd PEMessage $uid date year]
+ } else {
+ set now [clock format [clock seconds] -format "%Y"]
+ }
+
+ cgi_option $now value=$now selected
+ for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
+ cgi_option $n value=$n
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=status
+ }
+
+ cgi_table_data class=dialog align=center {
+ cgi_put [cgi_bold "Search for Messages with Certain Flag Settings"]
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Messages "]
+ cgi_select statcase {
+ cgi_option "flagged" value=ton
+ cgi_option "NOT flagged" value=not
+ }
+
+ cgi_puts [cgi_font face=tahoma,verdana,geneva " :"]
+
+ cgi_table {
+ set statuses {
+ Important imp
+ New new
+ Answered ans
+ Deleted del
+ }
+
+ foreach {x y} $statuses {
+ cgi_table_row {
+ cgi_table_data align=right width="42%" {
+ cgi_radio_button flag=$y
+ }
+
+ cgi_table_data align=left {
+ cgi_put $x
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 valign=top align=center class=dialog {
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/selstat.tcl b/web/cgi/alpine/1.0/selstat.tcl
new file mode 100755
index 00000000..0af0be61
--- /dev/null
+++ b/web/cgi/alpine/1.0/selstat.tcl
@@ -0,0 +1,156 @@
+#!./tclsh
+# $Id: selstat.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# selstat.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for status selection
+
+# Input:
+set select_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing form for status select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search By Status"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context selstat}
+ catch {WPCmd PEInfo set wp_index_script fr_selstat.tcl}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=index type=hidden notab
+ cgi_text doselect=1 type=hidden notab
+ cgi_text by=status type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on their status flags. Messages matching the status selected below will be marked with a check in the box next to their line in the Message List."
+ cgi_puts "[cgi_nl][cgi_nl]Choose the status criteria below and click 'Search', or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog colspan=2 {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Search for messages "]
+ cgi_select statcase {
+ cgi_option "flagged" value=ton
+ cgi_option "NOT flagged" value=not
+ }
+
+ cgi_puts [cgi_font face=tahoma,verdana,geneva " :"]
+ }
+ }
+
+ set statuses {
+ Important imp
+ New new
+ Answered ans
+ Deleted del
+ }
+
+ if {0} {
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 {
+ cgi_select flag {
+ foreach {x y} $statuses {
+ cgi_option $x value=$y
+ }
+ }
+ }
+ }
+ } else {
+ foreach {x y} $statuses {
+ cgi_table_row {
+ cgi_table_data align=right width="42%" {
+ cgi_radio_button flag=$y
+ }
+
+ cgi_table_data align=left {
+ cgi_put $x
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center colspan=2 {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog colspan=2 {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/seltext.tcl b/web/cgi/alpine/1.0/seltext.tcl
new file mode 100755
index 00000000..e0ce33bb
--- /dev/null
+++ b/web/cgi/alpine/1.0/seltext.tcl
@@ -0,0 +1,181 @@
+#!./tclsh
+# $Id: seltext.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# seltext.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for text selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# coerce uid to zero since there's not method in WPL yet to initiate
+# a search from a particular message.
+set uid 0
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search for Text"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_seltext.tcl}
+ catch {WPCmd PEInfo set help_context seltext}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ cgi_text "by=text" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for specific text in the messsages contained in [cgi_bold [WPCmd PEMailbox mailboxname]]. Enter your selection criteria below, and click [cgi_italic Search]. All messages matching the criteria will be marked with a check in the box next to their line in the Message List."
+ cgi_br
+ cgi_br
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching.[cgi_nl][cgi_nl]"
+ }
+ }
+ }
+
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Search for messages with text "]
+ cgi_select textcase {
+ cgi_option "in" value=ton
+ cgi_option "NOT in" value=not
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_put [cgi_font face=tahoma,verdana,geneva "the message's "]
+ if {$uid} {
+ set fromaddr [WPCmd PEMessage $uid fromaddr]
+ set deftext $fromaddr
+ } else {
+ set deftext ""
+ }
+
+ set fields {
+ {Subject: field} subj ""
+ {From: field} from selected
+ {To: field} to ""
+ {Cc: field} cc ""
+ {recipient fields} recip ""
+ {participant fields} partic ""
+ {text, anywhere} any ""
+ }
+
+ cgi_select field {
+ foreach {x y z} $fields {
+ cgi_option $x value=$y $z
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_put [cgi_font face=tahoma,verdana,geneva "matching "]
+ cgi_text text=$deftext size=30 maxlength=256
+
+ if {$uid} {
+ set ft [WPJSQuote $fromaddr]
+ set tt [WPJSQuote [WPCmd PEMessage $uid toaddr]]
+ set st [WPJSQuote [WPCmd PEMessage $uid subject]]
+ if {[string length $ft] || [string length $tt] || [string length $st]} {
+ cgi_put "[cgi_nl]Using "
+ cgi_select defs {
+ cgi_option "- Nothing -" ""
+ if {[string length $ft]} {
+ cgi_option "From Address" value=$ft selected
+ }
+ if {[string length $tt]} {
+ cgi_option "To Address" value=$tt
+ }
+ if {[string length $st]} {
+ cgi_option "Subject Text" value=$st
+ }
+ }
+ cgi_put " of message ${thisnum}"
+ }
+ }
+ }
+ }
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/spellcheck.tcl b/web/cgi/alpine/1.0/spellcheck.tcl
new file mode 100755
index 00000000..ac1f9fe5
--- /dev/null
+++ b/web/cgi/alpine/1.0/spellcheck.tcl
@@ -0,0 +1,399 @@
+#!./tclsh
+# $Id: spellcheck.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# spellcheck.tcl
+#
+# Purpose: CGI script to generate html form used to check
+# body text spelling in the webpine-lite composer
+
+# Input:
+set query_vars {
+ {repqstr "" ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the page to correct spelling
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set check_menu {
+ {
+ {expr 0}
+ {
+ {
+ # * * * * DONE * * * *
+ cgi_puts ""
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Done * * * *
+ cgi_submit_button "spell=Apply" class=navtext
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Cancel * * * *
+ cgi_submit_button "spell=Cancel" class=navtext
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * Help * * * *
+ cgi_submit_button "help=Get Help" class=navtext
+ }
+ }
+ }
+}
+
+set done 0
+set first 1
+set spellresult {}
+set line {}
+
+proc spelled {pipe} {
+ global done spellresult line first
+
+ if {[eof $pipe]} {
+ catch {close $pipe}
+ set done 1
+ return
+ }
+
+ gets $pipe w
+
+ if {$first == 0} {
+ if {[string length $w]} {
+ lappend line $w
+ } else {
+ lappend spellresult $line
+ set line {}
+ }
+ } else {
+ set first 0
+ }
+}
+
+
+WPEval $query_vars {
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata]} {
+ set problem "Can't read message text"
+ } else {
+ foreach p $msgdata {
+ if {[string compare [lindex $p 0] body] == 0} {
+ set body [lindex $p 1]
+ break
+ }
+ }
+
+ if {![info exists body]} {
+ set problem "Can't find body in message text"
+ } else {
+ # spell check and gather results
+ # set tmpfile
+ for {set i 0} {$i < 5} {incr i} {
+ set tmpfile [file join $_wp(sockdir) "sc[pid][expr rand()]"]
+ if {[file exists $tmpfile] == 0} {
+ if {[catch {open $tmpfile w} ofp] == 0} {
+ break
+ }
+ }
+ unset tmpfile
+ }
+
+ if {![info exists tmpfile]} {
+ set problem "Can't create temporary file"
+ }
+ }
+ }
+
+ if {![info exists problem]} {
+ if {[string length $repqstr]} {
+ set quoter $repqstr
+ } else {
+ set quoter "> "
+ }
+
+ foreach l $body {
+ if {[string compare $l "---------- Forwarded message ----------"] == 0} {
+ break;
+ } elseif {[regexp "^$quoter" $l]} {
+ puts $ofp ""
+ } else {
+# regsub -all {\$} $l {\$} l
+ puts $ofp "^${l}"
+ }
+ }
+
+ close $ofp
+
+ set cmd [list $_wp(ispell) "-a"]
+ set pipe [open "|$cmd < $tmpfile 2> /dev/null" r]
+
+ fileevent $pipe readable [list spelled $pipe]
+
+ vwait done
+
+ catch {file delete $tmpfile}
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Check Spelling"
+ WPStyleSheets
+ cgi_put ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text "page=compose" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "restore=1" type=hidden notab
+ cgi_text "style=Spell" type=hidden notab
+ cgi_text "last_line=[llength $spellresult]" type=hidden notab
+ if {[string length $repqstr]} {
+ cgi_text "repqstr=$repqstr" type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu check_menu {}
+ }
+ }
+
+ cgi_table_data valign=top class=dialog {
+
+ set badlines {}
+ array set badwords {}
+ set badcount 0
+ for {set n 0} {$n < [llength $spellresult]} {incr n} {
+ set words {}
+ foreach ms [lindex $spellresult $n] {
+ if {[regexp {& ([a-zA-Z0-9]*) [0-9]+ ([0-9]+):[ ]?(.*)$} $ms match w o s]} {
+ incr badcount
+ if {[regsub -all {, } $s { } sugs] < 0} {
+ continue
+ }
+
+ lappend words [list $w [expr {$o - 1}] $sugs]
+ if {[info exists badwords($w)]} {
+ incr badwords($w)
+ } else {
+ set badwords($w) 1
+ }
+ } elseif {[regexp {# ([a-zA-Z0-9]*) ([0-9]+)$} $ms match w o]} {
+ incr badcount
+ lappend words [list $w [expr {$o - 1}] {}]
+ if {[info exists badwords($w)]} {
+ incr badwords($w)
+ } else {
+ set badwords($w) 1
+ }
+ }
+ }
+
+ if {[llength $words]} {
+ lappend badlines [list $n $words]
+ }
+ }
+
+ if {[info exists problem] || $badcount <= 0} {
+ cgi_table align=center valign=top height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=bottom heigh="20%" {
+ if {[info exists problem]} {
+ cgi_puts "Problem detected: $problem"
+ } else {
+ cgi_puts "No misspelled words found."
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center valign=top {
+ cgi_put "Click "
+ cgi_submit_button "cancel=Continue" class=navtext
+ cgi_put " to return to your composition."
+ }
+ }
+ }
+ } else {
+ cgi_table width="95%" border=0 align=center valign=top {
+ cgi_table_row {
+ cgi_table_data align=center "style=padding-top:10;padding-bottom:10" {
+ cgi_puts "Web Alpine found [cgi_bold $badcount] possibly misspelled word[WPplural $badcount]."
+ cgi_puts "Grouped by the line on which they were found, misspelled words can be corrected by either selecting from the list of suggestions, when available (note, first option always blank), or entering the corrected spelling directly."
+ cgi_puts "When finished click [cgi_italic Apply] to correct the text, or [cgi_italic Cancel] to return to the composition unchanged."
+ }
+ }
+
+ foreach sl $badlines {
+ set lnum [lindex $sl 0]
+ set locs {}
+
+ cgi_table_row {
+ cgi_table_data bgcolor=white align=left height=20 class=view "style=font-family:courier;padding:8" {
+ set ol [lindex $body $lnum]
+ set l ""
+ set o 0
+ foreach w [lindex $sl 1] {
+ set offset [lindex $w 1]
+ set word [lindex $w 0]
+ set wordlen [string length $word]
+ append l "[cgi_quote_html [string range $ol $o [expr {$offset - 1}]]][cgi_url $word "#${lnum}_[lindex $w 1]_${wordlen}" class=mispell]"
+ set o [expr {$offset + $wordlen}]
+ }
+
+ append l [string range $ol $o end]
+
+ cgi_put $l
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table width=90% align=center border=0 {
+
+ foreach w [lindex $sl 1] {
+ set word [lindex $w 0]
+ set wordlen [string length $word]
+ set wordloc "${lnum}_[lindex $w 1]_${wordlen}"
+
+ cgi_table_row {
+
+ if {[llength [lindex $w 2]] > 0} {
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put "Replace [cgi_anchor_name $wordloc][cgi_bold $word] with "
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_select s_${wordloc} class=correction {
+ cgi_option "" value=
+ foreach sug [lindex $w 2] {
+ cgi_option $sug value=$sug
+ }
+ }
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put " or change to "
+ }
+ } else {
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put "Change [cgi_anchor_name $wordloc][cgi_bold $word] to "
+ }
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_text r_${wordloc}= "size=[expr {$wordlen + 4}]" maxlength=64 class=correction
+ }
+
+ cgi_table_data align=left class=correction width=90% colspan=3 {
+
+ if {$badwords($word) > 1} {
+ if {![info exists badseen($word)]} {
+ switch $badwords($word) {
+ 2 { set badtimes both }
+ default { set badtimes "all $badwords($word)" }
+ }
+
+ cgi_put " and "
+ cgi_checkbox a_${wordloc}
+ cgi_put " apply to $badtimes occurrences"
+ set badseencount($word) 1
+ } else {
+ incr badseencount($word)
+ switch $badseencount($word) {
+ 2 { set bad1 "second " ; set bad2 "" }
+ 3 { set bad1 "third " ; set bad2 "" }
+ 4 { set bad1 "fourth " ; set bad2 "" }
+ 5 { set bad1 "fifth " ; set bad2 "" }
+ 6 { set bad1 "sixth " ; set bad2 "" }
+ default { set bad1 "" ; set bad2 " $badseencount($word)" }
+ }
+ cgi_put "(${bad1}occurrence${bad2})"
+ }
+
+ lappend badseen($word) $wordloc
+ } else {
+ cgi_put [cgi_img [WPimg dot2]]
+ }
+ }
+
+ lappend locs $wordloc
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=8 {
+ cgi_text "l_$lnum=[join $locs {,}]" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center height=50 {
+ foreach l [array names badseen] {
+ set m $badseen($l)
+ cgi_text "e_[lindex $m 0]=[join [lrange $m 1 end] {,}]" type=hidden notab
+ }
+
+ cgi_submit_button "spell=Apply" class=navtext
+ cgi_submit_button "spell=Cancel" class=navtext
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/takeaddr.tcl b/web/cgi/alpine/1.0/takeaddr.tcl
new file mode 100755
index 00000000..328febb6
--- /dev/null
+++ b/web/cgi/alpine/1.0/takeaddr.tcl
@@ -0,0 +1,215 @@
+#!./tclsh
+# $Id: takeaddr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# takeaddr.tcl
+#
+# Purpose: CGI script to take addresses to address book
+
+# Input:
+set takeaddr_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Command Menu definition for Message View Screen
+set take_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&topic=take&index=none&oncancel=view%2526op%253DTake class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $takeaddr_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result "Please close this window."]
+ }
+
+ if {$uid > 0 && [catch {WPCmd PEMessage $uid takeaddr} tainfo]} {
+ error [list _action "takeaddr $uid" $tainfo "Click Browsers Back Button."]
+ }
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Take Address"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+ cgi_table border=0 cellspacing=0 cellpadding=0 height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar width=112 {
+ cgi_table bgcolor=$_wp(menucolor) border=0 "style=\"padding-left: 2\"" {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu take_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top class=navbar {
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center valign=top height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=dialog {
+ cgi_table align=center border=0 width=75% height=80 class=dialog {
+ cgi_table_row {
+ cgi_table_data class=dialog align=center valign=middle {
+ set txt "Select the address that you would like to take to your address book"
+ if {[llength $tainfo] > 1} {
+ set txt "$txt, or select multiple addresses to create a list."
+ } else {
+ set txt "$txt."
+ }
+ append txt "When finished, click [cgi_italic "Take Address"] to create an entry"
+ append txt " or [cgi_italic "Cancel"] to return, creating nothing."
+ #cgi_puts [cgi_bold $txt ]
+ cgi_puts $txt
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data valign=top height=99% class=dialog {
+
+ set books [WPCmd PEAddress books]
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top name=takeaddr {
+ cgi_text page=view type=hidden notab
+ cgi_text uid=$uid type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ if {[llength $books] <= 1} {
+ cgi_text "book=0" type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center valign=top width="70%" height="100%" {
+ if {[llength $books] > 1} {
+ cgi_table_row {
+ cgi_table_data colspan=2 valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=0 "style=padding-top:20;padding-bottom:20" {
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts [cgi_bold "Take to address book"]
+ }
+ cgi_table_data align=right valign=top {
+ cgi_puts [cgi_bold "[cgi_nbspace]:[cgi_nbspace]"]
+ }
+ cgi_table_data align=left {
+ cgi_select book {
+ foreach book $books {
+ cgi_option [lindex $book 1] value=[lindex $book 0]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ set linenum 1
+ foreach taline $tainfo {
+ set printstr [lindex $taline 0]
+ set addr [lindex $taline 1]
+ set sugs [lindex $taline 2]
+ if {[llength $addr] == 0 && [llength $sugs] == 0} {
+ cgi_table_row {
+ cgi_table_data align=center class=dialog colspan=2 "style=xpadding-left:8%;xpadding-right:8%;padding-top:20;padding-bottom:20" {
+ cgi_put $printstr
+ }
+ }
+
+ continue
+ }
+
+ if {[incr linenum] % 2} {
+ set bgcolor #EEEEEE
+ } else {
+ set bgcolor #FFFFFF
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data align=right {
+ cgi_checkbox "taList=tl${linenum}" style=background-color:$bgcolor
+ if {[llength $addr] > 0} {
+ if {[set tmp [lindex $addr 0]] != {}} {
+ cgi_text "tl${linenum}p=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $addr 1]] != {}} {
+ cgi_text "tl${linenum}m=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $addr 2]] != {}} {
+ cgi_text "tl${linenum}h=$tmp" type=hidden notab
+ }
+ }
+ if {[llength $sugs] > 0} {
+ if {[set tmp [lindex $sugs 0]] != {}} {
+ cgi_text "tl${linenum}n=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 1]] != {}} {
+ cgi_text "tl${linenum}fn=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 2]] != {}} {
+ cgi_text "tl${linenum}fcc=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 3]] != {}} {
+ cgi_text "tl${linenum}c=$tmp" type=hidden notab
+ }
+ }
+ }
+ cgi_table_data align=left {
+ regsub -all "<" $printstr "\\<" printstr
+ regsub -all ">" $printstr "\\>" printstr
+ cgi_puts $printstr
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height="99%" colspan=2 valign=top align=center class=dialog "style=padding-top:16" {
+ cgi_submit_button "op=Take Address"
+ cgi_submit_button takecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/tclsh b/web/cgi/alpine/1.0/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/alpine/1.0/tclsh
@@ -0,0 +1 @@
+../tclsh
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/tconfig.tcl b/web/cgi/alpine/1.0/tconfig.tcl
new file mode 100755
index 00000000..6274e849
--- /dev/null
+++ b/web/cgi/alpine/1.0/tconfig.tcl
@@ -0,0 +1,1183 @@
+# $Id: tconfig.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# tconfig.tcl
+#
+# Purpose: CGI script to configure features/variables
+
+# Input:
+set conf_vars {
+ {newconf {} 0}
+ {oncancel "Nothing set for oncancel"}
+ {wv "" general}
+ {vlavar "" ""}
+}
+
+# Output:
+#
+
+# read config
+source genvars.tcl
+
+set confs {
+ {general General g genconf}
+ {msgl "Message List" ml mlconf}
+ {msgv "Message View" mv mvconf}
+ {composer Composer c compconf}
+ {address "Address Books" ab abconf}
+ {folder "Folders" f fldrconf}
+ {rule "Rules" r ruleconf}
+}
+
+
+set var_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Save Config * * * *
+ #cgi_image_button save=[WPimg but_save] border=0 alt="Save Config"
+ cgi_submit_button save=Save
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Close * * * *
+ #cgi_image_button cancel=[WPimg but_cancel] border=0 alt="Cancel"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $conf_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+set type $wv
+WPCmd set conf_page $type
+switch -- $type {
+ msgl {
+ set goodvars $msglist_vars
+ }
+ msgv {
+ set goodvars $msgview_vars
+ }
+ address {
+ set goodvars $address_vars
+ }
+ folder {
+ set goodvars $folder_vars
+ }
+ composer {
+ set goodvars $composer_vars
+ }
+ general {
+ set goodvars $general_vars
+ }
+ rule {
+ set goodvars $rule_vars
+ }
+}
+set typeexp "General"
+
+proc button_text {but butno fg bg text} {
+ if {[string length $fg]} {
+ set fg "color: #${fg};"
+ }
+
+ if {[string length $bg]} {
+ set bg "background-color: #${bg}"
+ }
+
+ cgi_puts ""
+
+ cgi_put [cgi_span "style=$fg $bg" $text]
+
+ cgi_puts ""
+}
+
+proc button_checked {def but} {
+ if {[string compare $def $but]} {
+ return ""
+ } else {
+ return checked
+ }
+}
+
+foreach conf $confs {
+ if {[string compare $type [lindex $conf 0]] == 0} {
+ append ttitle [cgi_imglink "[lindex $conf 2]tab"]
+ lappend conftitle [list [cgi_imglink "[lindex $conf 2]tab"] {} {}]
+ set typeexp [lindex $conf 1]
+ set _wp(helpname) [lindex $conf 3]
+ } else {
+ append ttitle "";
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+if {$newconf == 1} {
+ WPCmd PEConfig newconf
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Configuration"
+ WPStyleSheets
+
+ cgi_put ""
+
+ cgi_javascript {
+ cgi_put "function setop(b,i){"
+ cgi_put " eval('document.varconfig.'+b+'\['+i+'\].checked = true');"
+ cgi_put " return false;"
+ cgi_put "}"
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ set postjs ""
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=varconfig enctype=multipart/form-data target=_top {
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "page=conf_process" type=hidden notab
+
+ cgi_table width="100%" cellpadding=0 cellspacing=0 {
+ cgi_table_row {
+ cgi_table_data width=112 bgcolor=$_wp(menucolor) {
+ cgi_puts [cgi_img [WPimg dot2] width=1 height=1]
+ }
+ cgi_table_data align=right nowrap background="[WPimg [file join tabs tabbg]]" {
+ cgi_put $ttitle
+ }
+ }
+ }
+ if {0} {
+ cgi_division align=right {
+ cgi_put $ttitle
+ }
+ }
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu var_menu {}
+ }
+ }
+
+ #
+ # In main body of screen goe confg list
+ #
+ cgi_table_data valign=top width="100%" class=dialog "style=\"padding-left: 6\"" {
+ cgi_h2 [cgi_bold "${typeexp} configuration settings:"]
+ switch -- $type {
+ msgl {
+ cgi_text "wv=msgl" type=hidden notab
+ }
+ msgv {
+ cgi_text "wv=msgv" type=hidden notab
+ }
+ address {
+ cgi_text "wv=address" type=hidden notab
+ }
+ folder {
+ cgi_text "wv=folder" type=hidden notab
+ }
+ composer {
+ cgi_text "wv=composer" type=hidden notab
+ }
+ general {
+ cgi_text "wv=general" type=hidden notab
+ }
+ rule {
+ cgi_text "wv=rule" type=hidden notab
+ }
+ }
+ set setfeatures [WPCmd PEConfig featuresettings]
+ set icnt 0
+ cgi_table border=0 cellspacing=0 cellpadding=5 width=98% {
+ foreach tmpvar $goodvars {
+ set vtypeinp [lindex $tmpvar 0]
+ set varname [lindex $tmpvar 1]
+ set vardesc [lindex $tmpvar 2]
+
+ if {[catch {WPCmd PEConfig varget $varname} section] == 0} {
+ set varvals [lindex $section 0]
+ set vartype [lindex $section 1]
+ set vtvals [lindex $section 2]
+ set v_is_default [lindex $section 3]
+ set v_is_fixed [lindex $section 4]
+ } else {
+ # UNKNOWN VAR: configure disabled?
+ continue
+ }
+
+ switch -- $vtypeinp {
+ var {
+ cgi_table_row {
+
+ cgi_table_data align=right valign=top nowrap width=50% {
+ if {[info exists varname]} {
+ # set script "help.tcl?vn=$varname"
+ # set js "cOpen('$script', 'help', 'scrollbars=yes', 600, 400); return false;"
+ # set js "return vh('$varname')"
+ # cgi_puts [WPurl null "" $varname "" onClick=$js]
+ # cgi_puts [WPurl null "" $vardesc "" onClick=$js]
+ # cgi_submit_button varhelp=$vardesc class=lnkbt
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ }
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=2 width=50% {
+ switch -- $vartype {
+ listbox {
+ cgi_select $varname align=left {
+ foreach tmpvt $vtvals {
+ set tmpvttxt [lindex $tmpvt 0]
+ set tmpvtval $tmpvttxt
+ if {[llength $tmpvt] > 1} {
+ set tmpvtval [lindex $tmpvt 1]
+ }
+ if {[string compare $tmpvtval [lindex $varvals 0]]} {
+ if {[llength $tmpvt] > 1} {
+ cgi_option "${tmpvttxt}" "value=${tmpvtval}"
+ } else {
+ cgi_option "${tmpvttxt}" "value=${tmpvttxt}"
+ }
+ } else {
+ if {[llength $tmpvt] > 1} {
+ cgi_option "$tmpvttxt" "value=${tmpvtval}" selected
+ } else {
+ cgi_option "$tmpvttxt" selected
+ }
+ }
+ }
+ }
+ }
+ textarea {
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ set addfield 0
+ set tiwidth 30
+ foreach varval $varvals {
+ if {[string length $varval] > [expr {[info exists maxwidth] ? $maxwidth : 0}]} {
+ set maxwidth [string length $varval]
+ incr maxwidth 5
+ }
+ }
+ if {[info exists maxwidth]} {
+ set tiwidth $maxwidth
+ }
+ if {$tiwidth < 20} {
+ set tiwidth 20
+ } elseif {$tiwidth > 50} {
+ set tiwidth 50
+ }
+ cgi_table_row {
+ cgi_table_data colspan=4 {
+ cgi_image_button vla.$varname=[WPimg cf_add] alt="Add Value"
+ }
+ }
+ if {[string compare $vlavar $varname] == 0} {
+ set addfield 1
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text "varlistadd=$varname" type=hidden notab
+ cgi_text "$varname-add=" type=text size=$tiwidth
+ }
+ cgi_table_data colspan=3 {
+ cgi_puts [cgi_font class=cfntc "(The value entered here will be added.)"]
+ }
+ }
+ }
+ set i 0
+ set vvsz [llength $varvals]
+ foreach varval $varvals {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text vle.$varname.$i=$varval type=text size=$tiwidth
+ }
+ cgi_table_data {
+ cgi_image_button vld.$varname.$i=[WPimg cf_delete] alt="Delete Value"
+ }
+ cgi_table_data {
+ if {$i < [expr {$vvsz - 1}]} {
+ cgi_image_button vlsd.$varname.$i=[WPimg cf_shdown] alt="Shuffle Down"
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_table_data width=50% {
+ if {$i || $addfield} {
+ cgi_image_button vlsu.$varname.$i=[WPimg cf_shup] alt="Shuffle Up"
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ incr i
+ }
+ cgi_text "$varname-sz=$i" type=hidden notab
+ }
+ }
+ default {
+ set size [string length [lindex $varvals 0]]
+ if {$size == 0} {
+ set size 20
+ } else {
+ incr size 5
+ }
+ cgi_text "$varname=[lindex $varvals 0]" type=text size=$size tableindex=1
+ }
+ }
+ }
+ }
+ }
+ feat {
+ cgi_table_row {
+ cgi_table_data align=right width=50% {
+ if {[info exists varname]} {
+ # cgi_submit_button feathelp=$vardesc class=lnkbt
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ }
+ cgi_table_data {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=3 width=50% {
+ if {[lsearch $setfeatures $varname] >= 0} {
+ cgi_checkbox $varname checked class=dialog
+ } else {
+ cgi_checkbox $varname class=dialog
+ }
+ }
+ }
+
+ }
+ special {
+ switch -- $varname {
+ wp-columns {
+ cgi_table_row {
+ cgi_table_data align=right valign=top nowrap {
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.${varname}=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=2 {
+ set cols [WPCmd PEConfig columns]
+ cgi_select columns align=left {
+ for {set i 20} {$i <= 128} {incr i 4} {
+ if {$i == $cols} {
+ cgi_option $i "value=$i" selected
+ } else {
+ cgi_option $i "value=$i"
+ }
+ }
+ }
+ }
+ }
+ }
+ left-column-folders {
+ cgi_table_row {
+ cgi_table_data align=right valign=top nowrap {
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ cgi_table_data valign=top {
+ cgi_puts [cgi_nbspace]
+ }
+ cgi_table_data align=left colspan=2 {
+ if {[catch {WPSessionState left_column_folders} cols]} {
+ set cols $_wp(fldr_cache_def)
+ }
+
+ cgi_select fcachel align=left {
+ for {set i 0} {$i <= $_wp(fldr_cache_max)} {incr i} {
+ if {$i == $cols} {
+ cgi_option $i "value=$i" selected
+ } else {
+ cgi_option $i "value=$i"
+ }
+ }
+ }
+ }
+ }
+ }
+ signature {
+ cgi_table_row {
+ cgi_table_data colspan=4 align=center {
+ cgi_puts ""
+ }
+ }
+
+ }
+ filters -
+ scores -
+ indexcolor -
+ collections {
+ set flt 0
+ set cll 0
+ switch $varname {
+ filters {
+ set flt 1
+ set descsing "Filter"
+ set filts [WPCmd PEConfig filters]
+ set lvals $filts
+ set varhelp 1
+ }
+ scores {
+ set flt 1
+ set descsing "Scores"
+ set filts [WPCmd PEConfig scores]
+ set lvals $filts
+ set varhelp 1
+ }
+ indexcolor {
+ set flt 1
+ set descsing "Index Colors"
+ set filts [WPCmd PEConfig indexcolors]
+ set lvals $filts
+ set varhelp 1
+ }
+ default {
+ set cll 1
+ set descsing "Collection"
+ set colls [WPCmd PEConfig collections]
+ set lvals $colls
+ }
+ }
+ set tasize [llength $lvals]
+ cgi_table_row {
+ cgi_table_data align=center colspan=4 width=50% {
+ cgi_table border=0 cellpadding=3 cellspacing=0 width=100% {
+ cgi_table_row {
+ cgi_table_data width=50% {
+ cgi_puts [cgi_bold $vardesc]
+ }
+ if {[info exists varhelp]} {
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ }
+ cgi_table_data "style=\"padding-left: 10px\"" {
+ cgi_image_button vla.$varname=[WPimg cf_add] alt="Add $descsing"
+ }
+ }
+ set i 0
+ foreach lval $lvals {
+ cgi_table_row {
+ cgi_table_data "style=\"padding-left: 8px\"" {
+ if {$flt} {
+ cgi_puts [cgi_font class=cfvn "[cgi_nbspace]$lval"]
+ } else {
+ cgi_puts "[cgi_font class=cfvn [lindex $lval 0]] [cgi_span class=cfval "style=margin-left: 8px" [lindex $lval 1]]"
+ }
+ }
+
+ cgi_table_data "style=\"padding-left: 10px\"" valign=top width=30% {
+ cgi_unbreakable {
+ cgi_image_button vle.$varname.$i=[WPimg cf_edit] alt="Edit $descsing"
+
+ cgi_image_button vld.$varname.$i=[WPimg cf_delete] alt="Delete $descsing"
+
+ if {$i < [expr {$tasize - 1}]} {
+ cgi_image_button vlsd.$varname.$i=[WPimg cf_shdown] alt="Shuffle Down"
+ } else {
+ cgi_puts [cgi_img [WPimg dot2] width=18]
+ }
+
+ if {$i} {
+ cgi_image_button vlsu.$varname.$i=[WPimg cf_shup] alt="Shuffle Up"
+ }
+ }
+ }
+ }
+ incr i
+ }
+ cgi_text "$varname-sz=$i" type=hidden notab
+ }
+ }
+ }
+ }
+ index-format {
+ cgi_table_row {
+ cgi_table_data align=left colspan=4 {
+ cgi_puts ""
+ }
+ }
+ }
+ view-colors {
+ cgi_table_row {
+ cgi_table_data colspan=4 {
+ cgi_puts ""
+ }
+ }
+ }
+ }
+ }
+ }
+ incr icnt
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/view.tcl b/web/cgi/alpine/1.0/view.tcl
new file mode 100755
index 00000000..cf290e43
--- /dev/null
+++ b/web/cgi/alpine/1.0/view.tcl
@@ -0,0 +1,920 @@
+# $Id: view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script to generate html output associated
+# with a message's particular text displayed in
+# the "body" frame
+
+# Input:
+set view_vars {
+ {message {} 0}
+ {first {} 1}
+ {top {} 0}
+ {bod_first {} 0}
+ {bod_prev {} 0}
+ {bod_next {} 0}
+ {bod_last {} 0}
+ {fullhdr {} ""}
+ {reload {} 0}
+ {uid {} 0}
+ {cid {} 0}
+ {goto {} ""}
+ {gonum {} 0}
+ {save {} ""}
+ {f_name {} ""}
+ {f_colid {} 0}
+ {takecancel {} ""}
+ {savecancel {} 0}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+ {flipdelete {} 0}
+ {delete {} ""}
+ {undelete {} ""}
+ {replyall {} ""}
+ {replytext {} ""}
+ {submitted {} 0}
+ {printable {} 0}
+ {op {} ""}
+ {showimg {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+#set use_icon_for_status 1
+
+set hacktoken __URL__TEXT__
+
+## read vars
+foreach item $view_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} webpine_key]} {
+ error [list _action "command ID" $webpine_key]
+}
+
+# make sure message to be "viewed" is still available
+catch {unset errstr}
+if {[catch {WPCmd PEMailbox messagecount} messagecount]} {
+ set errstr $messagecount
+} elseif {$uid > 0 && [catch {WPCmd PEMessage $uid number} message]} {
+ set errstr $message
+} elseif {$message > 0 && $message <= $messagecount && [catch {WPCmd PEMailbox uid $message} uid]} {
+ set errstr $uid
+} elseif {!($message && $uid)} {
+ set errstr "Unknown message number"
+}
+
+if {[info exists errstr]} {
+ switch $op {
+ Reply -
+ Forward {
+ catch {WPCmd set wp_spec_script fr_view.tcl}
+ catch {WPCmd set uid $uid}
+ source [WPTFScript main]
+ }
+ default {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=view"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=#ffffff {
+ cgi_table border=0 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data width="20%" {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ cgi_table_data bgcolor=#ffffff class=notice {
+ cgi_puts "\[[cgi_nbspace]"
+ if {[string first "PEMessage: UID " $errstr] >= 0} {
+ cgi_puts "The message referred to is no"
+ cgi_puts "longer available."
+ cgi_p
+ cgi_puts "An error has been detected that indicates you may"
+ cgi_puts "have WebPine running in multiple browser windows."
+ cgi_p
+ cgi_puts "Please close all other windows that are displaying"
+ cgi_puts "WebPine pages."
+ } else {
+ cgi_puts "Message Unavailable: $errstr."
+ }
+ cgi_p
+ cgi_puts "Click \"[cgi_url [WPCmd PEMailbox mailboxname] fr_index.tcl target=spec]\" in the column on the left to return to the updated Message List.[cgi_nbspace]\]"
+ }
+ cgi_table_data width="20%" {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} else {
+
+ # make sure any caching doesn't screw this setting
+ catch {WPCmd set wp_spec_script fr_view.tcl}
+
+ set zoomed [WPCmd PEMailbox zoom]
+
+ set onload "onLoad="
+ set onunload "onUnload="
+
+ if {[info exists _wp(exitonclose)]} {
+ set closescript [cgi_buffer WPExitOnClose]
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ # perform any requested actions
+ if {$flipdelete == 1} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Delete: Invalid command ID!"]
+ } elseif {[WPCmd PEMessage $uid flag deleted]} {
+ if {[catch {WPCmd PEMessage $uid flag deleted 0} result]} {
+ lappend newmail [list "Error UNdeleting $message: $result"]
+ }
+ } else {
+ if {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error deleting $message: $result"]
+ } else {
+ # bug: handle delete-skips-deleted
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number]]
+ set uid [WPCmd PEMailbox uid $message]
+ }
+ }
+ } elseif {[string compare "report spam" [string tolower $op]] == 0} {
+ if {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Spamify: Invalid command ID!"]
+ } else {
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ set savedef [WPCmd PEMailbox savedefault]
+ if {[WPCmd PEFolder exists [lindex $savedef 0] $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create [lindex $savedef 0] $_wp(spamfolder)
+ }
+
+ WPCmd PEMessage $uid save [lindex $savedef 0] $_wp(spamfolder)
+ } result]} {
+ lappend newmail [list "Error spamifying message $message: $result"]
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error spamifying message $message: $result"]
+ } else {
+ set n [WPCmd PEMessage $uid number]
+ if {[info exists _wp(spamsubj)]} {
+ set subj $_wp(spamsubj)
+ } else {
+ set subj ""
+ }
+
+ if {[catch {WPCmd PEMessage $uid spam $_wp(spamaddr) $subj} result]} {
+ lappend newmail [list "Can't Report Spam: $result"]
+ } else {
+ lappend newmail [list "Message $n reported as Spam and flagged for deletion"]
+ }
+ }
+ }
+ }
+ } elseif {$delete == 1 || [string compare delete [string tolower $op]] == 0} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Delete: Invalid command ID!"]
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error deleting message $message: $result"]
+ } else {
+ set n [WPCmd PEMessage $uid number]
+ # lappend newmail [list "Message $n deleted"]
+ # bug: handle delete-skips-deleted
+ set message [WPCmd PEMailbox next $n]
+ set uid [WPCmd PEMailbox uid $message]
+ lappend newmail [list "Message $n flagged for deletion"]
+ }
+ } elseif {$delete == 0 || $undelete == 1 || [string compare undelete [string tolower $op]] == 0} {
+ if {$cid != $webpine_key} {
+ catch {WPCmd PEInfo statmsg "Invalid command ID!"}
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 0}]} {
+ lappend newmail [list "Error UNdeleting message $message"]
+ } else {
+ lappend newmail [list "Deletion mark for message [WPCmd PEMessage $uid number] removed"]
+ }
+ } elseif {[string length $goto]} {
+ if {[regexp {^([0-9]+)$} $gonum n]} {
+ if {$n > 0 && $n <= [WPCmd PEMailbox last]} {
+ set message $n
+ set uid [WPCmd PEMailbox uid $message]
+ } else {
+ lappend newmail [list "Jump value out of range: $gonum"]
+ }
+ } else {
+ if {[string length $gonum]} {
+ lappend newmail [list "Unrecognized Jump value: $gonum"]
+ } else {
+ lappend newmail [list "Enter message number, then click 'Jump'"]
+ }
+ }
+ } elseif {$savecancel == 1 || [string compare cancel [string tolower $savecancel]] == 0} {
+ lappend newmail [list "Save cancelled. Folder not created."]
+ } elseif {[string compare browse [string tolower $op]] == 0} {
+ _cgi_set_uservar onselect main
+ _cgi_set_uservar oncancel main
+ _cgi_set_uservar controls 2
+ source [WPTFScript savebrowse]
+ set nopage 1
+ } elseif {[string compare take [string tolower $op]] == 0} {
+ source [WPTFScript take]
+ set nopage 1
+ } elseif {[string compare "take address" [string tolower $op]] == 0} {
+ _cgi_set_uservar take 1
+ set addrs ""
+ if {[catch {cgi_import taList}] == 0} {
+ foreach ta $taList {
+ if {[catch {cgi_import_as ${ta}p xp}]} {
+ set xp ""
+ }
+
+ if {[catch {cgi_import_as ${ta}m xm}]} {
+ set xm ""
+ }
+
+ if {[catch {cgi_import_as ${ta}h xh}]} {
+ set xh ""
+ }
+
+ lappend alist [list $xp $xm $xh]
+ }
+
+ switch [llength $alist] {
+ 0 {
+ _cgi_set_uservar addrs ""
+ }
+ 1 {
+ set a [lindex $alist 0]
+ _cgi_set_uservar fn [lindex $a 0]
+ _cgi_set_uservar addrs [WPPercentQuote "[lindex $a 1]@[lindex $a 2]"]
+ }
+ default {
+ set addrs ""
+ foreach a $alist {
+ if {[string length $addrs]} {
+ append addrs ","
+ }
+
+ append addrs [WPPercentQuote "[lindex $a 0] <[lindex $a 1]@[lindex $a 2]>"]
+ }
+
+ _cgi_set_uservar addrs $addrs
+ }
+ }
+
+ source [WPTFScript takeedit]
+ } else {
+ WPCmd PEInfo statmsg "Take Address cancelled. No addresses selected."
+ source [WPTFScript main]
+ }
+
+ set nopage 1
+ } elseif {[string compare cancel [string tolower $takecancel]] == 0} {
+ source [WPTFScript main]
+ set nopage 1
+ } elseif {[string compare forward [string tolower $op]] == 0} {
+ _cgi_set_uservar style Forward
+ source [WPTFScript compose]
+ set nopage 1
+ } elseif {[string compare reply [string tolower $op]] == 0} {
+ _cgi_set_uservar style Reply
+ _cgi_set_uservar repqstr [WPCmd PEMessage $uid replyquote]
+ source [WPTFScript compose]
+ set nopage 1
+ } elseif {[string compare save [string tolower $op]] == 0} {
+ if {[catch {WPCmd PEMessage $uid save $f_colid $f_name} reason]} {
+ #statmsg "Save failed: $reason"
+ lappend newmail [list "Save failed: $reason"]
+ } else {
+ set savedef [WPTFSaveDefault $uid]
+ if {[lindex $savedef 0] == $f_colid} {
+ WPTFAddSaveCache $f_name
+ }
+
+ if {[WPCmd PEInfo feature save-will-not-delete] == 0} {
+ if {[catch {WPCmd PEMessage $uid flag deleted 1} reason]} {
+ # statmsg "Cannot delete saved message: $reason"
+ lappend newmail [list "Cannot delete saved message: $reason"]
+ }
+ }
+ }
+
+ } elseif {$bod_first} {
+ set u $uid
+ set message [WPCmd PEMailbox first]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on first of the Marked messages"]
+ }
+ } elseif {$bod_prev} {
+ set u $uid
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number] -1]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on first of the Marked messages"]
+ }
+ } elseif {$bod_next} {
+ set u $uid
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number]]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on last of the Marked messages"]
+ }
+ } elseif {$bod_last} {
+ set u $uid
+ set message [WPCmd PEMailbox last]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on last of the Marked messages"]
+ }
+ }
+
+ if {![info exists nopage]} {
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ lappend newmail [list [cgi_span "style=color: black; margin: 2 ; border: 1px solid red; background-color: pink; font-weight: bold" "Deleted messages may reapper because [WPCmd PEMailbox mailboxname] is Read Only"]]
+ }
+ closed {
+ lappend newmail [list [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Message body may be blank because [WPCmd PEMailbox mailboxname] is Closed"]]
+ }
+ ok -
+ default {}
+ }
+
+ if {[catch {WPNewMail $reload ""} newmailmsg]} {
+ error [list _action "new mail" $newmailmsg]
+ } else {
+ foreach i $newmailmsg {
+ lappend newmail $i
+ }
+
+ if {[info exists newmail] == 0} {
+ set newmail ""
+ }
+ }
+
+ if {$uid <= 0} {
+ lappend newmail [list "Message $message has UID 0!"]
+ }
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ if {[string length $fullhdr]} {
+ if {[WPCmd PEInfo mode full-header-mode]} {
+ if {$fullhdr == 0 || [string compare $fullhdr "off"] == 0} {
+ WPCmd PEInfo mode full-header-mode 0
+ }
+ } else {
+ if {$fullhdr == 1 || [string compare $fullhdr "on"] == 0} {
+ WPCmd PEInfo mode full-header-mode 2
+ }
+ }
+ }
+
+ if {[WPCmd PEInfo mode full-header-mode]} {
+ set hmode "fullhdr=off"
+ set text [cgi_imglink nofullhdr]
+ } else {
+ set hmode "fullhdr=on"
+ set text [cgi_imglink fullhdr]
+ }
+
+ set hmode_url [cgi_url $text "wp.tcl?page=body&$hmode" name=hmode target=body style=vertical-align:middle]
+ }
+
+ if {$uid} {
+ # preserve any new uid val
+ WPCmd set uid $uid
+ }
+
+ if {[catch {WPCmd PEMessage $uid charset} charset]
+ || [string length $charset] == 0
+ || [string compare us-ascii [string tolower $charset]] == 0} {
+ set charset "ISO-8859-1"
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=body&uid=$uid"}]
+ if {[info exists _wp(exitonclose)]} {
+ cgi_puts $closescript
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function viewReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=body&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "viewReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ if {[info exists _wp(timing)]} {
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "var loadtime = new Date();"
+ cgi_puts "var submitted = $submitted;"
+ cgi_puts "function fini() {var now = new Date(); window.status = 'Page loaded in '+(now.getTime() - loadtime.getTime())/1000+' seconds';}"
+ }
+
+ append onload "fini();"
+ }
+
+ WPStyleSheets
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {top.spec.body.location = 'wp.tcl?page=view&bod_next=1'}}
+ {{p} {top.spec.body.location = 'wp.tcl?page=view&bod_prev=1'}}
+ {{i} {top.spec.location = 'fr_index.tcl'}}
+ {{s} {top.spec.cmds.document.saveform.f_name.focus()}}
+ {{d} {top.spec.cmds.document.delform.op[0].click()}}
+ {{u} {top.spec.cmds.document.delform.op[1].click()}}
+ {{r} {top.spec.cmds.document.replform.op.click()}}
+ {{f} {top.spec.cmds.document.forwform.op.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[info exists hmode_url]} {
+ lappend kequiv [list {h} "top.spec.body.location = 'wp.tcl?page=view&$hmode'"]
+ }
+
+ append onload [WPTFKeyEquiv $kequiv]
+ }
+ }
+
+ set fgcolor [set normal_fgcolor [WPCmd PEInfo foreground]]
+ set bgcolor [WPCmd PEInfo background]
+
+ cgi_body bgcolor=white $onload $onunload {
+ catch {WPCmd set help_context view}
+
+ set infont 0
+ set inurl 0
+
+ if {[llength $newmail]} {
+ cgi_division align=center "style=\"border: 1px solid black; background: $_wp(bordercolor)\"" {
+ WPTFStatusTable $newmail 1 "style=\"padding: 6px 0\""
+ }
+ }
+
+ cgi_table width="100%" border=0 cellpadding=2 cellspacing=0 {
+
+ # Context
+ cgi_table_row {
+ if {$zoomed} {
+ set marked " [cgi_bold marked]"
+ set c $zoomed
+ } else {
+ set marked ""
+ set c $messagecount
+ }
+
+ cgi_table_data align=left valign=middle class=context {
+ # write message number
+
+ if {[catch {WPCmd PEMailbox messagecount before [WPCmd PEMessage $uid number]} prior]} {
+ set prior 0
+ }
+
+ if {[catch {WPCmd PEMailbox messagecount after [WPCmd PEMessage $uid number]} remaining]} {
+ set remaining 0
+ }
+
+ if {$c == 1} {
+ set msgnotext "Only${marked} Message in [WPCmd PEMailbox mailboxname]"
+ } elseif {$remaining == 0} {
+ set msgnotext "[cgi_bold Last] of [WPcomma $c]${marked} message[WPplural $c]"
+ } elseif {$prior == 0} {
+ set msgnotext "[cgi_bold First] of [WPcomma $c]${marked} message[WPplural $c]"
+ } else {
+ if {[string length $marked]} {
+ append marked " messages"
+ set n [expr {$zoomed - $remaining}]
+ set msgnotext "Message [WPcomma $message] ($n of [WPcomma $c] [cgi_bold marked] messages)"
+ } else {
+ set msgnotext "Message [WPcomma $message] of [WPcomma $c]"
+ }
+ }
+
+ if {[info exists use_icon_for_status]} {
+ set staticon "[WPStatusImg $uid] "
+ set stattext ""
+ } else {
+ set staticon ""
+ switch -regexp [lindex [WPStatusIcon $uid] 0] {
+ del {
+ set stattext " (Deleted)"
+ }
+ new {
+ set stattext " (New)"
+ }
+ default {
+ set stattext ""
+ }
+ }
+ }
+
+ cgi_put "${staticon}${msgnotext}${stattext}"
+ }
+
+ if {$printable} {
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_puts "Folder: [WPCmd PEMailbox mailboxname]"
+ }
+ } else {
+ if {[info exists common_goto_in_view_specific_frame]} {
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body {
+ cgi_text "page=view" type=hidden notab
+ cgi_text gonum= type=text size=4 maxlength=4 class=navtext
+ cgi_submit_button "goto=Jump to Msg" class=navtext
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_put [cgi_url [cgi_img [WPimg printer2] border=0 style=vertical-align:baseline] wp.tcl?page=view&uid=$uid&printable=1 target=_blank "onClick=if(window.print){window.print();return false;}else return true;"]
+ cgi_put [cgi_img [WPimg dot2] height=1 width=4]
+ if {[info exists hmode_url]} {
+ cgi_put $hmode_url
+ } else {
+ cgi_put [cgi_imglink dot]
+ }
+ }
+ }
+ }
+
+
+ cgi_table_row {
+ cgi_table_data valign=top bgcolor=#${bgcolor} class=view width="100%" colspan=2 {
+ cgi_preformatted "style=\"color:#$normal_fgcolor\"" {
+ #cgi_division "style=\"color: #$normal_fgcolor; font-family: courier\""
+
+ set msgtext [WPCmd PEMessage $uid text]
+
+ # pre-scan message text for anything interesting
+ foreach i $msgtext {
+ foreach j $i {
+ switch -exact [lindex $j 0] {
+ img {
+ if {![info exists showimages]} {
+ # ONLY IMG tags in HTML text that reference ATTACHED IMAGE files are allowed
+ if {[catch {WPCmd PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {WPCmd PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+
+ if {[catch {WPCmd PEMessage $uid fromaddr} fromaddr]} {
+ set fromaddr ""
+ } elseif {$showimg == 0} {
+ if {[catch {WPSessionState allow_cid_images} friends] == 0} {
+ while {[set findex [lsearch -exact $friends $fromaddr]] >= 0} {
+ set friends [lreplace $friends $findex $findex]
+ if {[catch {WPSessionState allow_cid_images $friends} friends]} {
+ catch {WPCmd PEInfo statmsg "Cannot forget image sender: $friends"}
+ break;
+ }
+ }
+ }
+
+ set showimg {}
+ }
+
+ if {[string length $showimg]
+ || ([catch {WPSessionState allow_cid_images} friends] == 0
+ && [lsearch -exact $friends $fromaddr] >= 0)} {
+
+ set showimages 1
+
+ if {[string length $fromaddr]} {
+ set bodyleadin "\[ Attached images ARE being displayed \]"
+ if {$showimg == 1} {
+ append bodyleadin "[cgi_nl]\[ Always show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=[WPPercentQuote $fromaddr]"] \]"
+ } else {
+ append bodyleadin "[cgi_nl]\[ Never show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=0"] \]"
+
+ if {[catch {WPSessionState allow_cid_images} friends] || [llength $friends] == 0} {
+ set friends $fromaddr
+ } elseif {[lsearch -exact $friends $fromaddr] < 0} {
+ lappend friends $fromaddr
+ }
+
+ if {[catch {WPSessionState allow_cid_images $friends} friends]} {
+ catch {WPCmd PEInfo statmsg "Cannot remember image sender: $friends"}
+ }
+ }
+ }
+ } else {
+
+ set showimages 0
+
+ set bodyleadin "\[ Attached images are NOT being displayed \]"
+ append bodyleadin "[cgi_nl]\[ Show images [cgi_url "below" "wp.tcl?page=body&showimg=1"]"
+ if {[string length $fromaddr]} {
+ append bodyleadin ", or always show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=[WPPercentQuote $fromaddr]"] \]"
+ } else {
+ append bodyleadin " \]"
+ }
+
+ }
+ }
+ }
+ }
+ default {}
+ }
+ }
+ }
+
+ set inbody 0
+ foreach i $msgtext {
+
+ if {!$inbody
+ && [llength $i] == 1
+ && [lindex [lindex $i 0] 0] == "t"
+ && 0 == [string length [lindex [lindex $i 0] 1]]} {
+ set inbody 1
+ if {[info exists bodyleadin]} {
+ cgi_puts $bodyleadin
+ }
+ }
+
+ foreach j $i {
+ set ttype [lindex $j 0]
+ set tdata [lindex $j 1]
+
+ # write anchors by hand
+ switch -- $ttype {
+ urlstart {
+ set href [lindex $tdata 0]
+ set name [lindex $tdata 1]
+
+ # build links by hand since we don't know where
+ # they'll terminate
+ set linktext ""
+ set inurl 1
+ }
+ urlend {
+ if {$inurl} {
+ cgi_put ""
+ }
+ }
+ attach {
+ set attachuid [lindex $tdata 0]
+ set part [lindex $tdata 1]
+ set mimetype [lindex $tdata 2]
+ set mimesubtype [lindex $tdata 3]
+ if {[string length [lindex $tdata 4]]} {
+ set file [lindex $tdata 4]
+ } else {
+ if {[string length [lindex $tdata 5]]} {
+ set file "attachment.[lindex $tdata 5]"
+ } else {
+ set file "unknown.txt"
+ }
+ }
+
+ set attachurl "detach.tcl?uid=${attachuid}&part=${part}"
+ set saveurl "${attachurl}&download=1"
+ if {0 == [string compare -nocase $mimetype "text"]
+ && 0 == [string compare -nocase $mimesubtype "html"]} {
+ append attachurl "&download=1"
+ }
+
+ set attachexp "View ${mimetype}/${mimesubtype} Attachment"
+
+ if {0 == [string compare message [string tolower ${mimetype}]]
+ && 0 == [string compare rfc822 [string tolower ${mimesubtype}]]} {
+ set attmsgurl "wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]&uid=${attachuid}&part=${part}&style="
+ cgi_put [cgi_url [cgi_font size=-1 Fwd] "${attmsgurl}Forward" target=_top]
+ cgi_put "|[cgi_url [cgi_font size=-1 Reply] "${attmsgurl}Reply&reptext=1&repall=1&repqstr=[WPPercentQuote [WPCmd PEMessage $uid replyquote]]" target=_top]"
+
+ } else {
+ cgi_put [cgi_url [cgi_font size=-1 View] $attachurl target=_blank]
+ cgi_put "|[cgi_url [cgi_font size=-1 Save] $saveurl]"
+ }
+
+ if {[info exists attachurl]} {
+ set attachtext [WPurl $attachurl {} $hacktoken $attachexp target=_blank]
+ }
+ }
+ img {
+ if {[info exists showimages] && $showimages == 1
+ && [catch {WPCmd PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {WPCmd PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+ cgi_put [cgi_img detach.tcl?uid=${uid}&part=${cidpart} "alt=\[[lindex $tdata 1]\]"]
+ } else {
+ cgi_put "\[[lindex $tdata 1]\]"
+ }
+ }
+ fgcolor {
+ if {$infont} {
+ cgi_put ""
+ set infont 0
+ }
+
+ if {[string compare $tdata $fgcolor]} {
+ set fgcolor $tdata
+ if {[string compare $fgcolor $normal_fgcolor]} {
+ cgi_put ""
+ set infont 1
+ }
+ }
+ }
+ bgcolor {
+ if {$infont} {
+ cgi_put ""
+ set infont 0
+ }
+
+ if {[string compare $tdata $bgcolor]} {
+ cgi_put ""
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ color {
+ if {$infont} {
+ cgi_put ""
+ set infont 0
+ }
+
+ if {[string compare [lindex $tdata 0] $fgcolor] || [string compare [lindex $tdata 1] $bgcolor]} {
+ cgi_put ""
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ italic {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ bold {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ underline {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ strikethru {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ bigfont {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ smallfont {
+ switch $tdata {
+ on { cgi_put "" }
+ off { cgi_put "" }
+ }
+ }
+ default {
+ if {[info exists attachtext] && [set ht [string first $hacktoken $attachtext]] >= 0} {
+ set firstbit [string range $attachtext 0 [expr {$ht - 1}]]
+ set lastbit [string range $attachtext [expr {$ht + [string length $hacktoken]}] end]
+ cgi_put " $firstbit[cgi_quote_html [string trimleft $tdata]]$lastbit"
+ unset attachtext
+ } else {
+ cgi_put [cgi_quote_html $tdata]
+ }
+ }
+ }
+ }
+
+ cgi_puts ""
+ }
+ }
+ }
+ }
+
+ if {![info exists attachuid]} {
+ if {!([catch {WPCmd PEMessage $uid attachinfo 1} typing]
+ || [string compare [string tolower [lindex $typing 1]] text]
+ || [string compare [string tolower [lindex $typing 2]] html])} {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_font font-family=fixed "\[Note: you may also [cgi_url view "detach.tcl?uid=${uid}&part=1" target=_blank] HTML message directly in your browser\]"]
+ }
+ }
+ }
+ }
+ }
+
+ if {$infont} {
+ cgi_put ""
+ }
+
+ if {$inurl} {
+ cgi_put ""
+ }
+
+ if {[info exists _wp(cumulative)]} {
+ set l [string length $_wp(cumulative)]
+ if {$l < 6} {
+ set sl "."
+ while {$l < 6} {
+ append sl "0"
+ incr l
+ }
+ append sl $_wp(cumulative)
+ } else {
+ set sl "[string range $_wp(cumulative) 0 [expr $l - 7]].[string range $_wp(cumulative) [expr $l - 6] end]"
+ }
+
+ set servlettime "servlet = $sl"
+
+ if {[info exists wp_global_loadtime]} {
+ set clickdiff [expr {[clock clicks] - $wp_global_loadtime}]
+ # 500165 clicks/second
+ set st [expr ([string range $clickdiff 0 [expr [string length $clickdiff] - 4]] * 1000) / 500]
+ set l [string length $st]
+ set scripttime "tcl = [string range $st 0 [expr $l - 4]].[string range $st [expr $l - 3] end], "
+ } else {
+ set scripttime ""
+ }
+
+ cgi_puts [cgi_font size=-2 "style=font-family:sans-serif;font-weight:bold" "\[time: ${scripttime}${servlettime}\]"]
+ }
+ }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/web/cgi/alpine/1.0/wp.tcl b/web/cgi/alpine/1.0/wp.tcl
new file mode 100755
index 00000000..f649ca0a
--- /dev/null
+++ b/web/cgi/alpine/1.0/wp.tcl
@@ -0,0 +1,135 @@
+#!./tclsh
+# $Id: wp.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# wp.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+#
+# Input:
+set wp_vars {
+ {page {} "main"}
+ {uidList {} ""}
+ {uidpage {} ""}
+}
+
+set wp_global_loadtime [clock clicks]
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+proc sortname {name {current 0}} {
+ global rev me
+
+ switch -- $name {
+ Number { set newname "#" }
+ OrderedSubj { set newname "Ordered Subject" }
+ Arrival { set newname Arv }
+ Status { set newname " " }
+ default { set newname $name }
+ }
+
+ if {$current} {
+ if {$rev > 0} {
+ set text [cgi_imglink increas]
+ set args rev=0
+ } else {
+ set text [cgi_imglink decreas]
+ set args rev=1
+ }
+
+ append newname [cgi_url $text "wp.tcl?page=body&sortrev=1" "title=Reverse $newname ordering" target=body]
+ }
+
+ return $newname
+}
+
+proc linecolor {linenum} {
+ global color
+
+ if {$linenum % 2} {
+ return $color(line1)
+ } else {
+ return $color(line2)
+ }
+}
+
+proc lineclass {linenum} {
+ if {$linenum % 2} {
+ return i0
+ } else {
+ return i1
+ }
+}
+
+proc uid_framed {u mv} {
+ foreach m $mv {
+ if {$u == [lindex $m 1]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+WPEval $wp_vars {
+
+ # Resolve checked uidList
+ foreach uid [split $uidpage ","] {
+ WPCmd PEMessage $uid select [expr [lsearch $uidList $uid] >= 0]
+ }
+
+ # sourced "page" get's CGI parms from environment
+ if {[catch {WPTFScript $page} source]} {
+ switch -regexp -- $page {
+ addredit {
+ set source fr_addredit.tcl
+ }
+ addrsave {
+ set source addrsave.tcl
+ }
+ addrpick {
+ set source addrpick.tcl
+ }
+ ldappick {
+ set source ldappick.tcl
+ }
+ post {
+ set source post.tcl
+ }
+ prune {
+ set source prune.tcl
+ }
+ noop {
+ cgi_html {
+ cgi_head
+ cgi_body {}
+ }
+ unset source
+ }
+ default {
+ WPInfoPage "Web Alpine Error" [font size=+2 "Unknown WebPine page reference: $page."] \
+ "Please complain to the [cgi_link Admin]. Click Back button to return to previous page."
+ }
+ }
+
+ if {[info exists source]} {
+ set source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $source]
+ }
+ }
+
+ if {[info exists source]} {
+ source $source
+ }
+}
diff --git a/web/cgi/alpine/2.0/.htaccess b/web/cgi/alpine/2.0/.htaccess
new file mode 100644
index 00000000..dd9da02d
--- /dev/null
+++ b/web/cgi/alpine/2.0/.htaccess
@@ -0,0 +1,7 @@
+# set up default page
+DirectoryIndex ./browse
+
+# extensionless files are scripts
+
+ SetHandler cgi-script
+
diff --git a/web/cgi/alpine/2.0/alpine.tcl b/web/cgi/alpine/2.0/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/alpine/2.0/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl
\ No newline at end of file
diff --git a/web/cgi/alpine/2.0/browse b/web/cgi/alpine/2.0/browse
new file mode 100755
index 00000000..9669fd8c
--- /dev/null
+++ b/web/cgi/alpine/2.0/browse
@@ -0,0 +1,336 @@
+#!./tclsh
+# $Id: browse 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# browse
+#
+# Purpose: CGI script that generates a page displaying a message
+# list of the indicated folder.
+#
+# Input: PATH_INFO: [/]/[/
+# along with possible search parameters:
+set browse_args {
+ {u {} 0}
+ {pageFirst {} ""}
+ {pagePrev {} ""}
+ {pageNext {} ""}
+ {pageLast {} ""}
+ {sort {} ""}
+ {rev {} ""}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./common.tcl
+source ./foldercache.tcl
+
+# default browse state
+set c 0
+set f INBOX
+
+# TEST:
+proc cgi_suffix {args} {
+ return ""
+}
+
+# for inserting debug comments at end of page
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+ lappend dmsgs $s
+}
+
+WPEval $browse_args {
+ # grok PATH_INFO for collection, 'c', and folder 'f'
+ if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {![regexp {^/([0-9]+)/(.*)$} $env(PATH_INFO) dummy c f]} {
+ WPCmd PEInfo statmsg "Cannot open invalid path: $env(PATH_INFO)"
+ set c 0
+ set f INBOX
+ }
+ } elseif {[catch {WPCmd PEFolder current} curf]
+ || [lindex $curf 0] != 0
+ || [string compare -nocase [lindex $curf 1] inbox]} {
+ WPCmd PEInfo statmsg "No Folder Specified, opening INBOX"
+ }
+
+ # verify or visit specified collection/folder
+
+ if {[catch {setCurrentFolder c f u} result]} {
+ set authlist [wpHandleAuthException $result [list $c "open folder $f"] $f]
+ if {0 == [llength $authlist]} {
+ WPCmd PEInfo statmsg "$result"
+ set c 0
+ set f INBOX
+ } else {
+ set opening_folder 1
+ }
+ }
+
+ if {[info exists opening_folder]} {
+ set n 1
+ set u 0
+ } else {
+ # move anything deleted to Trash
+ if {[catch {WPCmd PEMailbox trashdeleted current} result]} {
+ WPCmd PEInfo statmsg "Trash move Failed: $result"
+ }
+
+ # set uid to "current" message?
+ if {$u <= 0 && 0 == [catch {WPCmd PEMailbox current} cm]} {
+ set u [lindex $cm 1]
+ }
+ }
+
+ # get default sort
+ if {[catch {WPCmd PEMailbox sort} cursort]} {
+ set sort date
+ set rev 1
+ }
+
+ # load index drawing routine for this session
+ # save perpage source, proc overhead
+ # call to reinstall during debugging:
+ #catch {WPCmd rename drawMessageList {}}
+ if {0 == [llength [WPCmd info commands drawMessageList]]} {
+ set cgidir [file join $_wp(cgipath) $_wp(appdir) $_wp(ui2dir)]
+ if {[catch {
+ WPCmd source "$_wp(confdir)/alpine.tcl"
+ WPCmd source "${cgidir}/common.tcl"
+ WPCmd source "${cgidir}/messagelist.tcl"
+ WPCmd source "${cgidir}/messageview.tcl"
+ WPCmd rename WPCmd {}
+ WPCmd rename WPEval {}
+ WPCmd rename WPGetInputAndID {}
+ WPCmd rename WPCmdEval WPCmd
+ } result]} {
+ error [list _action browse "cannot load index lister: $result"]
+ }
+ }
+
+ # current context or folder changed?
+ if {$c == 0 && 0 == [string compare -nocase $f inbox]} {
+ set f INBOX
+ }
+
+ # gain situational awareness, UID and number of message that must be on page
+ if {[catch {WPCmd PEMailbox focus} focused]} {
+ set mc 0
+ set focused 0
+ } elseif {$focused > 0} {
+ set mc $focused
+ } else {
+ set mc [WPCmd PEMailbox messagecount]
+ }
+
+ if {$u == 0} {
+ # non given, set to first message in folder
+ set n 1
+ if {[catch {WPCmd PEMailbox uid 1} u]} {
+ set n 0
+ set u 0
+ }
+ } elseif {[catch {WPCmd PEMessage $u number} n]} {
+ set n 0
+ set u 0
+ }
+
+ # lines per page
+ if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg <= 0} {
+ set ppg $_wp(indexlines)
+ } elseif {$ppg > $_wp(indexlinesmax)} {
+ set ppg $_wp(indexlinesmax)
+ }
+
+ # look for image button clicks
+ foreach item $browse_args {
+ if {0 == [catch {cgi_import [lindex $item 0].x}]} {
+ set [lindex $item 0] 1
+ }
+ }
+
+ # preform actions specfied in browse_args
+ # NOTE: basic stuff only to be executed in absense of JS
+ if {[string length $pageFirst]} {
+ set n 1
+ set u [WPCmd PEMailbox uid 1]
+ } elseif {[string length $pagePrev]} {
+ if {$ppg >= $n} {
+ set n 1
+ } else {
+ set n [expr {$n - $ppg}]
+ }
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ } elseif {[string length $pageNext]} {
+ if {($n + $ppg) <= $mc} {
+ incr n $ppg
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ }
+ } elseif {[string length $pageLast]} {
+ set n $mc
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ } elseif {[string length $sort]} {
+ switch $rev {
+ 0 -
+ 1 {
+ }
+ default {
+ set rev [lindex $cursort 1]
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox sort $sort $rev} cursort]} {
+ WPCmd PEInfo statmsg "Cannot set sort: $cursort"
+ set cursort [list nonsense 0]
+ } else {
+ # store result
+ WPCmd set sort [list $sort $rev]
+ }
+ }
+
+ # page framing
+ if {[catch {
+ set nm [WPCmd PEMailbox flagcount [list unseen undeleted]]
+ set defcol [WPCmd PEFolder defaultcollection]
+ wpInitPageFraming u n mc ppg pn pt
+ }]} {
+ set pn 1
+ set pt 0
+ set nm 0
+ set defcol 0
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=UTF-8"
+ }
+
+ cgi_html {
+ cgi_head {
+ # WPStdHttpHdrs "text/html; charset=UTF-8"
+ cgi_title [wpPageTitle "$f, $pn of $pt ($nm)"]
+ cgi_base "href=$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/cbn/folderdialog.css
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # YahooUI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ # local libraries
+ cgi_script type=text/javascript language="JavaScript" src="lib/common.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="lib/mailbox.js" {}
+ # page specfic JS
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.app_root = '$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)';"
+ cgi_puts "YAHOO.alpine.current.c = $c;"
+ cgi_puts "YAHOO.alpine.current.f = \"$f\";"
+ cgi_puts "YAHOO.alpine.current.u = $u;"
+ cgi_puts "YAHOO.alpine.current.page = $pn;"
+ cgi_puts "YAHOO.alpine.current.count = $mc;"
+ if {[catch {
+ set mb_sel [WPCmd PEMailbox selected]
+ set mb_srch [WPCmd PEMailbox searched]
+ }]} {
+ set mb_sel 0
+ set mb_srch 0
+ }
+
+ cgi_puts "YAHOO.alpine.current.selected = $mb_sel;"
+ cgi_puts "YAHOO.alpine.current.searched = $mb_srch;"
+ cgi_puts "YAHOO.alpine.current.focused = $focused;"
+ cgi_puts "function bodyOnLoad(){"
+ cgi_puts " initMenus();"
+ cgi_puts " initMorcButton('listMorcButton');"
+ cgi_puts " initSelection();"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ wpSetMessageListNewMailCheck
+ wpStatusAndNewmailJavascript
+ wpSaveMenuJavascript "browse" $c $f $defcol morcInBrowseDone
+ cgi_puts " if(self.loadDDElements) loadDDElements();"
+
+ if {[info exists authlist]} {
+ cgi_puts "YAHOO.alpine.resubmitRequest = function(){ window.location.href = 'browse/$c/$f'; };"
+ cgi_puts "YAHOO.alpine.cancelRequest = function(){ window.location.href = 'browse/0/INBOX'; };"
+ reportAuthException $authlist
+ }
+ cgi_puts "}"
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class="wap" "onLoad=bodyOnLoad()" {
+ cgi_division id="skip" {
+ cgi_put [cgi_url "Skip to Next Page" "\#" "onClick=return newMessageList({control:this,parms:{op:'next'}});"]
+ cgi_put [cgi_url "Skip to Folders" "folders"]
+ cgi_put [cgi_url "Skip to Compose" "compose"]
+ }
+
+ cgi_division id=msgDragProxy {
+ cgi_put ""
+ }
+
+ if {$focused} {
+ set context "Search Results in [cgi_quote_html $f]"
+ } else {
+ set context [cgi_quote_html $f]
+ }
+ wpCommonPageLayout browse $c $f $u $context [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}"] "$f" 1 mailboxSearch()] "" {
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi2" ""][cgi_span "class=hdrBtnText" Settings]" "settings"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" \# "onClick=return openMailboxHelp();" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ cgi_division id=listTopMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawTopListMenuBar $c {$f}"]
+ }
+ cgi_division id=viewTopMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawTopViewMenuBar $c {$f} $u $n"]
+ }
+ } {
+ if {[info exists opening_folder]} {
+ cgi_puts "Opening $f..."
+ } else {
+ cgi_puts [WPCmd cgi_buffer "drawMessageList $c {$f} $n $ppg"]
+ }
+ } {
+ cgi_division id=listBottomMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawBottomListMenuBar $c {$f} $pn $pt $mc"]
+ }
+ cgi_division id=viewBottomMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawBottomViewMenuBar $c {$f} $u $n $mc"]
+ }
+ }
+
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/common.tcl b/web/cgi/alpine/2.0/common.tcl
new file mode 100644
index 00000000..41e58a7a
--- /dev/null
+++ b/web/cgi/alpine/2.0/common.tcl
@@ -0,0 +1,905 @@
+# $Id: common 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# common.tcl
+#
+# Purpose: TCL script snippets that the various CGI script generating pages
+# have in common
+#
+
+proc wpSelectedClass {seld unread defclass} {
+ set class $defclass
+ if {[expr $seld]} {
+ append class " sel"
+ }
+
+ if {$unread} {
+ append class " bld"
+ }
+
+ return $class
+}
+
+proc wpPageTitle {page} {
+ return "$page - Web Alpine 2.0"
+}
+
+proc current_context {page c f cc cf} {
+ set ct {[lsearch {browse view} $page] >= 0 && }
+ if {0 == $cc && 0 == [string compare -nocase inbox $cf]} {
+ append ct {0 == $c && 0 == [string compare -nocase inbox $f]}
+ } else {
+ append ct {$cc == $c && 0 == [string compare $cf $f]}
+ }
+
+ set current [expr $ct]
+}
+
+proc folder_link {current page c f u unread {ficon ""}} {
+ set url "browse/$c/[WPPercentQuote $f {/}]"
+ set clickurl $url
+ set urlid ""
+ set fclass ""
+ set fid ""
+ if {$current} {
+ set urlid "id=\"gFolder\""
+ set urid "id=\"unreadCurrent\""
+ set fid "id=\"fCurrent\""
+ set onclick "onClick=return newMessageList({parms:{op:'unfocus',page:'new'}});"
+ } elseif {[string length $ficon]} {
+ set fq [cgi_quote_html $f]
+ set urid "id=\"unread${fq}\""
+ set fid "id=\"f${fq}\""
+ set onclick [onClick $clickurl]
+ } else {
+ set urid ""
+ set onclick ""
+ }
+
+ if {$unread} {
+ set fclass "class=bld"
+ set urc " ($unread)"
+ } elseif {[string length $ficon] || $current} {
+ set urc ""
+ }
+
+ if {[info exists urc]} {
+ set urt [cgi_span "class=wap unrd" $urid $urc]
+ } else {
+ set urt ""
+ }
+
+ if {![string length $ficon]} {
+ set ficon [cgi_span "class=sp splc splc7" ""]
+ }
+
+ if {[string length $f] > 20} {
+ set f "...[string range $f end-18 end]"
+ }
+
+ return "[cgi_url "$ficon[cgi_span $fid $fclass [cgi_quote_html $f]]" $url class=wap $urlid $onclick]$urt"
+}
+
+proc empty_link {current falias c} {
+ if {$current} {
+ set emptyfunc emptyCurrent
+ } else {
+ switch $falias {
+ Trash { set emptyfunc emptyTrash}
+ Junk { set emptyfunc emptyJunk }
+ }
+ }
+ if {[info exists emptyfunc]} {
+ return "\[[cgi_url "Empty" "#" "onClick=panelConfirm('Are you sure you want to permanently delete the contents of the $falias folder?
The Compose screen is where you write and send messages. The Compose screen is divided into two sections:
+
+
The header section is at the top. You use the header section to address the mail and control the text format.
+
The message section is below the header. The message section is where you enter and format the message text.
+
+
Writing messages
+
+
+
On the menu bar, click Compose (or Reply or Forward).
+
In the header section, enter the addressing information. By default, the headers displayed are the To, Cc, and Subject fields. For information on displaying more header fields, see Headers.
+
To enter rich-text click on Rich Text to the right of the Subject header. Click Plain Text to toggle this back to plain text.
+
In the message section, enter your message text. If you are entering Rich Text, a formatting toolbar at the top of the message section allows you to apply rich-text formatting to message text. You can also insert links and graphics using the formatting toolbar.
+
If desired, you can mark your message with a priority level. On the menu bar, point to Priority, and then select the level that you want for this message.
+
+
Including attachments
+
+
On the menu bar, click Attach File.
+
Enter the path and file name for the file that you want to attach, or click Browse to browse for the file and select it.
+
+
Sending, canceling, and saving drafts
+
+
To send mail
+
+
On the menu bar, click Send.
+
+
+
To cancel an editing session
+
+
On the menu bar, click Cancel, or click any item in the left pane, such as your Inbox.
+
Click Discard to confirm. The Compose screen closes and your Inbox appears.
+
+
To save a draft of a message
+
+
On the menu bar, click Save Draft. A copy of the message is saved to the Drafts folder. The Compose screen closes and you are returned to the screen that was displayed before the editing session began.
+
+
+
Note:
+
If you open a previously saved draft, make more changes, and then cancel the editing session and discard changes, the entire draft is deleted, not just the most recent changes.
+
+
+
+
Resuming drafts
+
To resume editing a draft message that you previously saved go to the Drafts folder by clicking on Drafts in the left pane. Find the message you want to resume in the list and click on its Subject to resume composing.
+
Headers
+
The header section is where you enter addressing information. By default, the header displays the To, Cc, and Subject fields.
+
To display all headers
+
+
To the right of the To field, click More Headers.
+
+
To display only the default headers
+
+
To the right of the To field, click Fewer Headers.
+
+
Header fields
+
The following header fields are available:
+
+
To. Use this field to specify email recipients:
+
+
Type the full email address of the recipient. Separate multiple addresses with commas.
+
Type a name or nickname specified in your contact list and click. Alpine expands the name or nickname to the full address. Separate multiple addresses with commas.
+
Click To to display to your contact list and select an address or to select an address from the directory server.
+
+
+
Attachments. Lists any files that have been attached to the message.
+
Subject. Enter a brief phrase describing the topic of the message.
+
Cc (Carbon copy). Similar to the To field. Enter one or more addresses to receive a copy of the message. These addresses are seen by all message recipients.
+
Bcc (Blind carbon copy). Similar to the To and Cc fields. Enter one or more addresses to receive a copy of the message. The Bcc header does not show up in the sent mail so these addresses are hidden from other recipients.
+
Fcc (File carbon copy). Specifies a folder to which a copy of your outgoing message is saved. You can control whether messages are saved with or without attachments. For more information, see Settings.
+
+
+
Automatic saves
+
Alpine saves a draft every 5 minutes, overwriting the draft each time, so that only the most recent saved version is preserved.
+
+
+
diff --git a/web/cgi/alpine/2.0/help/contacts.html b/web/cgi/alpine/2.0/help/contacts.html
new file mode 100644
index 00000000..690dd76c
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/contacts.html
@@ -0,0 +1,80 @@
+
+
+
+
+
+Contacts: your address book
+
+
+
Contacts allow you to store names, email addresses, and other information in a contact list, which serves as an address book. You can quickly send mail to a contact by retreiving information from your contact list.
+
+
Adding a contact
+
+
To add a contact
+
+
In the left pane, click Contacts. Your contact list appears in the right pane.
+
On the menu bar, click New Contact.
+
Fill in the contact information:
+
+
Nickname. A short name that you can use for quick addressing. If you type the nickname instead of the full display name or email address, Alpine will offer a list of matching choices from your contacts list and the University of Washington directory. You can select the contact from the list.
+
Display Name. The name that appears in the message header.
+
Email. The contact's email address.
+
Notes. Any text you want. Used only by you.
+
Fcc Folder. A folder that will receive copies of all messages that you send directly to this contact.
+
+
Click Add.
+
+
To add a contact from a message
+
+
Drag the contact's email address from the From field to the Contacts folder.
+
or
+
To the right of the From field, click Add.
+
+
To add multiple contacts from a message
+
+
On the menu bar, click More Actions, and then select Extract. Alpine extracts everything in the message that is in the format of an email address and presents a list of contacts. You can confirm each contact.
+
+
Removing a contact
+
+
In the left pane, click Contacts. Your contact list appears in the right pane.
+
Select the contacts you wish to remove by checking the boxes to the left of the Display Names.
+
On the menu bar, click Delete.
+
Confirm that you want to Delete the contacts Forever.
+
+
+
Editing a contact
+
+
To edit a contact
+
+
In the left pane, click Contacts. Your contact list appears in the right pane.
+
Click on the Display Name to edit the corresponding entry.
+
+
+
Creating a group contact
+
A group contact is simply a contact with more than one email address.
+
To add a group contact
+
+
In the left pane, click Contacts. Your contact list appears in the right pane.
+
On the menu bar, click New Group.
+
Fill in the contact information like you would for a regular contact, except
+
Group Email. Enter all of the addresses or nicknames separated by commas.
+
Click Add.
+
+
+
+
diff --git a/web/cgi/alpine/2.0/help/folders.html b/web/cgi/alpine/2.0/help/folders.html
new file mode 100644
index 00000000..dc05df0b
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/folders.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+Folders: organizing your mail
+
+
+
You can organize your mail into folders. Folders are displayed in the left pane. Some folders are provided by default:
+
+
Inbox. Stores and displays your mail messages when they arrive, unless you have routed messages to another folder. You can drag and drop messages from the Inbox to other folders.
+
Drafts. Stores any messages that have been saved during an editing session.
+
Sent. By default, stores copies of all of your sent mail.
+
Junk. Stores messages that have been caught by spam filtering and messages that you add by clicking Report Spam on the menu bar. On a weekly basis, Alpine deletes everything in the Junk folder that is dated before the previous week.
+
Trash. Stores deleted messages, where thay can be recovered until they are permanently removed. For more information, see Trash.
+
Recent Folders. This is a listing of the folders that you have opened recently. You can set the number of recent folders displayed in the left pane. For more information, see Settings.
+
+
+
+
Note:
+
When viewed in the folder list displayed by clicking View/Manage Folders, the default folders named Junk and Sent in the left pane appear under the names sent-mail and junk-mail.
+
+
+
+
+
Viewing your list of folders
+
+
In the left pane, click View/Manage Folders. A list of your folders appears in the right pane.
+
+
Viewing the messages in a folder
+
To view the messages contained in a folder
+
+
In the left pane, click View/Manage Folders. A list of your folders appears in the right pane.
+
Select the folder that you want to view by clicking its name. On the menu bar, click View Messages.
+
Alternatively, double click the folder name.
+
+
Adding folders
+
+
In the left pane, click View/Manage Folders. A list of your folders appears in the right pane.
+
On the menu bar, click New Folder.
+
Enter a name for the new folder and click New Folder. If you want this new folder to be a subfolder within an existing folder, enter the name of the parent folder, followed by a slash ( / ), followed by the new folder name. For example, subdir/foldername.
+
The new folder appears in the list.
+
+
Deleting folders
+
+
Note:
+
Unlike deleted messages, deleted folders are not moved to the Trash, and they cannot be retrieved.
+
+
To delete a folder
+
+
In the left pane, click View/Manage Folders. A list of your folders appears in the right pane.
+
Click the folder that you want to delete. On the menu bar, click Delete.
+
Click Delete Forever to confirm.
+
+
Renaming folders
+
+
+
In the left pane, click View/Manage Folders. A list of your folders appears in the right pane.
+
Click the folder that you want to rename. On the menu bar, click Rename.
+
Enter the new name.
+
Click Rename Folder to confirm.
+
+
+
Routing mail to folders
+
+
You can set up Alpine to route incoming and outgoing messages to designated folders.
+
To route a copy of an outgoing message to a folder
+
+
Enter the folder name in the Fcc field in the composer.
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.
+
+
+
Note
+
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.
+
+
+
Message List (e.g. INBOX)
+
Ut wisi enim ad minim veniam.
+
Folders
+
Con sectetuer adipiscing elit, sed diam nonnumy nibh.
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.
+
+
+
Note:
+
You must save your changes before going to another section.
+
+
+
Note:
+
The "Reset to Default Settings" button, found at the bottom of some pages, will reset your setting to the default settings.
+
+
+
Display
+
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam.
+
Folders
+
Con sectetuer adipiscing elit, sed diam nonnumy nibh.
+
Compose Encoding
+
Ut wisi enim ad minim veniam.
+
Reply Options
+
Ut wisi enim ad minim veniam.
+
Forwarding Options
+
Ut wisi enim ad minim veniam.
+
Flag Personal Email
+
Ut wisi enim ad minim veniam.
+
New Mail Notification
+
Ut wisi enim ad minim veniam.
+
Auto-Contacts
+
Ut wisi enim ad minim veniam.
+
Save Sent
+
Ut wisi enim ad minim veniam.
+
Archive Sent
+
Ut wisi enim ad minim veniam.
+
Emptying Trash
+
Ut wisi enim ad minim veniam.
+
Fcc Options
+
Set whether to save with or without attachments when auto-saving messages to the Fcc (Folder carbon copy) folder.
When you first log in to your mail account, you see your Inbox. Your Inbox stores and displays your mail messages.
+
The main body of the display consists of one line per message. By default, your Inbox displays 25 messages on each page. Use the arrows at the right end of the menu bar or at the bottom of the browser window to move from page to page in the list.
+
To change the number of messages displayed per page, see Settings.
+
There is a checkbox at the start of each message line. To select a set of messages on which to perform an action (for example, Deleting) click in the checkbox. The checkbox at the top of the column selects/unselects all of the messages on the page.
+
Viewing messages
+
To read a message
+
+
Click the Subject of the message.
+
+
To read messages in other folders
+
+
Click the desired folder in the left pane.
+
+
Sorting messages
+
By default the message index is sorted by Date, with the most recent messages coming first and the oldest messages at the bottom of the index. You can change this default sort order in Settings
+
+
Sort by columns on the list. Click a column heading, such as From, Subject, or Date to sort by that field. Click on the small triangle next to the sort heading to reverse the sort order.
+
+
Group by Thread. Groups all messages in the same conversation together, in a a tree view. This option is available in the Arrange menu bar above the column headings.
+
+
Group by Subject. Groups all messages with the same subject together. This option is also only available in the Arrange menu.
+
+
Sort by Arrival. Sometimes it is convenient to sort in the order that the messages were added to the folder instead of by the Date, which is usually similar but a little different. Select this option from the Arrange menu.
+
+
+
Deleting messages
+
+
Select the messages you wish to delete by checking the boxes to the left of the messages.
+
On the menu bar, click Delete.
+
+
+
When you click Delete, the selected messages are moved to the Trash, where you can delete them later.
+
+
Saving messages to a folder
+
You can move or copy messages from the Inbox to a folder. Moving a message removes it from the Inbox while creating a copy in the designated folder. Copying a message leaves the message in the Inbox while creating a copy in the designated folder.
+
+
Select the box to the left of the message or messages that you wish to put in a folder.
+
On the menu bar, locate the Move or Copy button. Skip this step if the one you want is already displayed. If necessary, click the button and pull down the menu to select Move or Copy.
+
On the menu bar, click to Folder and select the target folder from the list, or select More Folders to see a list of all folders. If you select More Folders, click the target folder in the list, and then click Copy or Move.
+
+
+
Icons
+
Several informative icons may appear to the left of the From column.
+
+
+
+
Icon
+
Meaning
+
+
+
+
New message
+
+
+
+
The message includes an attachment
+
+
+
+
You have replied to the message
+
+
+
+
You have forwarded the message
+
+
+
+
The message is addressed directly to you
+
+
+
+
The message is cc'd to you
+
+
+
In addition, messages that have not been read are displayed in bold text.
+
Marking messages with stars
+
You can mark messages with stars that appear in the far right column of the list. The stars can indicate anything that you like. For example, you might mark the most important messages with a star.
+
+
To mark a message with a star
+
+
Click in the rightmost column of the list on the row for that message or select Set Star from the More Actions menu in the menu bar.
+
+
Reporting messages as spam
+
If you get a message that you think should have been identified by the spam detection processes but wasn't, you may submit it for review, which may help improve the effectiveness of spam detection.
+
To report spam
+
+
Select the message or messages that you wish to report as spam by checking the boxes in the left column.
+
On the menu bar, click Report Spam. A copy of the message is sent to the University of Washington spam detection process and the message is moved to your Junk folder.
+
+
Emptying trash
+
When messages are deleted they are actually moved to the Trash folder and not immediately deleted. To permanently remove the messages you must empty the trash.
+
To empty the entire contents of the trash
+
+
Find the Trash folder in the left pane. If there are messages in the Trash folder you may click on the word Empty next to the Trash folder to empty it. This is also true of the Junk folder, which may be emptied in the same way.
+
+
To permanently delete selected messages from the trash
+
+
In the left pane, click Trash.
+
Select the box to the left of the messages that you want to delete.
+
On the menu bar, click Delete Forever. Be sure that you have selected the right messages; there is no confirmation screen for this action.
+
+
To recover messages from the trash
+
+
In the left pane, click Trash.
+
Select the box to the left of the messages that you want to recover.
+
On the menu bar, locate the Move or Copy button. Skip this step if the one you want is already dislayed. If necessary, click the button and pull down the menu to select Move or Copy.
+
On the menu bar, click to Folder and select the target folder from the list, or select More Folders to see a list of all folders. If you select More Folders, click the target folder in the list, and then click Copy or Move.
+
+
Drag and Drop Shortcuts
+
You may grab a message by its From field and drag it over a folder in the left pane in order to move it to the folder. Alternatively, if you drag it to the Contacts list in the left pane and drop it there the From address will be added to your list of Contacts.
+
+
+
+
+
diff --git a/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml b/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml
new file mode 100644
index 00000000..e659193f
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/web/cgi/alpine/2.0/help/popup/help_set_display.htm b/web/cgi/alpine/2.0/help/popup/help_set_display.htm
new file mode 100644
index 00000000..574ba8db
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/popup/help_set_display.htm
@@ -0,0 +1,36 @@
+
+
+
+
+
+Help: WebMail
+
+
+
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.
+
+
+
Note
+
Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.
+
+
+
Themes
+
Ut wisi enim ad minim veniam.
+
Number of messages per page
+
Con sectetuer adipiscing elit, sed diam nonnumy nibh.
The following figure shows a portion of the Alpine screen with the main parts identified.
+
+
Screen header
+
+
+
The top portion provides links to University of Washington news and local weather. The top portion also displays error messages and comfirmation messages, such as confirming that you have moved or copied a message to a folder.
+
The right side provides a bar graph representing the portion of your account's disk space allocation that is currently used.
+
Below the bar graph are links for Settings (for customizing your mail), Help (for displaying this Help system), and Sign out.
+
+
Menu bar
+
The menu bar provides commands needed for each Alpine screen. The two leftmost commands, Check Mail and Compose, are the same in all Alpine screens. The other commands change according to which Alpine screen is dislayed.
+
Left pane
+
The left pane displays:
+
+
Search. For a basic search, type a word in the search box and click the search icon. For more search options, click Advanced Search.
+
Inbox and other default folders. Your inbox contains your mail as it arrives, you can use other folders to organize your mail.
+
Contacts. Click to view and manage your contacts.
+
Recent Folders. A list of the folders that you have recently accessed. You can control how many recent folders are listed (see Settings).
+
View/Manage Folders. Click to view a list of all of your folders. From this list, you can add, delete, and rename folders.
+
+
Right pane
+
+
+
+
Depending on what you are doing, the right pane displays one of five things:
+
+
Message lists. Display the contents of the folders in the left pane: Inbox, Drafts, Sent, and so forth. The message lists share a common format that allows you to view and manage your messages.
+
The Compose window. Allows you to write and reply to messages.
+
Your folder list. A list of all Alpine folders, both the standard Alpine folders such as Inbox, and any folders that you create. You can manage your folders from this list.
+
Your contacts list. A list of all of the contacts that you have created. The contacts list functions as your address book.
+
The Settings window. Allows you to customize the appearance and behavior of Alpine for your account.
+
+
+
Parts of the Compose window
+
In the Compose window, you can write, send, and reply to messages. The following figure shows the main parts of the Compose window.
+
+
+
Header section (at the top). You use the header section to address the mail and control the text format.
+
+
Message section (below the header). The message section is where you enter and format message text.
+
+
+
Basic Alpine Features
+
Viewing messages
+
When you first log in, your Inbox is displayed in the right pane, showing a list of your mail messages.
+
+
By default, the list contains 25 messages per page. Click the arrows on the right side of the menu bar to move from page to page.
+
You can sort messages in the list by clicking the column headings.
+
You can drag and drop messages from the right pane to the folders in the left pane or to your contacts: click and hold on the name or email address in the From column to drag a message.
To read a message, click on its Subject. For more information, see Reading mail.
+
+
Sending mail
+
+To send a message, click Compose (or Reply or Forward) on the menu bar. For more information, see Compose: sending mail.
+
+
Search
+
+
To search for a message, type a search string in the Search box, at the top of the left pane. Click Advanced Search for more search options. For more information, see Search.
+
+
Folders
+
+
Folders help you keep your mail organized. Default folders, such as Inbox and Junk, are always there. You can also create your own folders by clicking View/Manage Folders. For more information, see Folders.
+
+
+
Contacts
+
+
You can create a contact list,which is a list of addresses that are important or that you frequently use. Click Contacts to add items to your contact list. For more information, click Contacts.
+
+
+
Checking for new mail
+
+
You can check for new mail from any Alpine window or folder without returning to your Inbox.
+
+
To check for new mail
+
+
On the menu bar, click Check Mail. Alpine checks for new mail. If you have any new mail, a message appears in the middle of the screen header.
+
+
+
Settings
+
You can control the appearance and behavior of many parts of the Alpine screen. For more information, see Settings.
+
+
+
+
Trash
+
When you delete a message, it is moved to the trash. When you empty the trash or delete selected messages from the trash, they are removed permanently. You can also recover messages from the trash.
+
To empty the entire contents of the trash
+
+
In the left pane, next to Trash, click [Empty].
+
Click Empty Trash to confirm.
+
+
This permanently deletes all of the messages in the trash.
+
To permanently delete selected messages from the trash
+
+
In the left pane, click Trash.
+
Select the box to the left of the messages that you want to delete.
+
On the menu bar, click Delete Forever. Be sure that you have selected the right messages; there is no confirmation screen for this action.
+
+
To recover messages from the trash
+
+
In the left pane, click Trash.
+
Select the box to the left of the messages that you want to recover.
+
On the menu bar, locate the Move or Copy button. Skip this step if the one you want is already dislayed. If necessary, click the button and pull down the menu to select Move or Copy.
+
On the menu bar, click to Folder and select the target folder from the list, or select More Folders to see a list of all folders. If you select More Folders, click the target folder in the list, and then click Copy or Move.
+
+
+
+
diff --git a/web/cgi/alpine/2.0/help/read.html b/web/cgi/alpine/2.0/help/read.html
new file mode 100644
index 00000000..155f4caf
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/read.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+Reading mail
+
+
+
Attachments are listed in the header area at the top of the message. Attachments are marked with the paper clip icon.
+
To open an attachment
+
+
Click the file name.
+
+
To download an attachment
+
+
Open the attachment.
+
In the application that opens the attachment, save a copy of the attachment to your computer.
+
+
+
+
Displaying full headers
+
When you are viewing a message, the header section at the top of the message displays a standard set of headers including the message Subject, From, To, Cc, Date, and Attachments (if there are any). It is possible to show the full set of headers in the message, which includes a complete list of all routing from the message source to your Inbox, along with all other headers. These full headers may be useful in troubleshooting.
+
To display full headers
+
+
In the top right corner of the message, click Show Full Headers.
+
+
To cancel full headers
+
+
In the top right corner of the message, click Show Filtered Headers.
+
+
Replying
+
+
On the menu bar, click Reply or Reply All.
+
+
Reply. Sends a reply to the address or addresses in the To field.
+ or
+
Reply All. Sends a reply to the addresses in the To and Cc fields.
You can control whether to forward messages as inline text or as attachments. For more information, see Settings.
+
+
Adding contacts
+
When you are reading a message, you can add the sender to your list of contacts.
+
+
To add a contact
+
+
+
Drag the contact's email address from the From field to the Contacts folder.
+
or
+
To the right of the From field, click Add.
+
+
To add multiple contacts from a message
+
+
On the menu bar, click More Actions, and then select Extract. Alpine extracts everything in the message that is in the format of an email address and presents a list of contacts. You can confirm each contact.
+
+
To finish adding a contact
+
+
Enter the contact information:
+
+
Nickname. A short name that you can use for quick addressing. If you type the nickname instead of the full display name or email address, Alpine will offer a list of matching choices from your contacts list and the University of Washington directory. You can select the contact from the list.
+
Display Name. The name that appears in the message header.
+
Email. The contact's email address.
+
Notes. Any text you want. Used only by you.
+
Fcc folder. A folder that will receive copies of all messages that you send directly to this contact.
+
+
+
Click Add to commit the contact to your address book.
+
+
Saving messages to a folder
+
You can move or copy messages to folders. Moving a message removes it from the Inbox while creating a copy in the designated folder. Copying a message leaves the message in the Inbox while creating a copy in the designated folder.
+
+
On the menu bar, locate the Move or Copy button. Skip this step if the one you want is already displayed. If necessary, click the button and pull down the menu to select Move or Copy.
+
On the menu bar, click to Folder and select the target folder from the list, or select More Folders to see a list of all folders. If you select More Folders, click the target folder in the list, and then click Copy or Move.
+
+
Printing
+
To print a message
+
+
In the area above the menu bar on the right click Print.
+
+
Deleting a message
+
+
On the menu bar, click Delete.
+
+
+
When you click Delete, the message you are viewing is moved to the Trash folder and you will be viewing the next message in your Inbox.
+
Reporting a message as spam
+
If you are reading a message that you think should have been identified by the spam detection processes but wasn't, you may submit it for review, which may help improve the effectiveness of spam detection.
+
To report spam
+
+
On the menu bar, click Report Spam. A copy of the message is sent to the University of Washington spam detection process and the message is moved to your Junk folder.
The Search area is in the upper portion of the left pane, just below the menu bar. At a minimum, there will be a text box for you to enter text to be searched for. If the right pane contains an index of messages there will also be an Advanced Search button. If you've already completed an index search and the right pane contains the Search Results then there are some additional button available. These are described below.
+
+
Basic Index Search
+
+
You may perform a basic search of all the messages in the index by typing some text into the search text box and clicking the search icon next to the box. This will be a search of the entire text of the messages, not just the Subject.
+
+
To search for messages
+
+
Find the Search text box in the upper part of the left pane and click in it.
+
Type the search text into the box.
+
+
+
The result of the search will be a message index containing only the subset of messages that match the search criterion. A message about the number of matches will be displayed in the Screen Header area and the heading will change from INBOX to Search Results in INBOX to show you that you are viewing a subset of the messages. Near the bottom of the page the total number of messages in the Search Result will be shown instead of the total number of messages in the INBOX.
+
+
There will be a couple new items in the Search area of the screen. The highlighted folder in the search area will be called Search Results. You may go back and forth between the INBOX and the Search Results by clicking on the INBOX or on the Search Results. There will be a new button next to Advanced Search labeled Clear. Clicking that will clear the results of the search.
+
+
You can start a brand new search by typing in more text and searching again. As long as the menu in the search area says New Search you will be searching the entire INBOX again, just like with the initial search. However, you also have the option of refining the search you have done so far by setting the menu to either Search within Results or Add to Search Results. A Search within Results search will reduce the size of the Search Results, showing you the subset of the current Search Results that also match your new search. An Add to Search Results search will increase the size of the Search Results, adding all of the new matches to the existing Search Results.
+
+
If you are refining your Search Results and there are no matches, the Search Results will remain the same instead of showing nothing, so that you won't lose the previous results. A message in the Screen Header will say No messages matched your search.
+
+
Advanced Index Search
+
Clicking on Advanced Search allows you to more tightly control the method of searching for matching messages. For example, you could search for all messages where the Subject contains (or doesn't contain) a certain word. If you fill in more than one of the criteria they all have to match. For example, if you fill in some text that the Subject must contain and also type in some text in that the From must contain; the Search Results will only contain messages that both have a matching From and have a matching Subject.
+
+
At the top of the Advanced Search panel is a menu similar to the one in the Basic search area where you say what sort of refinement on the current search you want to perform. This can be either a brand new search, a narrowing down of the current Search Results (search within), or a widening of the current Search Results (add results).
+
+
Example
+
Searching is often done iteratively, a step at a time, until you locate the message you are looking for.
+
You might start out looking for a message that you can recall contains the word firefox.
+
+
+
Type firefox in the search text box click to search.
+
+
+
You got way more matches than you expected so you try to think of some way to refine the search. You remember that the message also contains the word awesome.
+
+
+
Set the search menu to Search within Results.
+
Type awesome in the search text box and click to search.
+
+
+
Maybe you see your message now or maybe you need to refine further. Suppose you know the message came within the past week.
+
+
+
Click Advanced Search.
+
Be sure the choice at the top of the Search panel is set to Perform this search within current search results.
+
Set the Date menu to Past week.
+
Click Search.
+
+
+
Other Searches (Contacts and Folder List)
+
You can also perform basic searches while viewing your Folder List and while viewing your Contacts. In both cases, the search is a simple text search to match what you type, and only the text that is displayed on the screen is searched. The results are simply highlighted on the screen. You have to look for them yourself in order to use them.
The settings pages allow you to customize the behavior and appearance of Alpine.
+
To display the Settings pages
+
In the upper right-corner of the screen, above the menu bar, click Settings.
+
+
+
+
Message Display
+
+
Display ___ messages per page. Controls the number of messages displayed on each page.
+
Wrap Plain Text message at ___ characters. Controls the overall width of the text block in plain text messages.
+
+
Folders
+
+
Display ___ recent folders in left column. Controls how many folders are displayed under Recent Folders in the left pane. Recent Folders are the folders that you have recently accessed, listed with the most recent at the top.
+
+
Reply Options
+
+
Include headers in replies. Includes the header section of the original message in the reply.
+
Include attachments in replies. The recipient of the reply gets the attachments as well as the original message.
+
Append signature below reply text. Adds your signature to the bottom of the reply instead of the top.
+
Strip signatures when replying. Removes the signature that was in the message being replied to (if it can be identified).
+
+
Forwarding Options
+
+
Forward messages inline. The recipient gets an ordinary text message.
+
Forward messages as attachments. The recipient gets a message with the forwarded message attached.
+
+
Sent Message Options
+
+
Name of your Sent mail folder. Save messages you send to this folder (default is sent-mail). To disable the saving of sent mail set this to double double quotes ("").
+
Save sent messages to Sent folder without attachments. Remove any attachments being sent before saving the message in your Sent mail folder.
+
+
Personal Preferences
+
+
Display Name. This is your full name (e.g., Fred Flintstone). It will be included as part of your From address in outgoing mail.
+
Email Signature. This signature is automatically included in messages you compose. You will have the opportunity to edit it before sending.
+
Alternate Addresses. You may enter a list of alternate addresses so that Alpine can tell when an address is you. This will affect the index display (messages will be marked with an icon showing it is to you when it is addressed to one of your addresses), the From address displayed in the index display (when the From address is one of your addresses the To address will be shown instead), and the Reply All command (addresses listed here will not be included).
+
+
To add Alternate Addresses
+
On the Personal Preferences page find the Alternate Addresses option. Type alternate addresses into the text field. The Add button can be used to add additional addresses and the X buttons can be used to remove addresses. The addresses you enter should be the actual email address part of an address without the fullname or brackets. For example, user@example.com. The matching is not sensitive to upper or lower case differences, all will match. For the advanced user, a regular expression may be entered.
+
+
+
News and Weather
+
+
Headline News. RSS URL for news.
+
Weather Bar. RSS URL for weather.
+
+
Message List
+
+
Default Sort Order. Sets the default sort order for the Message List. By default the sort order is set to Date/Reverse. The /Reverse part means that the newest messages will be at the top. It is also possible to temporarily change the sort order in the message list screen itself.
+
Start display at. This just tells Alpine where to start in the index of messages. The message you specify here will be included in the first page of messages you see.
+
Automatically Move Read Messages. Automatically move read messages to a Read Messages folder.
+
+
+
Message View
+
+
Display Headers. Specify which headers are to be displayed in the Message View. If you specify any headers here you must list all of the headers you wish to have displayed, not just the additional headers.
+
Display complete URLs as links. URLs contained in a message are shown as active links when viewing the message.
+
Display hostnames and incomplete URLs as links. Hostnames that begin with www and incomplete URLs contained in a message are shown as active links when viewing the message.
+
Display email addresses as links. Email addresses contained in a message are displayed as active links that can be used for sending mail.
+
Rich Text Display. Turning on this option will cause rich text messages to be shown as plain text.
+
Anti-phishing. Usually the real hostname is displayed after links to make it easier to see if the link looks suspicious or not. Turning on this option will hide that information and is not recommended.
+
+
Folder Names
+
+
Draft Folder. Actual name of the folder that is usually referred to in Alpine as the Drafts folder. The default is postponed-msgs.
+
Trash Folder. Actual name of the folder that is usually referred to in Alpine as the Trash folder. The default is Trash.
+
+
Compose
+
+
Compose Headers. You can control which headers you want visible when composing outgoing email using this option. You can specify any of the regular set, any of the Headers you see with More Headers, or any Customized Headers that you have already defined. If you use this setting at all, you must specify all the headers you want to see, you can't just add to the regular header set. The default set is To:, Cc:, and Subject:.
+
Custom Headers. You may add your own custom headers to outgoing messages. Each header you specify here must include the header tag (Reply-To:, Approved:, etc.) and may optionally include a value for that header. If you want to see these custom headers each time you compose a message, you must add them to your Compose Headers list, otherwise they become part of the rich header set that you only see when you press the More Headers command. (If you are looking for a way to change which headers are displayed when you view a message, take a look at the Display Headers option in the Message View section instead.)
+
Message Encoding. Send messages using the character encoding you set here.
+
Reply intro string. This option is used to customize the content of the introduction line that is included when replying to a message and including the original message in the reply. It is not yet described here.
+
Reply prefix. When a message is replied to and the text of the message is included, the included text usually has the text ">Â " prepended to each line, to indicate it is quoted text. It is recommended that you leave this option set to that value since that is a standard that other email reading programs will recognize and treat specially.
+
Flowed Text Handling. Normally, when sending a message, Alpine generates flowed text where possible. The method for generating flowed text is defined in RFC 3676, the benefit of doing so is to send message text that can properly be viewed both on normal width displays and on displays with smaller or larger than normal screen widths. This feature turns off the generation of flowed text, as it might be desired to more tightly control how a message is displayed on the receiving end.
+
+
Mail Servers
+
+
Inbox Server. Technical name of the folder that is your INBOX folder. This will usually have to be set for you. An example is {example.com}inbox. The server name comes inside the brackets and the folder name comes after the brackets.
+
SMTP Server. A list (usually a list of size one) consisting of the names of your SMTP servers. An SMTP server is used for sending mail. This is a domainname such assmtp.example.com and it may contain some options after the hostname. The options are introduced with a slash (/) and the name of the option. To use the submit port append /submit after the hostname. To use authentication append /user=username where username is the name you use to authenticate to the server. A more complicated example might look something like smtp.example.com/submit/user=myusername.
+
+
Directory Servers
+
+
LDAP Server. This option is currently too complicated to be set from within Web Alpine. The value it is looking for has the format of a raw ldap-servers config string found in an Alpine pinerc configuration file.