{ "info": { "author": "David M. Straub ", "author_email": "straub@pm.me", "bugtrack_url": null, "classifiers": [], "description": "imapbackup3\n===========\n\nA Python package for creating full backups of IMAP mailboxes\n\n## Installation\n\n```\npython3 -m pip install --user imapbackup3\n```\n\n## Command line usage\n\n```\nusage: imapbackup3 [-h] [-y] [-f FOLDERS] [-e] [-k KEY] [-c CERT] -s HOST\n [-P PORT] -u USER [-p PASSWORD] [-m MAILBOX] [-t SECS]\n [--thunderbird]\n\nBack up E-mail messages from an IMAP server. mbox files are created in the\ncurrent working directory.\n\noptional arguments:\n -h, --help show this help message and exit\n -y, --yes-overwrite-mboxes\n Overwite existing mbox files instead of appending\n -f FOLDERS, --folders FOLDERS\n Specifify which folders use. Comma separated list.\n -e, --ssl Use SSL. Port defaults to 993.\n -k KEY, --key KEY PEM private key file for SSL. Specify cert, too.\n -c CERT, --cert CERT PEM certificate chain for SSL. Specify key, too.\n Python's SSL module doesn't check the cert chain.\n -s HOST, --server HOST\n Address of server (without port)\n -P PORT, --port PORT Server port (defaults to 143 without and 993 with SSL)\n -u USER, --user USER Username to log into server\n -p PASSWORD, --password PASSWORD\n Prompts for password if not specified. If the first\n character is '@', treat the rest as a path to a file\n containing the password. Leading '' makes it literal.\n -m MAILBOX, --mailbox MAILBOX\n Local e-mail storage format. Possible values: mbox\n (default), Maildir\n -t SECS, --timeout SECS\n Sets socket timeout to SECS seconds.\n --thunderbird Create Mozilla Thunderbird compatible mailbox\n```\n\n## Python usage\n\nMinimal example (using SSL on port 993):\n\n```python\nfrom imapbackup3 import IMAPBackup\nwith IMAPBackup(host='mail.example.com', user='myuser', password='mypassword') as imb:\n imb.download_all_messages()\n```\n\nFull example:\n\n```python\nfrom imapbackup3 import IMAPBackup\nwith IMAPBackup(\n host='mail.example.com',\n user='myuser',\n password='mypassword',\n port=993,\n usessl=True,\n keyfilename='my_key.pem',\n certfilename='my_cert.pem',\n thunderbird=False,\n folders=['INBOX', 'INBOX.Sent'],\n fmt='Maildir',\n) as imb:\n imb.download_all_messages()\n```\n\n### Usage of the message filter\n\nA function `msg_filter` can be passed to the `download_all_messages` method\nthat takes an `email.message.EmailMessage` instance as input and either\nreturns the same instance again (which will not change anything), returns\n`None` (which will filter out the message) or returns a modified instance\n(which will store the modified message). (Stupid) example:\n\n```python\ndef my_filter(msg):\n if 'SPAM' in msg['subject']:\n return None\n msg['subject'] += ' (no Spam)'\n return msg\n\nimb.download_all_messages(msg_filter=my_filter)\n```\n\n## Background\n\nThis package is based on a script by [Rui Carmo](https://github.com/rcarmo/imapbackup). Original description: \n\n> This was first published around 2007 (probably earlier) [on my personal site][tao], and it was originally developed to work around the then rather limited (ok, inconsistent) Mac OS X Mail.app functionality and allow me to back up my old mailboxes in a fully standard `mbox` format (well, at least as much as `mbox` can be considered a standard...).\n\n> Somewhat to my surprise it was considered useful by quite a few people throughout the years, and contributions started coming in. Given that there seems to be renewed interest in this as a systems administration tool, I'm posting the source code here and re-licensing it under the MIT license.\n\n## Features\n\n### Inherited from `imapbackup`\n\n* ZERO dependencies.\n* Copies every single message from every single folder (or a subset of folders) in your IMAP server to your disk.\n* Does _incremental_ copying (i.e., tries very hard to not copy messages twice).\n* Tries to do everything as safely as possible (only performs read operations on IMAP).\n* Is completely and utterly free (distributed under the MIT license).\n\n### New features\n\n* Python 3 compatible\n* Supports mbox or Maildir formats\n* Can be imported and used as library\n* When used as a library, messages can be filtered or modified on the fly\n\n## Requirements\n\nThis package requires Python 3.6.\n\n[tao]: http://taoofmac.com/space/projects/imapbackup", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DavidMStraub/imapbackup3", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "imapbackup3", "package_url": "https://pypi.org/project/imapbackup3/", "platform": "", "project_url": "https://pypi.org/project/imapbackup3/", "project_urls": { "Homepage": "https://github.com/DavidMStraub/imapbackup3" }, "release_url": "https://pypi.org/project/imapbackup3/0.2.1.1/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.2.1.1" }, "last_serial": 5995167, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "dbc0b63878bd567b98ef950b0f4fa39e", "sha256": "4b63d1c8df5b78607f7571615f9902dbf75bd08b143de966ab9521863843fbdf" }, "downloads": -1, "filename": "imapbackup3-0.1.tar.gz", "has_sig": false, "md5_digest": "dbc0b63878bd567b98ef950b0f4fa39e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9575, "upload_time": "2019-10-12T09:33:48", "url": "https://files.pythonhosted.org/packages/6b/46/0e2aaaa9b95b9b850f5d690e80a3024a6488259379d167edda345a4564cd/imapbackup3-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "51bffa934f00068499f8cd9aff5bffd6", "sha256": "dfbb8554b2a1679bc852a43468bbfe596847e0de7dfe6cf3f2e61bad908d4ad2" }, "downloads": -1, "filename": "imapbackup3-0.2.tar.gz", "has_sig": false, "md5_digest": "51bffa934f00068499f8cd9aff5bffd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10258, "upload_time": "2019-10-13T19:27:08", "url": "https://files.pythonhosted.org/packages/8d/31/63e19e3f0fd7b3fd32faee22f92d01be3b77b23626b92c991e1986b61210/imapbackup3-0.2.tar.gz" } ], "0.2.1.1": [ { "comment_text": "", "digests": { "md5": "72fdcb02c0d3cf5f3b0b6d43ca5ae6d5", "sha256": "fe1b936d51f57d037e4b9bebdbf1bb4026962adb56c536ede4c6645e9cc7b6bd" }, "downloads": -1, "filename": "imapbackup3-0.2.1.1.tar.gz", "has_sig": false, "md5_digest": "72fdcb02c0d3cf5f3b0b6d43ca5ae6d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10305, "upload_time": "2019-10-18T11:33:09", "url": "https://files.pythonhosted.org/packages/75/e9/099bb265ff033ea35782a03e878c4e28d3566604108c16cc9d92a9224538/imapbackup3-0.2.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "72fdcb02c0d3cf5f3b0b6d43ca5ae6d5", "sha256": "fe1b936d51f57d037e4b9bebdbf1bb4026962adb56c536ede4c6645e9cc7b6bd" }, "downloads": -1, "filename": "imapbackup3-0.2.1.1.tar.gz", "has_sig": false, "md5_digest": "72fdcb02c0d3cf5f3b0b6d43ca5ae6d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10305, "upload_time": "2019-10-18T11:33:09", "url": "https://files.pythonhosted.org/packages/75/e9/099bb265ff033ea35782a03e878c4e28d3566604108c16cc9d92a9224538/imapbackup3-0.2.1.1.tar.gz" } ] }