416df5d7c2
When file_use_mail_timestamp or utime_from_header are enabled, OfflineIMAP tries to parse the Date header in the email. If the header is present but invalid -- it doesn't contain a valid date -- this will cause email.message to raise an exception. This is all fine. However when handling that exception, OfflineIMAP can't try to extract the date again: it's clearly invalid, and raising the same exception a second time while handling the first exception just causes the entire sync to fail. To avoid that happening, don't try to provide the invalid date string in the error message. Instead, just give the user the UID of the email that triggered the exception, and the exception text. Ideally we'd instead fix the code to actually extract the header value and provide it in the error message, but Python's email.message module doesn't provide an easy way to get the raw text of the Date header from an EmailMessage object; it's possible using private variables like EmailMessage._headers, or by parsing the email using a custom email.policy.EmailPolicy object that disables the module's attempts to coerce the header value to a DateTime. However, a user should be able to get the problematic Date header from the message directly anyway, so it's not worth adding all that complexity for something that should be rare and provides little value. Fixes #134 Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> |
||
---|---|---|
.github | ||
bin | ||
contrib | ||
docs | ||
offlineimap | ||
scripts | ||
test | ||
tests | ||
.coveragerc | ||
.gitignore | ||
.travis.yml | ||
Changelog.maint.md | ||
Changelog.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.rst | ||
COPYING | ||
Dockerfile | ||
MAINTAINERS.rst | ||
Makefile | ||
MANIFEST.in | ||
offlineimap.conf | ||
offlineimap.conf.minimal | ||
offlineimap.py | ||
README.md | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
snapcraft.yaml | ||
TODO.rst |
Upstream status (master
branch):
Upstream status (next
branch):
Links:
- Official github code repository
- for Python 2: offlineimap
- for Python 3: offlineimap3
- Website: website
- Wiki: wiki
- Blog: blog
OfflineIMAP
"Get the emails where you need them."
Description
OfflineIMAP is software that downloads your email mailbox(es) as local Maildirs. OfflineIMAP will synchronize both sides via IMAP.
Why should I use OfflineIMAP?
IMAP's main downside is that you have to trust your email provider to not lose your email. While certainly unlikely, it's not impossible. With OfflineIMAP, you can download your Mailboxes and make you own backups of your Maildir.
This allows reading your email offline without the need for your mail reader (MUA) to support IMAP operations. Need an attachment from a message without internet connection? No problem, the message is still there.
Project status and future
OfflineIMAP, using Python 3, is based on OfflineIMAP for Python 2. Currently we are updating the source code. These changes should not affect the user (documentation, configuration files,... are the same) but some links or packages could refer to the Python 2 version. In that case, please open an issue.
License
GNU General Public License v2.
Downloads
You should first check if your distribution already packages OfflineIMAP for you. Downloads releases as tarball or zipball.
If you are running Linux, you can install offlineimap with:
- openSUSE
zypper in offlineimap
- fedora
dnf install offlineimap
- Arch Linux: through AUR package offlineimap3-git
- Docker image:
offlineimap/offlineimap:latest
(note: image not published yet, just an example)
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. Provide the following information:
- system/distribution (with version)
- offlineimap version (
offlineimap -V
) - Python version
- server name or domain
- CLI options
- Configuration file (offlineimaprc)
- pythonfile (if any)
- Logs, error
- Steps to reproduce the error
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 v3+
- rfc6555 (required)
- imaplib2 >= 3.5
- gssapi (optional), for Kerberos authentication
- portalocker (optional), if you need to run offlineimap in Cygwin for Windows
Documentation
All current and updated documentation is on 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 (http://asciidoc.org)
$ make api # Requires sphinx