Commit Graph

333 Commits

Author SHA1 Message Date
Asheesh Laroia
35e7250187 only-write-once-to-cur-or-new.patch
I have tested this and Dovecot no longer beats offlineimap
to the punch. (-:

I achieved that by keeping the renames in tmp/ until it finally does
one last rename in new/ or cur/.
2007-06-13 04:42:15 +01:00
John Goerzen
799c867a4d Removed "print af" statements from imaplib.py
they were introduced by patch "Check all resolved addresses [deb #413030]"
and were screwing up the curses display.

refs deb#413030
2007-03-28 21:38:37 +01:00
John Goerzen
aca2a4458b UNDO: Added netrc support
thanks to bboissin plus offlineimap at gmail dot com
refs #14
2007-03-27 08:21:17 +01:00
John Goerzen
4f54887265 Improve filesystem flushing semantics
fsync the Maildir file, its final directory when writing a new message.

fsync the localstatus file and its final directory when writing the 
local status cache.

This should reduce duplication in the event of hardware trouble.

fixes #8

see thread at http://lists.complete.org/offlineimap@complete.org/2007/03/threads.html.gz
2007-03-28 21:23:18 +01:00
John Goerzen
4b564bd568 Added netrc support
thanks to bboissin plus offlineimap at gmail dot com
refs #14
2007-03-27 08:21:17 +01:00
David Favro
65a6b8aa81 Removed copyright notice; assigning copyright to John Goerzen 2007-03-16 03:45:28 +01:00
David Favro
82c215023c Removed copyright notice; assigning copyright to John Goerzen 2007-03-16 03:44:54 +01:00
David Favro
b06845fc70 UID validity diagnostics improvement
* Reduced the number of parameters passed to ui.validityproblem() because they were all just method-calls to the folder object, which is already passed as the first parameter (reduction of unnecessary complexity).

* Improved the diagnostic message for an 'UID validity problem' by including the name of the repository in which the folder resides; previously it was not possible to determine from the diagnostic alone on which side the problem was.
2007-03-15 05:41:43 +01:00
David Favro
657b470d74 UID validity diagnostics improvement
* Reduced the number of parameters passed to ui.validityproblem() because they were all just method-calls to the folder object, which is already passed as the first parameter (reduction of unnecessary complexity).
2007-03-15 05:39:15 +01:00
John Goerzen
79a596be7b Don't leave preauthtunnel zombies with autorefresh
From: Peter Colberg

Hello,

using offlineimap with the preauthtunnel option to start a remote
IMAP daemon via ssh, a zombie process is left behind during the
autorefresh sleep period if not holding the connection open.

Above behaviour is a result of using os.popen2 to spawn the tunnel
process, which makes it impossible waiting for the child process
to terminate when shutting down the tunnel.

The patch included below fixes the issue by employing the Popen
class from the subprocess module, which seems to be the preferred
way to spawn processes and connect to their pipes in any case (at
least since python version 2.4.4, which fixes a memory leak in the
subprocess module).

Regards,
Peter

fixes deb#410730
2007-03-14 02:54:19 +01:00
John Goerzen
82d5d5e675 Check all resolved addresses [deb #413030]
From: Mark Brown <broonie@sirena.org.uk>
Currently offlineimap will attempt to connect to the first address
returned by addrinfo() for the remote system and will fail if that fails
even if another result would have worked.  This is particularly common
when the remote system supports both IPv4 and IPv6 - a laptop may in
some environments have no routable IPv6 connectivity so if the IPv6
address is returned first the connect will fail even though IPv4 would
have worked.

This is actually a bug in imaplib, a copy of which is included in
offlineimap.  This patch fixes the problem by looping over all the
results returned by getaddrinfo().  Unfortunately it mangles the error
reporting slightly since I couldn't work out how to raise an appropriate
exception, though given that that that was a Python backtrace there was
work to do there anyway.

Note that I have only tested the SSL case.
2007-03-08 02:59:32 +01:00
John Goerzen
ca3a306ecc --help shows available UIs now
Thanks to Daniel Rall for the patch.
fixes #5
2007-01-11 10:15:06 +01:00
John Goerzen
2d9c1ed9b8 Updating version number to 4.0.16 2006-12-02 21:59:02 +01:00
John Goerzen
aa019172cb Handle rtime being Null when writing to Maildir
fixes #2
debian #401290
2006-12-02 21:54:26 +01:00
John Goerzen
c31f60f8df Update copyright date in Maildir.py 2006-12-02 21:54:15 +01:00
Daniel Burrows
1844cefd17 Remove a redundant (and mostly harmless) output of the error string from the Curses UI.
It looks like I accidentally recorded the wrong version of Curses.py --
originally this code was there, but I moved it over to UIBase so it would
cover the TTY UI also.
2006-12-01 12:27:12 +01:00
Daniel Burrows
dc8f3c944d Add a try: block to catch exceptions that occur before the main loop and to call ui.mainException().
I'm not sure if this is the "right" way to handle exceptions, but it does
correctly print the error message AFTER shutting down curses for me.
2006-12-01 11:59:22 +01:00
Daniel Burrows
c7894a01f0 Instead of blowing up when the account name is missing, display a useful error message that gives the correct account names. 2006-12-01 11:54:25 +01:00
Daniel Burrows
0ee7dfd435 Add parameters to terminate() that specify an (optional) error message to display on termination. 2006-12-01 11:54:12 +01:00
John Goerzen
2977f53244 Fix lack of revstr in version.py 2006-11-30 12:23:18 +01:00
John Goerzen
f2515a0b02 Updated copyright and version info for 4.0.15 2006-11-30 10:51:14 +01:00
John Goerzen
fc4e31e0db Updated homepage, refs #1 2006-11-30 10:46:51 +01:00
John Goerzen
f75a89d954 Updated copyright and version info 2006-10-19 02:04:28 +01:00
John Goerzen
a6db99a21e Add remote{host,user,pass}eval config options (need documentation yet)
From Ben Kibbey

hello,

Attached is a patch to enable evaluation of account credentials with the
remotehosteval, remoteusereval and remotepasseval configuration options.
I needed this because rather than change all my other programs
configuration settings when I change, say a password, I store them in a
file. So I call a function in pythonfile which parses the credential
file and returns the wanted info. Not really very well tested, but not
complex either. Offlineimap is great, thanks.
2006-10-17 20:55:03 +01:00
John Goerzen
89e530ff6e New restoreatime patch from Ben Kibbey
From: Ben Kibbey
Subject: Re: Removed restoratime from OfflineIMAP

On Wed, May 03, 2006 at 10:08:35PM -0500, John Goerzen wrote:
> Hi Ben,
> 
> Thanks for your restoreatime patch.
> 
> However, I have received this bug report:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365933
> 
> After looking at the problem, here's what's going on.
> 
> The person is using IMAP as the local repository as well.
> 
> You really need to move the atime save and restore code from accounts.py
> into the repository/Maildir.py.  Then, for any new call you add to the
> Maildir repository (that will be called from outside Maildir.py), you
> need to add a corresponding default function to repository/Base.py, and
> also make sure that on folders (such as IMAP) where atime restoration
> makes no sense, no error is generated.
> 
> Let me know if that doesn't make sense to you.  If you get it fixed, I'd
> be happy to re-apply it to a future version of OfflineIMAP.
> 
> -- John Goerzen
> 

Attached is a new diff that should work though not really tested
(v4.0.14). In repository/Base.py restore_atime() will call
self.restore_folder_atimes() only if the folder type is Maildir. Let me
know if it has any more problems.
2006-09-06 02:33:07 +01:00
John Goerzen
9d7df0e21a Fix up date parsing to use message date if no rtime is available 2006-08-22 02:13:39 +01:00
John Goerzen
03488ba81b Sync INTERNALDATE <-> mtime
The attached patch adds syncing the INTERNALDATE of IMAP folders with
the mtime of messages in maildir folders.
I want this to happen, because I'm running a dovecot over the maildirs
synced by offlineimap, and that uses the mtime as the INTERNALDATE.
When using mutt to view messages I generally sort based on the received
date, which for IMAP folders is the INTERNALDATE.

Since this is the first real coding I've done in Python the patch may
need to be cleaned up some, but it's working pretty well for me.  I've
added new messages to each side, and the received date has been
preserved going both ways.
2006-08-22 02:09:36 +01:00
John Goerzen
39a18fef60 Update FSF address 2006-08-12 05:15:55 +01:00
Adam Spiers
5fc0e1ae42 helpful comments 2006-05-16 04:40:23 +01:00
Adam Spiers
b39845c488 stop UID FETCH 0 errors 2006-05-16 04:31:44 +01:00
Adam Spiers
2e52bcdafe failure to obtain uid indicated by savemessage_searchforheader return value <= 0, not ValueError 2006-05-16 04:30:48 +01:00
Adam Spiers
720511f3f1 add missing ) 2006-05-16 04:27:57 +01:00
Adam Spiers
f2d4c668d5 return 0 rather than raise exception to indicate that message was saved with unknown UID 2006-05-16 03:34:46 +01:00
Adam Spiers
f11a49f263 make savemessage_searchforheader more robust 2006-05-15 03:51:12 +01:00
John Goerzen
8064ee26bd Prepping 4.0.13 2006-05-04 18:37:20 +01:00
John Goerzen
5a6b2a1ebd Revert restoreatime patch 2006-05-04 09:05:46 +01:00
John Goerzen
c0d031e760 Remove parens for SEARCH command
Patch from Adam Spiers

Reported that parens were causing trouble for Groupwise IMAP server
2006-05-01 20:40:55 +01:00
John Goerzen
405275f541 New restoreatime patch
From: Ben Kibbey <bjk@luxsci.net>

Attached is a patch to restore the atime of Maildir folders after
syncing. It can be enabled via the 'restoreatime' boolean in the
configuration file. I needed this because offlineimap is run after a
fetchmail and my mail checker breaks.
2006-03-02 00:12:29 +01:00
John Goerzen
fabbf81c1a Workaround for bug in Exchange
With help from Mark R. Biggers, I discovered that Exchange doesn't like an
asterisk in a folder name.

Sigh.
2005-10-07 20:11:20 +01:00
John Goerzen
27fae4e7ac Readying 4.0.11 release 2005-08-24 19:07:15 +01:00
John Goerzen
1f25b5393b [324827] Fixed handling of invalid dates
Patch from Nikita V. Youshchenko

From: "Nikita V. Youshchenko" 
To: Debian Bug Tracking System
Subject: offlineimap: exception on mail with broken headers (+fix)
Date: Wed, 24 Aug 2005 13:41:08 +0400

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

Recently I've got an exception (see below) while using offlineimap.
Exception was probably caused by invalid Date header of (likely spam)
message:
Date: Sat, 20 Aug 2005 4294967295:43:18 -0700
2005-08-24 19:01:42 +01:00
John Goerzen
0841e03a4c [319117] Unroll loop to speed performance on large folders
From: "Nikita V. Youshchenko"
I trued to use offlineimap and found that while being quite fast on
small folders, it takes up to several minutes (of 100% busy CPU and
almost no network traffic) to sync a folder with 2000+ messages.

While looking into the code, I found why this happens.
In folder/Base.py, in method BaseFolder.syncmessagesto_copy(),
dest.getmessagelist() is called inside a loop, while being a loop
invariant. Similar thing happens in BaseFolder.syncmessagesto_delete()
for self.getmessagelist().
This causes quadratic complexity over folder size.

Moving these calls out of loops make large folder sync fast (several
seconds instead of several minutes for folder with 2000 messages on
700MHz P3).
2005-08-23 08:15:09 +01:00
John Goerzen
ea4158dd6d Updated copyright and version files for 4.0.10 2005-05-24 00:12:58 +01:00
John Goerzen
d484b7da44 Removed unnecessary blank lines 2005-05-24 00:10:11 +01:00
John Goerzen
cf4a3b1861 Support IPv6 with SSL
Fix for Debian #309965.
2005-05-24 00:09:21 +01:00
John Goerzen
c42ad3ae55 Removed dep on profile
Keywords: 


(jgoerzen@complete.org--projects/offlineimap--head--1.0--patch-8)
2005-02-10 05:37:33 +01:00
John Goerzen
36d79a5c1f Checkpointing for .8
Keywords: 


(jgoerzen@complete.org--projects/offlineimap--head--1.0--patch-5)
2004-11-16 23:44:41 +01:00
John Goerzen
8137e53c14 Added code to limit command line length for very large mailboxes
Keywords: 


(jgoerzen@complete.org--projects/offlineimap--head--1.0--patch-4)
2004-11-16 23:41:09 +01:00
John Goerzen
440ee1708d Attempt to fix problem with getting back the wrong UID from APPENDUID
Keywords: 


(jgoerzen@complete.org--projects/offlineimap--head--1.0--patch-1)
2004-10-18 20:00:29 +01:00
John Goerzen
944209b858 Initial base-0 from arch 2005-04-16 20:35:25 +01:00