<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>>On Tue, 12 Jul 2011 12:49:02 +1000, Piers Lauder wrote:<br></div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; ">>> That looks identical to the default imaplib2 open_socket except for the setsockopt.<br>><br>>Ohh, that is good news, will need to look into what we can drop from<br>>offlineimap then.<br>><br>>> Would it be enough if I just added the KEEP_ALIVE before the wrap_socket?<br>><br>>Yeah, I think we found that gmail would drop sockets if we didn't send<br>>keepalive pings and that's why this has been added. I think just adding<br>>it before wrap_socket should be fine.</div><div style="font-family: times new roman, new york, times, serif; font-size:
 12pt;" class="yui_3_2_0_4_131046658503959">><br>>Sebastian<br><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">Removing socket details from offlineimap and letting imaplib2 deal with them, tells me that development is definitely moving in the right direction.</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">Because I feel imaplib2 should totally encapsulate the details of talking IMAP protocol over sockets to the server.</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"
 class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">offlineimap should simply encapsulate the script procedure to automate and "drive" imaplib2 and the local status database engine.<br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">To make this possible, imaplib2 should offer a clean interface that allows offlineimap to run its message-copying algorithm, without exposing too much detailed information about the IMAP protocol or sockets.  And we should still succeed under virtually all network and imap server conditions.<br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"
 class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">In fact, we should be able to write out, in plain english, the complete algorithm for offlineimap, totally independent of the imap library and the local status database library.  </div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">Doing so would probably shine light on previously unknown bugs, and on more opportunities to factor out IMAP protocol and socket code from offlineimap into imaplib2.</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div><div style="font-family: times new roman, new york, times,
 serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959">Chris</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_4_131046658503959"><br></div></div></div></body></html>