Commit Graph

1363 Commits

Author SHA1 Message Date
Sebastian Spaeth 1f91d0fd06 Adapt imports so that test/OLItest can be imported
To run the test suite from the main setup.py we need to be able to
import and run the test suite from a different folder than the "test"
dir.

Make "test" a package and fix the imports to still work when imported
from another folder.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth 1cdabcec46 Add code comment
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth 9a905188f2 Add userfriendly warning if credentials.conf is missing
Warn the user and advise what she should be doing to get going.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth 7b75e04b5b Add initial skeleton for a testing framework
This is the first revision that actually performs a test, in that it
starts up OfflineImap and sees if there are any exceptions.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth c1625aa719 DOCS: Tweak SSL FAQ a bit more
Cleanup the previously added information.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:15:04 +01:00
Sebastian Spaeth 2c19a63b9d DOCS: Add SSL debugging info to FAQ
Take the debugging instructions by Daniel Shahaf and add them to the
FAQ.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:08:31 +01:00
Sebastian Spaeth 48802ae4b6 TTYUI: Fix missing "time" import
commit f2a94af5 introduced the use of time.sleep in ui/TTY.py without
importing it. This caused a regression in 6.5.2, crashing OfflineIMap
when in refresh mode.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 02:02:55 +01:00
Sebastian Spaeth 344b2f0b7a TTYUI: Fix python 2.6 compatibility
We were using super() on a class derived from logging.Formatter() which
worked fine in python 2.7. Apparently python 2.6 uses old-style classes
for this, so the TTYUI broke and crashed OfflineImap. This was
introduced in OLI 6.5.0, I think.

Fix it by calling logging.Formatter.... directly, rather than the
elegant super() (which I happen to like a lot more than is appropriate
in the python world).

Reported by Nik Reiman as github issue 23, should fix that issue.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-18 00:39:04 +01:00
Sebastian Spaeth 73b2b01dfa Changelog entry for previous commit
Forgot to add a changelog entry.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-17 05:14:50 +01:00
Sebastian Spaeth 6dc74c9da5 Improve delete performance with SQLITE backend
When deleting many (eg 2000) mails using the SQLITE backend, this takes
a long time durig which OfflineImap can not be aborted via
CTRL-C. Thinking it had frozen permanently, I killed it hard, leaving a
corrupted db journal (which leads to awkwards complaints by OLI on
subsequent starts!). That shows that delete performance is critical and
needs improvement.

We were iterating through the list of messages to delete and deleted
them one-by-one execute()'ing a new SQL Query for each message. This
patch improves the situation by allowing us to use executemany(), which
is -despite still being one SQL query per message- much faster. This is
because rather than performing a commit() after each mail, we now do
only one commit() after all mails have been deleted.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-17 04:17:15 +01:00
Sebastian Spaeth 7a5768e471 Release v6.5.2
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-17 01:40:12 +01:00
Sebastian Spaeth 340c2f9a89 Improve documentation
Improve wording, and integrate the MANUAL and INSTALL and FAQ documents
into our complete user manual that is hosted online.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-17 01:34:56 +01:00
Sebastian Spaeth f2a94af522 Don't emit regular sleeping announcements in Basic UI
They are too noisy in the Basic UI, but are still included in TTYUI.
Reported by John Wiegley.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-10 07:20:49 +01:00
Sebastian Spaeth 1b30ab896e Add changelog entry
Changelog entry for commit 0b103e8627

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-09 16:39:50 +01:00
Cédric Krier 3028648e8f Don't fail if /etc/netrc is not readable 2012-01-09 16:39:12 +01:00
Sebastian Spaeth 9e65cfca21 Release v6.5.2-rc1
OfflineIMAP v6.5.2-rc1 (2012-01-09)
===================================
Commits v6.5.1.1 - v6.5.2-rc1:
note: Proper Changelog still in Changelog-draft.rst
d72bb88 Improve error message
3284e01 Revert "use .response() rather _get_untagged_response()"
81f194a mbnames should write out local and not nametransformed box names
7184ec2 Sanity check return value of UIDVALIDTY response
50de217 Allow to pass 'force' arg to selectro() to enforce a new select
ed71805 Changelog entry about "realdelete" option
0a275b9 Add scary warnings about "realdelete" option

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-09 10:04:05 +01:00
Sebastian Spaeth d72bb88729 Improve error message
Add *what* UID was returned in case savemessage did not return a UID>0

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-09 09:57:36 +01:00
Sebastian Spaeth 3284e010ff Revert "use .response() rather _get_untagged_response()"
Recently the internal function use of imaplib2's _get_untagged_response()
was switched to use the public documented .response() function (which
should return the same data). However within a few fays we received reports
that both uses of a) the UIDVALIDITY fetching and b) the APPENDUID fetching
returned [None] as data although the IMAP log definitely shows that data
was returned. Revert to using the undocumented internal imaplib2 function,
that seemed to have worked without problems. This needs to be taken up to
the imaplib2 developer.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-09 09:51:43 +01:00
Sebastian Spaeth 81f194adca mbnames should write out local and not nametransformed box names
Rather than to write out the nametrans'lated folder names for mbnames,
we now write out the local untransformed box names. This is generally
what we want. This became relevant since we support nametrans rules on
the local side since only a short time. Reported by Paul Collignan.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-08 12:48:21 +01:00
Sebastian Spaeth 7184ec28cc Sanity check return value of UIDVALIDTY response
We have a reported case where response('UIDVALIDITY') returned [None]
which results in an ugly non-intuitive crash. Sanity check and report
something nicer.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-08 12:26:47 +01:00
Sebastian Spaeth 50de2174bf Allow to pass 'force' arg to selectro() to enforce a new select
Pass through the 'force' argument from selectro() to select() so that it
can also enforce a new SELECT even if we already are on that folder.

