community/pipermail-archives/sup-devel/2013-07.txt (17386B) - raw
1 From hsanson@gmail.com Wed Jul 3 09:44:49 2013
2 From: hsanson@gmail.com (Horacio Sanson)
3 Date: Wed, 3 Jul 2013 18:44:49 +0900
4 Subject: [sup-devel] Gmail source sync back.
5 Message-ID: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
6
7 I finally got the sync back feature of the Gmail source working. The sync
8 code uses the offlineimap sync algorithm the Matthieu mentioned some emails
9 ago.
10
11 So far it works ok with my small tests but this code should be considered
12 alpha so do not test it with your work emails.
13
14 https://github.com/hsanson/sup/tree/gmail_source
15
16 I also added some fixes and the config option provided by Matthieu.
17
18 Testing and feedback is greatly appreciated.
19
20 Issues to solve:
21
22 - Sync back flags: Not sure if this is needed or how it may work. All
23 messages I get from Gmail have the \Seen flag no matter if I have seen or
24 not the message on Gmail web interface. The \Flagged flag can be changed
25 using the \Starred label instead. The only flag that I really need to care
26 about is the \Deleted flag.
27
28 - How to refresh the index after polling finishes? When new labels are
29 synced from Gmail to Sup the index is not updated with the new labels until
30 I reload sup or press "@" to refresh the index. Is there a callback to
31 refresh the index when the polling finishes?
32
33 - Sync back iterates over all messages in the Gmail account checking for
34 differences between message labels. This can take a long time and may not
35 finish before the next polling starts. How to do this efficiently?
36
37 regards,
38 Horacio Sanson
39 -------------- next part --------------
40 An HTML attachment was scrubbed...
41 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20130703/e235f993/attachment.html>
42
43 From matthieu.rakotojaona@gmail.com Thu Jul 4 20:38:30 2013
44 From: matthieu.rakotojaona@gmail.com (Matthieu Rakotojaona)
45 Date: Thu, 04 Jul 2013 22:38:30 +0200
46 Subject: [sup-devel] Gmail source sync back.
47 In-Reply-To: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
48 References: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
49 Message-ID: <1372966209-sup-7024@kpad>
50
51 Hello,
52
53 Excerpts from Horacio Sanson's message of 2013-07-03 11:44:49 +0200:
54 > I finally got the sync back feature of the Gmail source working.
55
56 Awesome, thank you! I've been using your gmail source branch with
57 success for a while now. There are still a few quirks with the Inbox
58 tag, but overall I'm really pleased with it. Will try your branch.
59
60 > Issues to solve:
61 >
62 > [...]
63 >
64 > - Sync back iterates over all messages in the Gmail account checking for
65 > differences between message labels. This can take a long time and may not
66 > finish before the next polling starts. How to do this efficiently?
67
68 Ah, that sounds bad. Reading the always-helpful Stack Overflow [0] says
69 that there is nothing for this, unfortunately. There is a IMAP RFC
70 extension, 4551, that is supposed to help such situations, but it is not
71 implemented by Gmail, although there is a beta-test for this, if you're
72 interested :
73
74 http://mailman2.u.washington.edu/pipermail/imap-protocol/2013-January/001962.html
75
76 Another way could be to use the search extension specific to gmail [1].
77 I don't think you would gain much more than bandwidth, though.
78
79
80 [0] http://stackoverflow.com/questions/10076690/ruby-imap-changes-since-last-check
81 [1] https://developers.google.com/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw
82
83 >
84 > regards,
85 > Horacio Sanson
86
87 --
88 Matthieu Rakotojaona
89 -------------- next part --------------
90 A non-text attachment was scrubbed...
91 Name: signature.asc
92 Type: application/pgp-signature
93 Size: 836 bytes
94 Desc: not available
95 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20130704/f5993774/attachment.bin>
96
97 From ruthard.baudach@web.de Fri Jul 5 10:32:48 2013
98 From: ruthard.baudach@web.de (Ruthard Baudach)
99 Date: Fri, 05 Jul 2013 12:32:48 +0200
100 Subject: [sup-devel] reading html mails
101 Message-ID: <1373019929-sup-8525@prxbdc.dyndns.org>
102
103 In the last years I'm receiving more and more emails containing only
104 html-formatted text and no plain text.
105
106 sup displays these emails as empty mails with an html attachment.
107
108 It would be great if sup was able to distinguish between actual html
109 attachments and such deficient mails, and would extract and display
110 the text part of these mails.
111
112 I'm not able to hack this myself at the moment, but perhaps someone
113 picks up the idea?
114
115 It's written a lot of times, but let me repeat it:
116
117 Good that sup is alive again!
118
119
120 Greetings to all
121
122 Ruthard
123
124
125 From m.klinik@gmx.de Fri Jul 5 13:15:48 2013
126 From: m.klinik@gmx.de (Markus Klinik)
127 Date: Fri, 05 Jul 2013 15:15:48 +0200
128 Subject: [sup-devel] reading html mails
129 In-Reply-To: <1373019929-sup-8525@prxbdc.dyndns.org>
130 References: <1373019929-sup-8525@prxbdc.dyndns.org>
131 Message-ID: <1373030020-sup-8455@x41>
132
133 Excerpts from Ruthard Baudach's message of 2013-07-05 12:32:48 +0200:
134 > In the last years I'm receiving more and more emails containing only
135 > html-formatted text and no plain text.
136 >
137 > sup displays these emails as empty mails with an html attachment.
138 >
139 > It would be great if sup was able to distinguish between actual html
140 > attachments and such deficient mails, and would extract and display
141 > the text part of these mails.
142
143 Hi,
144
145 I have a mime-decode hook for exactly this problem. It unfolds html
146 attachments if there is no plaintext part in an email.
147
148 $ cat mime-decode.rb
149 unless sibling_types.member? "text/plain"
150 case content_type
151 when "text/html"
152 `/usr/bin/elinks -dump '#{filename}'`
153 end
154 end
155
156 Best regards,
157 Markus
158
159 From v@asch.cz Fri Jul 5 12:02:43 2013
160 From: v@asch.cz (Vojtech Aschenbrenner)
161 Date: Fri, 05 Jul 2013 14:02:43 +0200
162 Subject: [sup-devel] reading html mails
163 In-Reply-To: <1373019929-sup-8525@prxbdc.dyndns.org>
164 References: <1373019929-sup-8525@prxbdc.dyndns.org>
165 Message-ID: <1373025677-sup-3594@x220>
166
167 Excerpts from Ruthard Baudach's message of 2013-07-05 12:32:48 +0200:
168 > sup displays these emails as empty mails with an html attachment.
169 >
170 > It would be great if sup was able to distinguish between actual html
171 > attachments and such deficient mails, and would extract and display
172 > the text part of these mails.
173
174 This can be solved with mime-decode hook [1].
175
176 [1] https://github.com/sup-heliotrope/sup/wiki/Viewing-Attachments
177 -------------- next part --------------
178 A non-text attachment was scrubbed...
179 Name: signature.asc
180 Type: application/pgp-signature
181 Size: 836 bytes
182 Desc: not available
183 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20130705/da72b1b1/attachment.bin>
184
185 From 5longluna@gmail.com Mon Jul 8 18:42:34 2013
186 From: 5longluna@gmail.com (Whyme Lyu)
187 Date: Tue, 09 Jul 2013 02:42:34 +0800
188 Subject: [sup-devel] reading html mails
189 In-Reply-To: <1373019929-sup-8525@prxbdc.dyndns.org>
190 References: <1373019929-sup-8525@prxbdc.dyndns.org>
191 Message-ID: <1373307811-sup-1164@whymeDesk>
192
193 Excerpts from Ruthard Baudach's message of 2013-07-05 18:32:48 +0800:
194 > In the last years I'm receiving more and more emails containing only
195 > html-formatted text and no plain text.
196
197 I'm feeling the same pain here mainly due to unpolished in-house services
198 sending out html-only mails. More annoyingly, sup doesn't index these mails
199 since HTML is treated as attachments.
200
201 I've created an issue[1] on Github to talk about it further.
202
203 [1]: https://github.com/sup-heliotrope/sup/issues/101
204
205 --
206 -whyme http://randombu.gs/
207
208 From ruthard.baudach@web.de Tue Jul 9 12:13:49 2013
209 From: ruthard.baudach@web.de (Ruthard Baudach)
210 Date: Tue, 09 Jul 2013 14:13:49 +0200
211 Subject: [sup-devel] reading html mails
212 In-Reply-To: <1373307811-sup-1164@whymeDesk>
213 References: <1373019929-sup-8525@prxbdc.dyndns.org>
214 <1373307811-sup-1164@whymeDesk>
215 Message-ID: <1373371906-sup-3425@prxbdc.dyndns.org>
216
217 >== Ausz?ge aus der Nachricht von Whyme Lyu vom 2013-07-08 20:42:
218 > Excerpts from Ruthard Baudach's message of 2013-07-05 18:32:48 +0800:
219 > > In the last years I'm receiving more and more emails containing only
220 > > html-formatted text and no plain text.
221 >
222 > I'm feeling the same pain here mainly due to unpolished in-house services
223 > sending out html-only mails. More annoyingly, sup doesn't index these mails
224 > since HTML is treated as attachments.
225 What do you mean by "sup doesn't index" these mails -- I have no
226 problems with them except the annoying need of opening them manually,
227 that is solved with the mime-decode hook?
228
229 Greetings,
230
231 Ruthard
232
233 From marka@pobox.com Wed Jul 10 00:38:58 2013
234 From: marka@pobox.com (Mark Alexander)
235 Date: Wed, 10 Jul 2013 00:38:58 -0000
236 Subject: [sup-devel] reading html mails
237 In-Reply-To: <1373371906-sup-3425@prxbdc.dyndns.org>
238 References: <1373019929-sup-8525@prxbdc.dyndns.org>
239 <1373307811-sup-1164@whymeDesk>
240 <1373371906-sup-3425@prxbdc.dyndns.org>
241 Message-ID: <1373403508-sup-4420@x200s>
242
243 Excerpts from Ruthard Baudach's message of 2013-07-09 08:13:49 -0400:
244 > >== Ausz?ge aus der Nachricht von Whyme Lyu vom 2013-07-08 20:42:
245 > > I'm feeling the same pain here mainly due to unpolished in-house services
246 > > sending out html-only mails. More annoyingly, sup doesn't index these mails
247 > > since HTML is treated as attachments.
248 > What do you mean by "sup doesn't index" these mails -- I have no
249 > problems with them except the annoying need of opening them manually,
250 > that is solved with the mime-decode hook?
251
252 I can verify the problem on my installation of sup. It doesn't index
253 the HTML-only emails, i.e., it doesn't read the contents of the HTML
254 attachment to put those contents in the xapian index. The result is
255 that you can't search for words that appear in an HTML-only email and
256 expect that email to appear in the search results.
257
258 From eg@gaute.vetsj.com Sat Jul 20 21:51:54 2013
259 From: eg@gaute.vetsj.com (Gaute Hope)
260 Date: Sat, 20 Jul 2013 23:51:54 +0200
261 Subject: [sup-devel] We should get ready for sup 0.14
262 Message-ID: <51EB067A.600@gaute.vetsj.com>
263
264 Hi all,
265
266 think it is time to collect the latest stuff in 'develop' and release
267 sup 0.14. This release would support ruby 1.9.3 and up. There is an
268 issue tracking this release [1], please add any comments there.
269
270 Regards, Gaute
271
272 [1] https://github.com/sup-heliotrope/sup/issues/105
273
274 From eg@gaute.vetsj.com Mon Jul 29 07:54:01 2013
275 From: eg@gaute.vetsj.com (Gaute Hope)
276 Date: Mon, 29 Jul 2013 09:54:01 +0200
277 Subject: [sup-devel] GMail,
278 was: Re: [sup] Please review the documentation in class Source for
279 implementing new Sources (#113)
280 In-Reply-To: <sup-heliotrope/sup/issues/113/21703944@github.com>
281 References: <sup-heliotrope/sup/issues/113@github.com>
282 <sup-heliotrope/sup/issues/113/21703944@github.com>
283 Message-ID: <51F61F99.8030202@gaute.vetsj.com>
284
285 Hi Petr,
286
287 Take a look at Horacio's work, he has gotten pretty far doing just that!
288 But some of the label stuff can be very slow for large volumes atm.
289
290 His gmail.rb is well-written and relatively easy to understand:
291 https://github.com/hsanson/sup/tree/gmail_source
292
293 His last message to sup-devel:
294 http://rubyforge.org/pipermail/sup-devel/2013-July/001415.html
295
296 Also, feel free to sign up to the devel mailing list:
297 http://rubyforge.org/mailman/listinfo/sup-devel
298
299 or the users list, sup-talk: http://rubyforge.org/mailman/listinfo/sup-talk
300
301 Regards, Gaute
302
303 On 29. juli 2013 09:44, Petr Pudl?k wrote:
304 > Thanks for help. To clarify, my aim is to use sup with GMail on
305 > multiple computers with locally cached messages. For this to work
306 > correctly I need to synchronize labels back to GMail. Since this
307 > seems problematic with maildir, my idea is to:
308 >
309 > - Store emails in a SQLite database. This way I'll get ACID
310 > properties for free, as well as the possibility to add additional
311 > information to messages, such as labels. Another bonus are simple
312 > backups - everything is in one file. - Write a simple GMail-IMAP
313 > synchronization tool that only downloads messages from _All mail_ to
314 > the database and synchronizes labels back using [GMail
315 > extensions](https://developers.google.com/gmail/imap_extensions#special-use_extension_of_the_list_command).
316 >
317 >
318 (There could be some time limit like "download only messages newer
319 > than 1 year or so.) - Modify sup so that it can use this SQLite
320 > store and store (or copy) labels into it.
321 >
322 > This also solves the awkward intermediate step when using
323 > OfflineIMAP that labels are first converted into IMAP folders,
324 > downloaded locally to multiple folders and then again converted to
325 > labels for sup (and sup needs to check multiple folders). Using
326 > instead one big folder that understand labels seems much cleaner.
327 >
328 > (Perhaps it would be worth to store GMail thread ID too?)
329 >
330 > --- Reply to this email directly or view it on GitHub:
331 > https://github.com/sup-heliotrope/sup/issues/113#issuecomment-21703944
332 >
333
334 From eg@gaute.vetsj.com Mon Jul 29 19:37:30 2013
335 From: eg@gaute.vetsj.com (Gaute Hope)
336 Date: Mon, 29 Jul 2013 21:37:30 +0200
337 Subject: [sup-devel] Gmail source sync back.
338 In-Reply-To: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
339 References: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
340 Message-ID: <51F6C47A.3010004@gaute.vetsj.com>
341
342 On 03. juli 2013 11:44, Horacio Sanson wrote:
343 > - How to refresh the index after polling finishes? When new labels are
344 > synced from Gmail to Sup the index is not updated with the new labels until
345 > I reload sup or press "@" to refresh the index. Is there a callback to
346 > refresh the index when the polling finishes?
347
348 Check out pull request #2 towards your github repo, yielding the message
349 on update + some other modifications now updates the message on my setup.
350
351 > - Sync back iterates over all messages in the Gmail account checking for
352 > differences between message labels. This can take a long time and may not
353 > finish before the next polling starts. How to do this efficiently?
354
355 If this turns out not be solvable (e.g. being able to get a list of
356 changed messages since a given date), an option could be to allow the
357 user to configure remote-to-local syncing to only be manual.
358 Local-to-remote you can store locally whether it has been synced or not.
359
360 There's also a pull request #1 which allows arbitrary domains to be
361 entered for the gmail source (for google apps setups).
362
363 Regards, Gaute
364
365 From eg@gaute.vetsj.com Mon Jul 29 19:48:14 2013
366 From: eg@gaute.vetsj.com (Gaute Hope)
367 Date: Mon, 29 Jul 2013 21:48:14 +0200
368 Subject: [sup-devel] Gmail source sync back.
369 In-Reply-To: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
370 References: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
371 Message-ID: <51F6C6FE.1090604@gaute.vetsj.com>
372
373 On 03. juli 2013 11:44, Horacio Sanson wrote:
374 > - Sync back iterates over all messages in the Gmail account checking for
375 > differences between message labels. This can take a long time and may not
376 > finish before the next polling starts. How to do this efficiently?
377
378 By the way, with the source poll locking recently added no second poll
379 should be able to be initiated when there is one running already.
380
381 - gaute
382
383 From eg@gaute.vetsj.com Mon Jul 29 20:01:15 2013
384 From: eg@gaute.vetsj.com (Gaute Hope)
385 Date: Mon, 29 Jul 2013 22:01:15 +0200
386 Subject: [sup-devel] Gmail source sync back.
387 In-Reply-To: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
388 References: <CAHWBo_bRwKArh7nLQ8EMWdWvBV_kRGT=NqDU=Z69pTY+fNpMUQ@mail.gmail.com>
389 Message-ID: <51F6CA0B.7090406@gaute.vetsj.com>
390
391
392
393 On 03. juli 2013 11:44, Horacio Sanson wrote:
394 > I finally got the sync back feature of the Gmail source working. The sync
395 > code uses the offlineimap sync algorithm the Matthieu mentioned some emails
396 > ago.
397
398
399 > Testing and feedback is greatly appreciated.
400
401 Further testing; if I check a message to be important after it has
402 already been added I get an IMAP Invalid label error: Important.
403
404 Regards, gaute
405
406 From hsanson@gmail.com Tue Jul 30 12:41:11 2013
407 From: hsanson@gmail.com (Horacio Sanson)
408 Date: Tue, 30 Jul 2013 21:41:11 +0900
409 Subject: [sup-devel] Xapian 1.2.15 dependency causes issues on Ubuntu 13.04
410 Message-ID: <CAHWBo_ZX8HjuEGWL-Xx_KK+QkyZ-=xqnOhHzQECkPHXFMG7Z+g@mail.gmail.com>
411
412 Ubuntu 13.04 installs the distribution xapian dev and lib packages that are
413 version 1.2.12. This causes sup to complain that the xapian 1.2.15 or later
414 is required and bails out.
415
416 I understand xapian-ruby installs its own xapian lib but sup still tries to
417 load the system one.
418
419 I changed the index.rb file to allow version 1.2.12 and had not encounter
420 any issues so far. Could it be possible to set this version as the min
421 required version?
422
423 regards,
424 Horacio
425 -------------- next part --------------
426 An HTML attachment was scrubbed...
427 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20130730/84356302/attachment.html>
428
429 From hsanson@gmail.com Tue Jul 30 13:18:27 2013
430 From: hsanson@gmail.com (Horacio Sanson)
431 Date: Tue, 30 Jul 2013 22:18:27 +0900
432 Subject: [sup-devel] How do I force flush the log file in sup?
433 Message-ID: <CAHWBo_bM_WmaUUHbER+1V8=o_McxibJCCipnxKnepsviV8Rrhw@mail.gmail.com>
434
435 Is there a way to force sup to flush the log file after each write? It is
436 difficult to debug my gmail source as I cannot see real time what is going
437 on. Maybe set sup to always flush when SUP_LOG_LEVEL is set to debug?
438
439 regards,
440 Horacio
441 -------------- next part --------------
442 An HTML attachment was scrubbed...
443 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20130730/dfb9c00c/attachment.html>
444