File: imap-cyrus.tcl

package info (click to toggle)
tkrat 1%3A2.2cvs20100105-true-dfsg-6.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,340 kB
  • ctags: 9,259
  • sloc: ansic: 96,057; tcl: 25,667; makefile: 1,638; sh: 282
file content (41 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# IMAP-definieition and functions for dealing with an
# Cyrus imap-server running on localhost.

set imap_n user.$env(USER).test

set cyrus_dir /var/spool/imap

set mailServer(localhost) [list localhost 143 {debug} $env(USER)]

set imap_def [list Test imap {} localhost ${imap_n}]
set imap_def1 [list Test imap {} localhost ${imap_n}1]
set imap_def2 [list Test imap {} localhost ${imap_n}2]
set imap_fn1 ${imap_n}1
set imap_fn2 ${imap_n}2
set dis_def [list Test dis {} localhost $imap_n]
set imap_map $dir/disconnected/localhost:143/$imap_n+maf+imap/mappings
set start_uid 1

proc init_imap_folder {def} {
    global LEAD

    RatDeleteFolder $def
    if [catch {RatCreateFolder $def} result] {
	puts "$LEAD Failed to create folder $result [list $def]"
	exit 1
    }
}

proc cleanup_imap_folder {def} {
    RatDeleteFolder $def
}

proc insert_imap {def args} {
    global dir hdr env

    foreach m $args {
	set f [open "|/usr/pd/cyrus/bin/deliver -m [lindex $def 4]" w]
	puts $f [join [lrange [split $m "\n"] 1 end] "\n"]
	close $f
    }
}