Commit Graph

451 Commits

Author SHA1 Message Date
Jonny Lamb
2e22b41231 Bug#502779: Sync accounts in order of general.accounts option
On Tue, Apr 21, 11:19:00 -0500, John Goerzen wrote:
> I think the one loss of functionality we have here is that it doesn't
> check if a given account has already been listed before adding to the
> list.  Should be a simple tweak.  If you could tweak that and test, I'd
> apply a new patch.

Good catch. I attach an updated patch which I've tested and it appears
to work fine, including not syncing two accounts twice.

Thanks,

--
Jonny Lamb, UK
jonny@debian.org

From 7f348ee116bba64f7330e28d4e7b2c015910a890 Mon Sep 17 00:00:00 2001
From: Jonny Lamb <jonny@debian.org>
Date: Tue, 05 May 2009 20:45:17 +0100
Subject: [PATCH] Respect order of general.accounts config setting.

This makes the order of account synchronisation the same as the order of
the general.accounts setting by using a list instead of a dict, which
was actually pointless as the value of each dict item was never even
looked at.

Signed-off-by: Jonny Lamb <jonny@debian.org>
2009-05-05 15:16:25 -05:00
John Goerzen
817c09a460 Apply patch to fix autorefresh with Kerberos
Patch from Eric Dorland

Closes: #470875

From: Wouter Verhelst
Subject: kerberos authentication works only the first time
Date: Fri, 14 Mar 2008 09:28:37 +0100

Package: offlineimap
Version: 5.99.8
Severity: normal

Hi,

I have the "autorefresh" configuration option specified in my
.offlineimaprc, and am now using the kerberos authentication.

However, this kerberos authentication seems to work only the first
time
offlineimap tries to fetch mails. The next time, it fails with this
output:

