be285e522d
OfflineIMAP frequently delivers mail files to the Maildir consisting exclusively of a single ASCII digit in IDLE mode. IMAPFolder.getmessage expects 'data' to be of the form [(fetch-info, message-body)] However, the imapobj.uid call in getmessage returns a list of *all* pending untagged FETCH responses. If any message flags were changed in the selected IMAP folder since the last command (by another client or another thread in OfflineIMAP itself), the IMAP server will issue unsolicited FETCH responses indicating these flag changes (RFC3501, section 7). When this happens, 'data' will look like, for example ['1231 (FLAGS (\\Seen) UID 5300)', '1238 (FLAGS (\\Seen) UID 5318)', ('1242 (UID 5325 BODY[] {7976}', message-body)] Unfortunately, getmessage retrieves the message body as data[0][1], which in this example is just the string "2", and this is what gets stored in the mail file. Multi-threaded OfflineIMAP with IDLE or holdconnectionopen is particularly susceptible to this problem because flag changes synced back to the IMAP server on one thread will appear as unsolicited FETCH responses on another thread if it happens to have the same folder selected. This can also happen without IDLE or holdconnectionopen or even in single-threaded OfflineIMAP with concurrent access from other IMAP clients (webmail clients, etc.), though the window for the bug is much smaller. Ideally, either imaplib2 or getmessage would parse the fetch responses to find the response for the requested UID. However, since IMAP only specifies unilateral FETCH responses for flag changes, it's almost certainly safe to simply find the element of 'data' that is a tuple (perhaps aborting if there is more than one tuple) and use that. Github-fix: https://github.com/OfflineIMAP/offlineimap/issues/162 Based-on-patch-by: Austin Clements <amdragon@MIT.EDU> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net> |
||
---|---|---|
.github | ||
bin | ||
contrib | ||
docs | ||
offlineimap | ||
scripts | ||
test | ||
.gitignore | ||
Changelog.maint.md | ||
Changelog.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.rst | ||
COPYING | ||
MAINTAINERS.rst | ||
Makefile | ||
MANIFEST.in | ||
offlineimap.conf | ||
offlineimap.conf.minimal | ||
offlineimap.py | ||
README.md | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
TODO.rst |
OfflineIMAP
"Get the emails where you need them."
Description
OfflineIMAP is a software to dispose your e-mail mailbox(es) as a local Maildir. OfflineIMAP will synchronize both sides via IMAP.
The main downside about IMAP is that you have to trust your email provider to not lose your mails. This is not something impossible while not very common. With OfflineIMAP, you can download your Mailboxes and make you own backups of the Maildir.
This allows reading your email while offline without the need for the mail reader (MUA) to support IMAP disconnected operations. Need an attachment from a message without internet connection? It's fine, the message is still there.
Project status and future
As one of the maintainer of OfflineIMAP, I'd like to put my efforts into imapfw. imapfw is a software in development that I intend to replace OfflineIMAP in the long term.
That's why I'm not going to do development in OfflineIMAP. I continue to do the maintenance job in OfflineIMAP: fixing small bugs, (quick) reviewing/merging patches and rolling out new releases, but that's all.
While I keep tracking issues for OfflineIMAP, you should not expect support much from me anymore.
You won't be left at the side. OfflineIMAP's community is large enough so that you'll find people for most of your issues.
Get news from the blog.
Nicolas Sebrecht. ,-)
License
GNU General Public License v2.
Why should I use OfflineIMAP?
- It is fast.
- It is reliable.
- It is flexible.
- It is safe.
Downloads
You should first check if your distribution already packages OfflineIMAP for you. Downloads releases as tarball or zipball.
Feedbacks and contributions
The user discussions, development, announcements and all the exciting stuff take place on the mailing list. While not mandatory to send emails, you can subscribe here.
Bugs, issues and contributions can be requested to both the mailing list or the official Github project.
The community
- OfflineIMAP's main site is the project page at Github.
- There is the OfflineIMAP community's website.
- And finally, the wiki.
Requirements & dependencies
- Python v2.7+
- Python v3.4+ (experimental)
- six (required)
- imaplib2 >= 2.55 (optional)
Documentation
All the current and updated documentation is at the community's website.
Read documentation locally
You might want to read the documentation locally. Get the sources of the website. For the other documentation, run the appropriate make target:
$ ./scripts/get-repository.sh website
$ cd docs
$ make html # Requires rst2html
$ make man # Requires a2x
$ make api # Requires sphinx