{ "info": { "author": "Gary Marigliano", "author_email": "gary-pypi@marigliano.ch", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "# p3mail - Send terminal outputs by mail\np3mail (Pathetic Python Pipe Mail) allows you to send terminal outputs by mail\n\nBasically something like this\n\n``` bash\n./long_running_command_printing_logs | p3mail \"My mail's subject\"\n```\n\nSince it is highly probable that you are both the sender and receiver, these latter are\npre-defined in a config file (see below).\n\n**Important note** Remember that only stdout is captured when using pipes. You may want\nto redirect stderr to stdout to also catch errors. For example\n``` bash\n./my_command_printing_errors 2>&1 | p3mail \"My mail's subject\"\n```\nNote: the order of stdout and stderr outputs is not preserved :( See: https://hisham.hm/2016/11/24/fun-hack-to-redirect-stdout-and-stderr-in-order/\n\n## Install\n\n```\npip install p3mail\n```\n\n## Usage\n\n### Using `config` file\n\nCopy the `config_example` file to `$HOME/.config/p3mail/config` and start using p3mail !\nSee the examples below.\n\n### Using command line\n```\nusage: p3mail [-h] [--to TO] [--from DEST] [--config CONFIG] subject\n\npositional arguments:\n subject The subject of the mail\n\noptional arguments:\n -h, --help show this help message and exit\n --to TO The receiver's address. If not provided, it will look at\n the config file\n --from DEST The sender's address. If not provided, it will look at the\n config file\n --config CONFIG Specify a custom location for the config file\n```\n\n## Examples\n\n### Send backup logs by mail\n``` bash\nmy_backup_program | p3mail \"Backup for `hostname` on `date`\"\n```\n\n### Cronjob notification\nIf your cron job is ran by `root` p3mail will look at `/home/root/.config/p3mail/config`\nwhich is not something you might want. You can specify the `config` file location with:\n``` bash\necho \"Hello msg body\" | p3mail --config /home/alice/.config/p3mail/config \"My subject\"\n```\n\nTip: you can put an alias in your `.bashrc` to avoid specifying this file everytime\nlike this:\n```\np3mail=\"p3mail --config /home/alice/.config/p3mail/config\"\n```\n\n## Motivation\n\nI coded this application because it is always painful (at least for me) to make\nthe built-in mail service work (or whatever it is called on Linux distributions).\nHere are some other reasons:\n\n 1. You don't always have the rights to configure this mail service (e.g. on\n a remote server)\n 2. `sendmail`, `mail` or other mail sender command line tools are not\n always installed or configured on the machines you are using\n 3. p3mail only requires that Python 3 is installed\n 4. p3mail does not requires sudo rights\n 5. p3mail needs a reason to live\n\n## Security concerns\n\nYou may not want to hardcode your smtp user or your smtp password in a config file. I understand that so p3mail allows you to read your credentials from environment variables.\n\n1. In your `config` set as an empty value for either/both `SmtpUser`/`SmtpPass` e.g. `SmtpPass = `\n2. Then call `p3mail` like this:\n```bash\nexport SMTP_USER=alice\nexport SMTP_PASS=super_secr3t_passw0rd\n\n./my_verbose_script | p3mail \"Verbose script report\"\n```\n\n# TODO\n\n* Add Gmail oauth support\n\n\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/krypty/p3mail", "keywords": "mail pipe stdin", "license": "", "maintainer": "", "maintainer_email": "", "name": "p3mail", "package_url": "https://pypi.org/project/p3mail/", "platform": "", "project_url": "https://pypi.org/project/p3mail/", "project_urls": { "Homepage": "https://github.com/krypty/p3mail" }, "release_url": "https://pypi.org/project/p3mail/0.1.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "a Pathetic Python Pipe Mail sender to send terminal outputs by mail", "version": "0.1.1" }, "last_serial": 4011081, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7d60cd4d690a54d29bb85a1417f926fd", "sha256": "f9c68576971dfc38872d50417fb0006af20cae1dbe76d230737872518b9cf808" }, "downloads": -1, "filename": "p3mail-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d60cd4d690a54d29bb85a1417f926fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16440, "upload_time": "2018-06-28T11:56:52", "url": "https://files.pythonhosted.org/packages/23/ff/547cc7bcb1285fab7e73a78bf0a7c9c582e541ff1a8cd9c8b573b184ea1e/p3mail-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "193dc70672f435d7d886df411056edf3", "sha256": "c95f653fbd9eb682f1b9bb63692e1679a8213dbc76b195a4e9e5e372ef76b62a" }, "downloads": -1, "filename": "p3mail-0.1.tar.gz", "has_sig": false, "md5_digest": "193dc70672f435d7d886df411056edf3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3797, "upload_time": "2018-06-28T11:56:53", "url": "https://files.pythonhosted.org/packages/c0/e5/e903f6142db98bc52cc7265a3a256ad542462d0b40224e51da7dc82ac7a4/p3mail-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "bae5dd1ff8bce48e92157dd0b9af503f", "sha256": "ca7989561583e2ef4e75c646744a4f795f7e0a5e4c8c11fe593b765508af9fde" }, "downloads": -1, "filename": "p3mail-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bae5dd1ff8bce48e92157dd0b9af503f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 16477, "upload_time": "2018-06-28T11:59:11", "url": "https://files.pythonhosted.org/packages/7b/d7/57e285a2f935516b4a63d0bd223b8746f768b88aae12b1695fbdf5ff58ca/p3mail-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a88485a6297c73efb76ae1be4dc3dff", "sha256": "d2787cf6776235cba0a9f058047ac766b9855c5a3ce13f3f920dd0a7cac15a3d" }, "downloads": -1, "filename": "p3mail-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4a88485a6297c73efb76ae1be4dc3dff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 3820, "upload_time": "2018-06-28T11:59:12", "url": "https://files.pythonhosted.org/packages/78/77/847030e3a287eee80e8c9a0302a53ec95374e8f058eb18df26587bb851c5/p3mail-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bae5dd1ff8bce48e92157dd0b9af503f", "sha256": "ca7989561583e2ef4e75c646744a4f795f7e0a5e4c8c11fe593b765508af9fde" }, "downloads": -1, "filename": "p3mail-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bae5dd1ff8bce48e92157dd0b9af503f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 16477, "upload_time": "2018-06-28T11:59:11", "url": "https://files.pythonhosted.org/packages/7b/d7/57e285a2f935516b4a63d0bd223b8746f768b88aae12b1695fbdf5ff58ca/p3mail-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a88485a6297c73efb76ae1be4dc3dff", "sha256": "d2787cf6776235cba0a9f058047ac766b9855c5a3ce13f3f920dd0a7cac15a3d" }, "downloads": -1, "filename": "p3mail-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4a88485a6297c73efb76ae1be4dc3dff", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 3820, "upload_time": "2018-06-28T11:59:12", "url": "https://files.pythonhosted.org/packages/78/77/847030e3a287eee80e8c9a0302a53ec95374e8f058eb18df26587bb851c5/p3mail-0.1.1.tar.gz" } ] }