Also change the default parameter from '0' to 'False' to make clear that
this is a Bool.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-08 11:29:54 +01:00
Sebastian Spaeth ed71805476 Changelog entry about "realdelete" option
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-08 01:13:08 +01:00
Sebastian Spaeth 0a275b9532 Add scary warnings about "realdelete" option
WARNING: I consider the Gmail "realdelete" option as harmful with the
potential for DATALOSS. Add scary warnings to offlineimap.conf.

See the analysis at
http://article.gmane.org/gmane.mail.imap.offlineimap.general/5265

Deleting a message from a Gmail folder via the IMAP interface will just
remove that folder's label from the message: the message will continue
to exist in the '[Gmail]/All Mail' folder.  If `realdelete` is set to
`True`, then deleted messages will be moved to the '[Gmail]/Trash'
folder.  BEWARE: this will immediately delete a messages from *all
folders* it belongs to!

AS OFFLINEIMAP IMPLEMENTS FOLDER MOVES AS 1) AN ADD and 2) A DELETE (the
order can vary), THIS MEANS THAT A FOLDER MOVE CAN CAUSE DATALOSS. DO
NOT USE IT AND MOVE MAIL TO "[Gmail]/Trash" TO DELETE MAIL FROM
"[Gmail]/All Mail"!

We will need to discuss whether to completely disable that feature.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-08 01:06:56 +01:00
Sebastian Spaeth 15b4a7a5b9 OfflineIMAP v6.5.1.2
See changelog for details

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 23:34:00 +01:00
Sebastian Spaeth 137e11c88e Improve previous comment & Changelog
Add a changelog to W. Trevor King's previous commit. Also make wording a
bit more consistent and and remove a now unneeded comparison (dirname is
always set when extension is set).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 23:26:02 +01:00
W. Trevor King 061712fe1c Folder could not be created
On Tue, Dec 13, 2011 at 12:00:57PM -0500, W. Trevor King wrote:
> I've attached a patch that does fix the problem…

Oops, *now* I've attached the patch and logs ;).

--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

From 3067b1b4dfb00d165bd9480ea49f446adb12991d Mon Sep 17 00:00:00 2001
From: W. Trevor King <wking@drexel.edu>
Date: Tue, 13 Dec 2011 11:26:00 -0500
Subject: [PATCH] Only scan children in _getfolders_scandir if extension is set.

When sep is '/', MaildirRepository._getfolders_scandir recursively
checks sub-directories for additional maildirs.  The old loop logic
always checked the top directory and its children.  This lead to
children being found twice, once from their parent, with dirname
matching their directory name, and once from themselves, with a
dirname of ''.

This patch fixes the problem by only checking the top directory when
extension is not set (i.e. for the root directory).
2012-01-07 23:21:40 +01:00
Sebastian Spaeth 87ebb3779a Restore Changelog draft
It had accidentally been reversed by the master->next merge

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 22:15:31 +01:00
Sebastian Spaeth 6c1d80f727 Merge branch 'master' into next 2012-01-07 22:04:25 +01:00
Sebastian Spaeth 6e9e256946 Ignore lower-case custom Maildir flags
Do not read in custom maildir flags, or we would try to sync them over
the wire. The next step will be to merge flag writes with existing
custom flags, so we don't lose information.

