-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
146 lines (113 loc) · 4.03 KB
/
README
File metadata and controls
146 lines (113 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
imaptrope is cool.
This is a version of ximapd based on https://github.com/shugo/ximapd and adapted to work
with heliotrope, the fabulous mail store by William Morgan :
https://github.com/wmorgan/heliotrope
It is an IMAP server, supposed to offer an interface to the
JSON-over-HTTP interface of Heliotrope.
INSTALL, SETUP AND THE BORING THINGS
Copy examples/imaptrope.conf to ~/.config/
USAGE
$ ruby -Ilib -I ../heliotrope/lib bin/imaptrope -s -a ~/Documents/tmpdir -d
If you want to test it without destructing everything, you should try
the tag "safe" and not further, because those implement destructive
(STORE, RENAME, DELETE, ...) IMAP functions.
WHAT WORKS FOR NOW
NOTE : When I say it works, I don't mean it's totally safe. Use at your
own risks.
[X] connection
[X] simple authentication
[ ] secure authentication (SSL)
[o] LIST Command
; FLAGS for each mailbox are not yet spec'd
[X] STATUS Command
[X] EXAMINE Command
[X] SELECT Command
[ ] SEARCH Command
[X] BODY
[X] BCC
[X] ANSWERED
[X] RECENT
[X] DRAFT
[X] DELETED
[X] UNREAD
[ ] FETCH
[X] UID
[X] FLAGS
[X] INTERNALDATE
[o] ENVELOPE
; not sure about the format
[X] BODY[HEADER]
[X] BODY[HEADER.FIELDS(whatever whatever)]
[X] RFC822.HEADER
[o] BODYSTRUCTURE
; not sure about the format
[X] RFC822
[X] BODY[]
[X] BODY[TEXT]
[X] RFC822.TEXT
[X] STORE
; CAREFUL : This modifies your labels, so use with care. It works, but
; who knows. Moreover, you MUST ALWAYS consider that <label> in
; heliotrope translates as ~<label> in the IMAP interface
[o] RENAME
; special treatment not taken into account if a mailbox has submailboxes
[o] DELETE
; special treatment not taken into account if a mailbox has the
; \Noselect flag or if it has submailboxes
[o] CREATE
; a mailbox cannot be created, because they are just labels in
; heliotrope. It will just add your mailbox name in a fakemailboxes
; array, so that it thinks it really exists.
USING WITH OFFLINEIMAP
Caution : this will eat your mails ! Don't test it with important mails
for the moment !
Basically, when a client appends a mail or copies a mail between
mailboxes, it doesn't know what are its uids given by the server; the
client has to do itself some work to recaluclate them at each
connection. Thus, OfflineIMAP adds a 'X-OfflineIMAP' header to our mails
(yes, it modifies them) to recognize them. If we don't want this to
happen, we have to return the uid of the mails that OfflineIMAP (or any
IMAP client) when it acts on our mails; that is what UIDPLUS
provides.
All this stuff to say, UIDPLUS is there to work with
OfflineIMAP (although it will work with any IMAP client).
If you want to try it, here is the .offlinimaprc I use :
[general]
accounts = Heliotrope
[Account Heliotrope]
localrepository = imaptrope # the new name of ximapd :)
remoterepository = gmailremote
[Repository gmailremote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = user
remotepass = pass
ssl = yes
realdelete = no
nametrans = lambda folder: re.sub('\[Gmail\]/Spam', '~spam',
re.sub('\[Gmail\]/Drafts', '~draft',
re.sub('\[Gmail\]/Sent Mail', '~sent',
re.sub('\[Gmail\]/Starred', '\\Starred',
re.sub('\[Gmail\]/Trash', '~trash',
re.sub('\[Gmail\]/All Mail', 'All Mail',
re.sub('(^[^(?:INBOX|\[|\])]*$)', lambda pat: '~' + pat.group(1).lower(), folder )))))))
[Repository imaptrope]
type = IMAP
remotehost = localhost
remoteport = 10142
# those two are specified in ~/.ximapd
remoteuser = myusername
remotepass = mypassword
ssl = no
nametrans = lambda folder: re.sub('(^\w*$)', r'~\1', folder.lower())
Some explanations :
* nametrans : labels in ximapd (or imaptrope) MUST begin with a ~
* folderfilter : GMail special labels have an equivalent; special labels
are translated to ~label
You can then use
$ offlineimap -1
to sync your IMAP servers. Note that you MUST use the '-1' option, which
means "no multithreading" : imaptrope is not thread-safe, and will not
be. This also means that you can have only one client at a time
connected to imaptrope
REMEMBER : it is not functional yet ! Don't use it on your precious !