Thread 'Account sync Test' terminated with exception:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/offlineimap/threadutil.py",
  line 153, in run
    Thread.run(self)
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/var/lib/python-support/python2.4/offlineimap/accounts.py",
  line 119, in syncrunner
    self.sync()
  File "/var/lib/python-support/python2.4/offlineimap/accounts.py",
  line 148, in sync
    remoterepos.syncfoldersto(localrepos, [statusrepos])
  File
  "/var/lib/python-support/python2.4/offlineimap/repository/Base.py",
  line 135, in syncfoldersto
    srcfolders = src.getfolders()
  File
  "/var/lib/python-support/python2.4/offlineimap/repository/IMAP.py",
  line 192, in getfolders
    listresult = imapobj.list(directory =
    self.imapserver.reference)[1]
  File "/usr/lib/python2.4/imaplib.py", line 469, in list
    typ, dat = self._simple_command(name, directory, pattern)
  File "/usr/lib/python2.4/imaplib.py", line 1028, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.4/imaplib.py", line 787, in _command
    raise self.error(
error: command LIST illegal in state NONAUTH
2009-04-21 00:03:28 -05:00
James Bunton
17ec4df02a Added check for IDLE in capabilities 2009-02-10 16:19:55 +11:00
James Bunton
8cd2bdf7f5 Allow keepalive to be overridden by user if imapfolders is set 2009-02-10 15:57:03 +11:00
James Bunton
3847d0ba9d Implementation of IMAP IDLE
- Use a newer version of imaplib
 - Hijack the keepalive process to send IDLE instead of NOOP
2009-02-10 11:27:48 +11:00
John Goerzen
8db951ed61 Fix missing import for pre/postsynchook
Apply synchook-import.patch from Graham D
fixes #125
2009-01-14 00:05:00 -06:00
Paul Hinze
c5886074ee Fix md5 import error
Paul Hinze <paul.t.hinze@gmail.com> on 2008-12-22 at 19:16:
> I did a bit of debugging and asking around in #python and it turns out
> that because Maildir.py uses a conditional import of md5 from either
> hashlib or the md5 module, the md5.new() call is not always correct.
> The attached patch should fix this problem.

Thanks to Daniel Rall for pointing out that the attachment got stripped
off my last message.  Patch follows.

Paul

----

From e01fdfbf62c61c31b514e826e6cc00fb98d88808 Mon Sep 17 00:00:00 2001
From: Paul Hinze <paul.t.hinze@gmail.com>
Date: Mon, 22 Dec 2008 18:42:44 -0600
Subject: [PATCH] Fixing md5 import when hashlib is available

Thanks to habnabit and Rhamphoryncus in #python for help debugging
2009-01-09 15:46:38 -06:00
Loui Chang
c6d95bd471 Import md5 from hashlib if available.
The md5 module is deprecated and hashlib is available
since python 2.5.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-11 00:28:09 -06:00
John Goerzen
75af76b70f Patch from Jim Pryor to support /etc/netrc in addition to ~/.netrc 2008-12-02 13:15:44 -06:00
John Goerzen
147265ac39 Apply remainder of Jim Pryor's patch 2008-12-02 13:12:36 -06:00
John Goerzen
e1fb9492f8 Patch for signal handling to start a sync by Jim Pryor
Here's the way I'd like to use offlineimap on my laptop:
    1. Have a regular cron job running infrequently. The cron job
    checks to see
if I'm online, plugged in, and that no other copy of offlineimap is
running. If
all of these conditions are satisfied, it runs offlineimap just once:
"offlineimap -o -u Noninteractive.Quiet"

    2. When I start up mutt, I do it by calling a wrapper script that
    delays
until cron-started copies of offlineimap have finished, then starts
    offlineimap
on its regular, stay-alive and keep checking schedule. When I quit
    mutt, the
wrapper script tells offlineimap to stop.

This way I get frequent regular checks while I have mutt running, but
I don't
waste my battery/cpu checking frequently for mail when I'm not
interested in
it.

To make this work, though, it'd be nicer if it were easier to tell
offlineimap,
from the outside, things like "terminate cleanly now" and "when you've
finished
synching, then terminate instead of sleeping and synching again."

OK, to put my money where my mouth is, I attach two patches against
offlineimap
6.0.3.

The first, "cleanup.patch", cleans up a few spots that tend to throw
exceptions
for me as offlineimap is exiting from a KeyboardInterrupt.

The second adds signaling capabilities to offlineimap.

* sending a SIGTERM tells offlineimap to terminate immediately but
  cleanly,
  just as if "q" had been pressed in the GUI interface

* sending a SIGUSR1 tells every account to do a full sync asap: if
  it's
  sleeping, then wake up and do the sync now. If it's mid-sync, then
  re-synch
  any folders whose syncing has already been started or completed, and
  continue
  to synch the other, queued but not-yet-synched folders.

* sending a SIGHUP tells every account to die as soon as it can (but
  not
  immediately: only after finishing any synch it's now engaged in)

* sending a SIGUSR2 tells every account to do a full sync asap (as
  with
  SIGUSR1), then die

It's tricky to mix signals with threads, but I think I've done this
correctly.
I've been using it now for a few weeks without any obvious
problems. But I'm passing it
on so that others can review the code and test it out on their
systems. I developed the
patch when I was running Python 2.5.2, but to my knowledge I don't use
any Python 2.5-specific
code. Now I'm using the patch with Python 2.6.

Although I said "without any obvious problems," let me confess that
I'm
seeing offlineimap regularly choke when I do things like this: start
up
my offlineimap-wrapped copy of mutt, wait a while, put the machine to
sleep (not sure if offlineimap is active in the background or idling),
move to a different spot, wake the machine up again and it acquires a
new network, sometimes a wired network instead of wifi. Offlineimap
doesn't like that so much. I don't yet have any reason to think the
problems here come from my patches. But I'm just acknowledging them,
so
that if others are able to use offlineimap without any difficulty in
situations like I described, then maybe the fault is with my patches.
2008-12-01 16:13:16 -06:00
John Goerzen
5db24303b7 Patch to make exit on Ctrl-C cleaner
From Jim Pryor

The first, "cleanup.patch", cleans up a few spots that tend to throw
exceptions for me as offlineimap is exiting from a KeyboardInterrupt.
2008-12-01 16:10:49 -06:00
John Goerzen
d69176090c New option to only work with subscribed folders
Patch from Sean Finney, slightly modified by John Goerzen to change
name of config file option

fixes deb#499588
2008-10-01 00:33:57 -05:00
John Goerzen
ab43d74549 Applied pre/post sync hooks
Patch from Sylvain FORET in refs #71
2008-10-01 00:03:04 -05:00
John Goerzen
c886987a5b Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap 2008-09-29 18:04:50 -05:00
Michael Witten
5fe379f66d imaplibutil: Remove flagrantly bad use of private attribute
Frankly, the original code doesn't even make much sense, and
moreover it's not forward compatible with python 2.6, and
furthermore:

    DeprecationWarning: socket.ssl() is deprecated.

So, this commit is just a temporary fix.

Signed-off-by: Michael Witten <mfwitten@mit.edu>
2008-09-29 17:50:50 -05:00
John Goerzen
10c2b6fbaa Apply new darwin.patch from Vincent Beffara
fixes #20
patch dated 5/27/2008
2008-09-18 09:23:37 -05:00
John Goerzen
d097da005e Prepping 6.0.3 2008-08-13 00:05:17 -05:00
Henning Glawe
140be81efd make the trash and spam folder names in Gmail accounts configurable 2008-08-13 00:03:13 -05:00
John Goerzen
9551e9d38e task_done wasn't in Python before 2.5 2008-08-11 20:38:33 -05:00
John Goerzen
1d91fb7a96 Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap 2008-08-08 13:08:08 -05:00
Ben Willard
04a6270058 Fix a bug preventing the pid file from being empty.
Convert os.getpid() to a string before writing it to the pid file in
order to avoid generating an empty pid file.
2008-08-07 21:09:11 -05:00
John Goerzen
1b9f04a564 Removed debug statements 2008-08-05 00:07:26 -05:00
John Goerzen
fe57342448 Yet another Python threading workaround.
module threading should be taken out back and shot.

Condition.wait() is a busywait loop that has negative implications for
battery consumption on laptops.

Queue.get() in blocking mode blocks SIGINT from being delivered.

Argh, argh, argh.

Closes: #493801.
2008-08-05 00:05:29 -05:00
John Goerzen
0a801457df Bump version to 6.0.2 2008-08-02 17:44:20 -05:00
John Goerzen
2a852a8f48 Rework keepalive to use time.sleep() instead of event.wait()
This should improve power-management abilities some more

The catch is that we can't wait any longer for the kathread to
terminate.  We were waiting for this in some cases.  This is probably
not a big deal.

fixes deb#434074
fixes #66
2008-08-02 17:44:03 -05:00
John Goerzen
0da6bedaa0 Eliminate one more fsync 2008-08-02 15:31:43 -05:00
John Goerzen
a5dc9a331d Bump version to 6.0.1 2008-08-02 15:13:43 -05:00
John Goerzen
fbcb157ca4 Fix syntax error in nofsync support 2008-08-02 15:11:23 -05:00
John Goerzen
8114877fae Rework threadutil to use Queue for simplification and power-friendliness
Removes code and should avoid weird Python situation that causes cpu
wakeups

fixes deb#434074
fixes #66
2008-08-02 15:10:11 -05:00
John Goerzen
2b23657db0 Added ability to disable fsync()
Passed config to LocalStatus and Maildir folders so they can look
up the fsync status
2008-08-02 14:55:08 -05:00
John Goerzen
0754bdef6a Slightly more debug info 2008-08-02 14:37:55 -05:00
John Goerzen
bd1d1010e7 Now create cur,new,tmp in '.' even if existsok is false
Otherwise, there was a race where sometimes subfolders would get created
first in the sep = '.' scneario

fixes #64
2008-08-02 14:34:51 -05:00
John Goerzen
1a15b6964f Fix for keys with -1
fixes #83
2008-07-16 14:12:38 -05:00
Mark Hymers
ca08c1e553 Add support for ssl client certificates
This patch adds sslclientcert and sslclientkey configuration
  options which are passed through to imaplib in order to allow
  the use of client certificates for authentication.

Tue Nov 13 14:44:17 CST 2007  Mark Hymers <mhy@debian.org>
2008-05-23 14:58:18 -05:00
John Goerzen
3c7edc2e4d Revert "Initial stab at showing list of folders that aren't being synced"
This reverts commit fa766b61bc.

Not going to follow this path right now
2008-05-20 01:38:42 -05:00
John Goerzen
6790c94869 Revert "Checkpointing work on mailbox deletion"
This reverts commit f58ebe390d.

Not going to follow this path right now
2008-05-20 01:38:32 -05:00
John Goerzen
f58ebe390d Checkpointing work on mailbox deletion 2008-05-20 01:38:15 -05:00
John Goerzen
fa766b61bc Initial stab at showing list of folders that aren't being synced
This isn't working right yet because two accounts could sync into one
destination
2008-05-20 01:13:36 -05:00
John Goerzen
3862c8e1a0 Poof, this is 6.0.0. 2008-05-20 00:01:51 -05:00
John Goerzen
c18f8b9fad Prepping 5.99.15; fixes: #63 2008-05-12 09:03:08 -05:00
John Goerzen
3ff37143b5 Finally fix the stupid LocalStatus folder bug, I really hope!
Noted thie code:

    statusfolder =
    statusrepos.getfolder(remotefolder.getvisiblename().\
                                         replace(remoterepos.getsep(),
                                                 statusrepos.getsep()))

in accounts.py.  Should have been using the sep of the LocalStatus all
along.

refs deb#479798, #68
2008-05-10 21:08:05 -05:00
John Goerzen
5dc33409e3 Prepping 5.99.14 2008-05-09 20:44:19 -05:00
John Goerzen
fe1d92f00e Revert some previous attempts at localstatus creation
refs deb#479798

Reverts cf080844ac
and 031e018ead
2008-05-06 18:23:48 -05:00
John Goerzen
f103c54801 Bump to 5.99.13 2008-05-06 08:51:58 -05:00
John Goerzen
5749247382 Revert "Apply darwin.patch from Vincent Beffara"
This reverts commit 9f5c8d708b.

Several people were complaining about problems.  See
http://bugs.debian.org/479677.

Closes: #479677.

refs #20.
2008-05-06 08:12:54 -05:00
John Goerzen
70a09c3a89 Version 5.99.12 2008-05-05 00:48:55 -05:00
John Goerzen
553158a81b Finally fix problem with making new folders
fixes deb#478990.  fixes #63.

Patch from Martin F. Krafft.
2008-05-05 00:08:01 -05:00
John Goerzen
9f5c8d708b Apply darwin.patch from Vincent Beffara
fixes #20

 04/27/2008 09:34 AM - Vincent Beffara

    * File darwin.patch added

OK, I finally installed an IMAPS server on my iMac, so I could test a
little further. For some reason, fixing the read() method in
imaplibutil.py did not seem to work (it hung on connecting to the
server) - however, modifying the file imapserver.py similarly to the
non-SSL case fixed the crash.

I also reduced the chunk size to 100k instead of 1M, as 1M seemed to
still trigger the memory error in some cases. Ah, and I added a
platform test, so that the patch does essentially nothing on
non-Darwin machines ...

So, still no guarantee, but the attached patch works for me. Any
comments ?

(If noone here screams in horror at my code, I will include the patch
into the Fink package and see what happens there.)
2008-05-01 15:20:56 -05:00
John Goerzen
1b0788cb24 Rev versions 2008-04-17 09:53:20 -05:00