{ "info": { "author": "Keith Gaughan", "author_email": "k@stereochro.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Communications :: Email :: Mail Transport Agents", "Topic :: Database" ], "description": "=============\nsocketmap-sql\n=============\n\nA socketmap script for interfacing with an SQL database.\n\nWhy?\n====\n\nI have a number of FreeBSD servers, with one intended to act as my primary\nmailserver (the current one and remaining one becoming secondary mailservers).\nThe problem is that I'm using postfix, and trying very hard to stick to\nprecompiled packages rather than using ports, and postfix on FreeBSD lacks\nbindings to databases. In my case, I wanted to be able to use an SQL database.\n\nConfiguration format\n====================\n\nConfiguration files are INI files containing two types of section.\n\nFirst is the ``[database]`` section, which gives database connection details.\nThe *driver* field specifies the driver to use; if omitted, its value defaults\nto *sqlite3*. The remaining fields are passed to the driver's ``connect()``\nfunction.\n\n::\n\n [database]\n driver = sqlite3\n database = /path/to/sqlite.db\n\nOther sections start wth ``table:``, and denote virtual tables to be queried.\nThere are two fields: *transform* (optional) and *query* (required).\n\nThe *transform* field gives the name of a transformation to apply to the query\nparameter before its use in the query the query. The default is to accept the\nparameter as-is (*all*). Other values can be a reference to a Python function\nin the form 'module:function', *local* for just the local part, *domain* for\nthe domain part of the address, and *split* breaks an email address in two.\nIt must return a list or tuple giving the postitional arguments to use in the\nquery.\n\nThe *query* field give an SQL query to be used to generate the synthetic table.\nUse placeholders as specified by the database driver's documentation.\n\nUsage\n=====\n\nRun with::\n\n socketmap-sql --config /path/to/config.ini\n\nIf you don't provide the *--config* flag, it defaults to\n``/etc/socketmap-sql.ini``.\n\nPostfix\n=======\n\nThis script is intended to be executed by Postfix's spawn_ mechanism, meaning\nit reads its input and writes its output to stdin and stdout respectively.\n\n.. _spawn: http://www.postfix.org/spawn.8.html\n\nAssuming you've installed the script in ``/usr/local/libexec``, add the\nfollowing to ``master.cf``::\n\n sockmapd unix - - n - 1 spawn\n user=nobody argv=/usr/local/libexec/socketmap-sql\n\nCompatibility\n=============\n\nThe script only works on Python 3.3+, though it can be made to work on Python\n2.7 with some moderate patching.\n\n.. vim:set ft=rst:\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kgaughan/socketmap-sql/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "socketmap-sql", "package_url": "https://pypi.org/project/socketmap-sql/", "platform": "", "project_url": "https://pypi.org/project/socketmap-sql/", "project_urls": { "Homepage": "https://github.com/kgaughan/socketmap-sql/" }, "release_url": "https://pypi.org/project/socketmap-sql/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A socketmap script for SQL databases", "version": "0.1.0" }, "last_serial": 3217226, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7de45f2d51b68017846d1d2509d981a0", "sha256": "e1896c52567ec1ffd25d643b5cd8025baec782a0a9ea5deb21e6e2e6759f19ae" }, "downloads": -1, "filename": "socketmap_sql-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7de45f2d51b68017846d1d2509d981a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6814, "upload_time": "2017-10-01T19:57:04", "url": "https://files.pythonhosted.org/packages/70/ad/b0171b23444ff5c9b9ff7f7c658b8e2f27777b8292719093dc987a6508ba/socketmap_sql-0.1.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7de45f2d51b68017846d1d2509d981a0", "sha256": "e1896c52567ec1ffd25d643b5cd8025baec782a0a9ea5deb21e6e2e6759f19ae" }, "downloads": -1, "filename": "socketmap_sql-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7de45f2d51b68017846d1d2509d981a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6814, "upload_time": "2017-10-01T19:57:04", "url": "https://files.pythonhosted.org/packages/70/ad/b0171b23444ff5c9b9ff7f7c658b8e2f27777b8292719093dc987a6508ba/socketmap_sql-0.1.0-py3-none-any.whl" } ] }