1
0
mirror of https://github.com/OfflineIMAP/offlineimap.git synced 2024-06-23 07:16:38 +02:00
Commit Graph

469 Commits

Author SHA1 Message Date
John Goerzen
9e6427a443 update version info 2009-08-12 00:41:19 -05:00
John Goerzen
1f8024a70e [imaplib2 removal] Revert "Implementation of IMAP IDLE"
This reverts commit 3847d0ba9d.
2009-08-12 14:49:58 -05:00
John Goerzen
36e0971adb [imaplib2 removal] Revert "use latest version of imaplib2"
This reverts commit fadbd38ef9.
2009-08-12 14:49:50 -05:00
John Goerzen
3869af9e0b [imaplib2 removal] Revert "Allow keepalive to be overridden by user if imapfolders is set"
This reverts commit 8cd2bdf7f5.
2009-08-12 14:49:12 -05:00
John Goerzen
8e1fc71879 [imaplib2 removal] Revert "Added check for IDLE in capabilities"
This reverts commit 17ec4df02a.
2009-08-12 14:48:38 -05:00
John Goerzen
a3a0a68163 Revert "Quick synchronizations (for 'quick' > 0) are now performed between full synchronizations (as specified in the documentation)."
This reverts commit 220db8a77d.

From: Daniel Jacobowitz
Date: July 17, 2009

The documentation may have been unclear, but quick never worked the
way this patch changes it.  My installed offlineimap does one sync
every $autorefresh minutes, and the $quick'th one is a full sync.  All
the others are quick.  Now it's going to do a full sync every
$autorefresh minutes and a ludicrous number of $quick syncs.

-- Daniel Jacobowitz CodeSourcery
2009-07-17 00:03:29 -05:00
John Goerzen
b053923d41 Prepping 6.1.2 2009-07-16 00:03:23 -05:00
Michal Vitecek
220db8a77d Quick synchronizations (for 'quick' > 0) are now performed between full synchronizations (as specified in the documentation).
Hello John,

 The attached patch makes quick synchronization work again (according to
 the documentation), so there are <quick> quick synchronizations
 performed between full synchronizations.

 Thanks,
        Michal
2009-07-12 08:54:18 -05:00
John Goerzen
dd351a2465 Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap 2009-07-12 08:53:18 -05:00
Christoph Höger
fadbd38ef9 use latest version of imaplib2
* fixes rh bz #510036
Signed-off-by: Christoph Höger <choeger@cs.tu-berlin.de>

[ per jgoerzen: rh bz #510036 is Kerberos issue.  also Closes: #535794 in Debian ]
2009-07-12 08:52:29 -05:00
John Goerzen
141a23849b Reduce memory usage when scanning Maildirs
Patch from Michal Vitecek
2009-07-07 00:52:00 -05:00
John Goerzen
7bdd4a69fa Fix the order of folders during sync
was broken by e1fb9492f8
      (Patch for signal handling to start a sync by Jim Prior)

This patch from Nicolas Dandrimont.  Closes: #535540.
2009-07-07 00:04:52 -05:00
John Goerzen
5c11de5285 Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap 2009-07-06 10:11:20 -05:00
John Goerzen
2683980733 Fixing Python issue to minimum 2.5 2009-07-02 00:04:20 -05:00
John Goerzen
8b625fa98e Bump version number 2009-07-01 21:00:30 -05:00
John Goerzen
e5f6e392a8 Added patch for Python 2.6 ssl 2009-07-01 20:49:20 -05:00
Peter Colberg
3299b2240c Applied patch from Peter Colberg to remove usage of hard linking
Closes: #535160

Bug#535160: offlineimap fails on encfs (FUSE) due to hard linking

Package: offlineimap
Version: 6.0.3
Severity: normal
Tags: patch

Hi,

if the localrepository is stored on an encfs, offlineimap fails as follows:

    OfflineIMAP 6.0.3
    Copyright (C) 2002 - 2008 John Goerzen <jgoerzen@complete.org>
    This software comes with ABSOLUTELY NO WARRANTY; see the file
    COPYING for details.  This is free software, and you are welcome
    to distribute it under the conditions laid out in COPYING.
    ***** Processing account pleione
    Copying folder structure from IMAP to Maildir
    Establishing connection to tunnel:eval `keychain --quiet --eval` && ssh -q mymailhost /usr/sbin/dovecot --exec-mail imap.
    Syncing Drafts: IMAP -> Maildir
    Syncing INBOX: IMAP -> Maildir
    ----------8<----------
    Syncing net: IMAP -> Maildir
    Copy message 360 IMAP[net] -> Maildir[net], LocalStatus[net]
    Syncing personal: IMAP -> Maildir
    Thread 'Copy message 360 from net' terminated with exception:
    Traceback (most recent call last):
      File "/var/lib/python-support/python2.4/offlineimap/threadutil.py", line 149, in run
	Thread.run(self)
      File "threading.py", line 422, in run
	self.__target(*self.__args, **self.__kwargs)
      File "/var/lib/python-support/python2.4/offlineimap/folder/Base.py", line 282, in copymessageto
	newuid = object.savemessage(uid, message, flags, rtime)
      File "/var/lib/python-support/python2.4/offlineimap/folder/Maildir.py", line 198, in savemessage
	os.path.join(tmpdir, messagename))
    OSError: [Errno 1] Operation not permitted

    Last 4 debug messages logged for Copy message 360 from net prior to exception:
    ----------8<----------

As encfs does not support hard linking, the rename of the temporary
message file fails.

This is the only occurrence of hard linking in offlineimap and can be
fixed by using an atomic `os.rename` instead of `os.link`+`os.unlink`.
I have been using the attached patch for more than 1.5 years and have
never again had any problems with offlineimap on encfs.

Regards,
Peter
2009-06-30 00:03:37 -05:00
Christoph Höger
0a221dc9c5 set gssapi to false on kerberos error
* this fixes a crash when the n-th connection returns an error
	by falling back to plainauth
Signed-off-by: Christoph Höger <choeger@cs.tu-berlin.de>
2009-06-29 00:05:00 -05:00
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