{ "info": { "author": "wevsty", "author_email": "ty@wevs.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Communications :: Email :: Filters", "Topic :: Software Development :: Libraries" ], "description": "# spamclib\n\n------\n\nA SPAMC protocol library.Help you use SpamAssassin's SPAMD service.\n\n# Feature support\n> * Support sync client.\n> * Support async client.\n> * Support TLS.\n\n# Install\npip install spamclib\n\n# Example\n---\n## Sync client\n```Python\n#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nfrom spamclib.spamc_sync_client import SyncSpamcClient\n\nGTUBE = '''\nSubject: Test spam mail (GTUBE)\nMessage-ID: \nDate: Wed, 23 Jul 2003 23:30:00 +0200\nFrom: Sender \nTo: Recipient \nPrecedence: junk\nMIME-Version: 1.0\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\nThis is the GTUBE, the\n\tGeneric\n\tTest for\n\tUnsolicited\n\tBulk\n\tEmail\n\nIf your spam filter supports it, the GTUBE provides a test by which you\ncan verify that the filter is installed correctly and is detecting incoming\nspam. You can send yourself a test mail containing the following string of\ncharacters (in upper case and with no white spaces and line breaks):\n\nXJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X\n\nYou should send this test mail from an account outside of your network.\n\n'''\n\nif __name__ == '__main__':\n sc = SyncSpamcClient()\n # ping cannot support SpamAssassinForWindows\n sc.command_ping()\n sc.command_skip()\n res = sc.command_check(GTUBE.encode('utf-8'))\n print(res)\n print('Status code : %d' % res.status_code)\n print('Status message : %s' % res.status_message.decode('utf-8'))\n print('Header item Spam : %s' % res.get_header(b'Spam').decode('utf-8'))\n print('Response body : %s' % res.body.decode('utf-8'))\n sc.command_headers(GTUBE.encode('utf-8'))\n sc.command_process(GTUBE.encode('utf-8'))\n sc.command_report(GTUBE.encode('utf-8'))\n sc.command_report_ifspam(GTUBE.encode('utf-8'))\n sc.command_symbols(GTUBE.encode('utf-8'))\n pass\n\n```\n---\n## Async client\n```Python\n#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nimport asyncio\nfrom spamclib.spamc_async_client import AsyncSpamcClient\n\nGTUBE = '''\nSubject: Test spam mail (GTUBE)\nMessage-ID: \nDate: Wed, 23 Jul 2003 23:30:00 +0200\nFrom: Sender \nTo: Recipient \nPrecedence: junk\nMIME-Version: 1.0\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\nThis is the GTUBE, the\n\tGeneric\n\tTest for\n\tUnsolicited\n\tBulk\n\tEmail\n\nIf your spam filter supports it, the GTUBE provides a test by which you\ncan verify that the filter is installed correctly and is detecting incoming\nspam. You can send yourself a test mail containing the following string of\ncharacters (in upper case and with no white spaces and line breaks):\n\nXJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X\n\nYou should send this test mail from an account outside of your network.\n\n'''\nbytes_GTUBE = GTUBE.encode('utf-8')\nif __name__ == '__main__':\n loop = asyncio.get_event_loop()\n sc = AsyncSpamcClient(loop=loop)\n # ping cannot support SpamAssassinForWindows\n loop.run_until_complete(sc.command_ping())\n loop.run_until_complete(sc.command_skip())\n res = loop.run_until_complete(sc.command_check(bytes_GTUBE))\n print(res)\n print('Status code : %d' % res.status_code)\n print('Status message : %s' % res.status_message.decode('utf-8'))\n print('Header item Spam : %s' % res.get_header(b'Spam').decode('utf-8'))\n print('Response body : %s' % res.body.decode('utf-8'))\n loop.run_until_complete(sc.command_headers(bytes_GTUBE))\n loop.run_until_complete(sc.command_process(bytes_GTUBE))\n loop.run_until_complete(sc.command_report(bytes_GTUBE))\n loop.run_until_complete(sc.command_report_ifspam(bytes_GTUBE))\n loop.run_until_complete(sc.command_symbols(bytes_GTUBE))\n pass\n\n\n\n```\n---\n# License\nMIT License\n\n# Thanks\nPart of the project reference [aiospamc](https://github.com/mjcaley/aiospamc)\nThanks mjcaley\n\n", "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/wevsty/spamclib", "keywords": "spam spamc spamd spamassassin", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "spamclib", "package_url": "https://pypi.org/project/spamclib/", "platform": "", "project_url": "https://pypi.org/project/spamclib/", "project_urls": { "Homepage": "https://github.com/wevsty/spamclib" }, "release_url": "https://pypi.org/project/spamclib/0.0.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A SPAMC protocol library.Help you use SpamAssassin's SPAMD service.", "version": "0.0.3" }, "last_serial": 4711337, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "acdfcefb333ad00c978775213eda69bb", "sha256": "5ba86be8343611fb9076bb73c23da08b2a404e401554ec90f814c8cd7bf4443b" }, "downloads": -1, "filename": "spamclib-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "acdfcefb333ad00c978775213eda69bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10523, "upload_time": "2019-01-18T08:50:00", "url": "https://files.pythonhosted.org/packages/78/b5/d07187a7913989e6147b2cfdd7d58d03fe209954bd091ca895facb2a7642/spamclib-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c29a6740ac5fb488a76426e7094423ef", "sha256": "9387014856139767b88d8228dad12ecf1bbf23cd4d867a6f500defc3c27111f4" }, "downloads": -1, "filename": "spamclib-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c29a6740ac5fb488a76426e7094423ef", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8015, "upload_time": "2019-01-18T08:50:02", "url": "https://files.pythonhosted.org/packages/5d/3b/6d69f659cdb5e66db2fa79a52bbfa388557f45f99e9027b994de28ed51aa/spamclib-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "acdfcefb333ad00c978775213eda69bb", "sha256": "5ba86be8343611fb9076bb73c23da08b2a404e401554ec90f814c8cd7bf4443b" }, "downloads": -1, "filename": "spamclib-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "acdfcefb333ad00c978775213eda69bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10523, "upload_time": "2019-01-18T08:50:00", "url": "https://files.pythonhosted.org/packages/78/b5/d07187a7913989e6147b2cfdd7d58d03fe209954bd091ca895facb2a7642/spamclib-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c29a6740ac5fb488a76426e7094423ef", "sha256": "9387014856139767b88d8228dad12ecf1bbf23cd4d867a6f500defc3c27111f4" }, "downloads": -1, "filename": "spamclib-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c29a6740ac5fb488a76426e7094423ef", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8015, "upload_time": "2019-01-18T08:50:02", "url": "https://files.pythonhosted.org/packages/5d/3b/6d69f659cdb5e66db2fa79a52bbfa388557f45f99e9027b994de28ed51aa/spamclib-0.0.3.tar.gz" } ] }