The long term goal will be to attempt to sync flags to the other side,
of course.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 22:00:45 +01:00
Sebastian Spaeth d549cbdac9 Fix code comment on flag stripping
Fix code comment that we preserve custom dovecot flags. We discard them.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 21:34:57 +01:00
Sebastian Spaeth e3ecb0330d Merge branch 'next' 2012-01-07 21:19:17 +01:00
Sebastian Spaeth 241e8f838b Add filter information to --info output
Prettify the folder listing in --info and add the "filtered" information
to it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 21:17:36 +01:00
Sebastian Spaeth e267dcd24d Need to import OfflineImapError for --info function
An import was missing.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 20:33:34 +01:00
Sebastian Spaeth 679977e5d3 Need to import OfflineImapError for --info function
An import was missing.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 20:32:31 +01:00
Sebastian Spaeth f88f8cf984 offlineimap.conf wording tweaks
Clarify and improve wording in minor ways.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 18:03:21 +01:00
Nicolas Sebrecht b85f36e520 doc: add link to the web page of autogenerated API
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2012-01-07 16:53:49 +01:00
Sebastian Spaeth 54a6f17ef7 Merge branch 'next' 2012-01-07 15:15:20 +01:00
Sebastian Spaeth 9cba9b8f3a OfflineIMAP v6.5.1.1
Blinkenlights UI 6.5.0 regression fixes only.

* Sleep led to crash ('abort_signal' not existing)

* Make exit via 'q' key work again cleanly

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 15:14:30 +01:00
Sebastian Spaeth 3f98adc4dc Merge branch 'next'
Conflicts:
	Changelog.draft.rst
2012-01-07 15:03:25 +01:00
Sebastian Spaeth 968dcd5780 Make exit via 'q' key work again in Blinkenlights UI
With the new abort signal handler, we can send a signal that lets us
exit cleanly. Make use of this, rather than crashing out in ugly ways.

This affects only the Blinkenlights UI when pressing 'q'.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 15:02:22 +01:00
Sebastian Spaeth 415c7d7979 Fix abort_sleep missing crash in Blinkenlights UI
This is a regression introduced when renaming signals due to the
improved CTRL-C handling. Regression in 6.5.0

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 14:54:16 +01:00
Sebastian Spaeth 05e43b0363 Merge branch 'next'
Conflicts:
	Changelog.draft.rst
2012-01-07 13:17:34 +01:00
Sebastian Spaeth 45782ca3ac Release v 6.5.1
OfflineIMAP v6.5.1 (2012-01-07) - "Quest for stability"
=======================================================

* Fixed Maildir regression "flagmatchre" not found. (regressed in 6.5.0)

* Have console output go by default to STDOUT and not STDERR (regression
  in 6.5.0)

* Fixed MachineUI to urlencode() output lines again, rather than
  outputting multi-line items. It's ugly as hell, but it had been that
  way for years.

* Remove the old global locking system. We lock only the accounts that
  we currently sync, so you can invoke OfflineImap multiple times now as
  long as you sync different accounts. This system is compatible with
  all releases >= 6.4.0, so don't run older releases simultanous to this
  one.
2012-01-07 13:15:44 +01:00
Sebastian Spaeth 0b85a34fc7 Maildir: flagmatchre --> re_flagmatch
Overlooked a variable renaming when merging in a branch.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 13:10:41 +01:00
Sebastian Spaeth 9d6a2dec37 Have log output go to STDOUT by default
THe new logging framwork spit putput to STDERR by default (as that is
pythons default), but we used to have STDERR, so make it go there again.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 03:04:26 +01:00
Sebastian Spaeth 3a1eab7383 Remove a stray debug output that slipped in the previous commit.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 01:31:24 +01:00
Sebastian Spaeth ec63b4fe6b replace imaplib internal _get_untagged_response with public functions
We were using the internal imaplib2 _get_untagged_response() functions a
few times. Replace 3 of these calls with 2 calls to the public function
response() rather than fudging with internals that could change anytime.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-07 01:28:20 +01:00
Sebastian Spaeth 1b85e35256 Disable old global lock system
Remove the old global locking system. We lock only the accounts that we
currently sync, so you can invoke OfflineImap multiple times now as long
as you sync different accounts. This system is compatible with all
releases >= 6.4.0, so don't run older releases simultanous to this one.

This mostly reverts commit 0d95651417,
disabling the old global lock system that we had in parallel to the new one.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-06 23:54:28 +01:00
Sebastian Spaeth 5509691dcf Add Changelog entry about restored MachineUI
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-06 23:47:26 +01:00
Sebastian Spaeth 946386a8e7 Restore previous MachineUI output a bit more
The logging rework led to multipline output as we stopped urlencoding
the output lines. Urrg. Fixed this, so output is urlencoded again.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-06 23:40:31 +01:00