gmailnudge


Namegmailnudge JSON
Version 2.1.1 PyPI version JSON
download
home_page
SummaryNudge GMail so that it will frequently fetch new emails from another service
upload_time2024-01-17 17:01:27
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License Copyright (c) 2023 Chris Nelson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gmailnudge - Nudge GMail so that it will frequently fetch new emails from another service

I use GMail as my email UI, but publicly use non-GMail email addresses from my own domain.  How frequently GMail fetches any new messages from my server depends on 
how frequently GMail _finds_ new messages to fetch.  If you only receive a few messages per day then GMail may not check but every hour... a useless lag in getting
new messages.

The known-fix is to regularly send dummy messages to your server so that GMail frequently finds new messages and thus will frequently check for new messages. (Also set up a filter
on the GMail side to delete messages with the given subject.)

The lag for messages from my server, using this tool, is no more that five minutes.  When you need a message immediately you can also open the GMail _Settings_ > _Account and Import_ page and force a "Check mail now".

**gmailnudge in service mode** is configured to periodically send emails to your server for GMail to pick up.  
- All settings are set in the config file, and a systemd service file is also provided.  
- The config file may be modified while in use and is automatically reloaded if changed by the running service.
- Logging goes to the config dir by default.

**gmailnudge also provides a `sndemail` command line interface** for conveniently sending general messages and files.
- Simple distribution list "aliases" may be defined in the config file for use with the `--to` CLI switch.
- The body of the message may be some inline text, a text file, or a html formatted file.  File references may use an absolute path, or are taken as 
relative to the shell current working directory.

Supported on Python3.6+ on Linux and Windows.

**NOTE:**  Due to as-of-yet unsolved problems with Python 3.6 and import_resources, the `--setup-user` and `--setup-site` switches are not working on Py 3.6.  Manually grab the files from the [github](https://github.com/cjnaz/XXXX) `src/deployment_files directory` and place them in the `~\.config\XXXX` directory.  These command line switches work correctly on Python 3.7+.

<br/>

---

## Notable changes since prior release
V2.1 - Adjusted for cjnfuncs V2.1 (module partitioning).
SMTP params must be in the [SMTP] config file section.

<br/>

---

## Usage
```
$ sndemail -h
usage: sndemail [-h] [--to TO] [--subject SUBJECT] [--message MESSAGE] [--file FILE] [--htmlfile HTMLFILE] [--service] [--config-file CONFIG_FILE]
                 [--print-log] [--setup-user] [--setup-site] [-V]

gmailnudge
Send frequent emails to personal server to be picked up by GMail, thus causing GMail to check more often for new mail.
Also serves as a general purpose command line email sender.
2.1

options:
  -h, --help            show this help message and exit
  --to TO, -t TO        A single email address (contains an '@') or a config param ([SMTP] section) with a whitespace-separated-list of email addresses
  --subject SUBJECT, -s SUBJECT
                        Subject text
  --message MESSAGE, -m MESSAGE
                        Body text (--message wins over --file or --htmlfile)
  --file FILE, -f FILE  Plain-test file to be sent (--file wins over --htmlfile)
  --htmlfile HTMLFILE, -F HTMLFILE
                        HTML formatted file to be sent
  --service             Send emails in an endless loop for use as a systemd service
  --config-file CONFIG_FILE, -c CONFIG_FILE
                        Path to the config file (Default <gmailnudge.cfg>)
  --print-log, -p       Print the tail end of the log file (default last 40 lines).
  --setup-user          Install starter files in user space.
  --setup-site          Install starter files in system-wide space. Run with root prev.
  -V, --version         Return version number and exit

```

<br/>

---

## Example CLI usage
```
$ sndemail --to family --subject "Here's the support log" --file transcript.txt
     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========
     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>
       cjnfuncs.snd_email            -  WARNING:  Email sent <Here's the support log>

$ sndemail --to mygmail --subject "Here's that report" --htmlfile Report_221127.html 
     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========
     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>
       cjnfuncs.snd_email            -  WARNING:  Email sent <Here's that report>

```


<br/>

---

## Example service mode logfile output
Nudge messages sent every 5 minutes. Logging level changed from INFO to WARNING while running:
```
$ sndemail -p
     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========
     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>
Tail of  </path-to/log_gmailnudge.txt>:
2023-03-19 13:29:00,908      gmailnudge.cli                   WARNING:  ========== gmailnudge (2.1) ==========
2023-03-19 13:29:00,908      gmailnudge.cli                   WARNING:  Config file </path-to/gmailnudge.cfg>
2023-03-19 13:29:02,262      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com
2023-03-19 13:34:02,605      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com
2023-03-19 13:39:02,447      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com
2023-03-19 13:42:41,079      gmailnudge.service               WARNING:  NOTE - The config file has been reloaded.
2023-03-19 15:28:18,650      gmailnudge.int_handler           WARNING:  Signal 2 received.  Exiting.
2023-03-19 15:28:18,651      gmailnudge.cleanup               WARNING:  Cleanup
```

<br/>

---

## Setup and Usage notes
- Install gmailnudge from PyPI (pip install gmailnudge).
- Install the initial configuration files (`sndemail --setup-user` places files at ~/.config/gmailnudge).
- Edit/configure `gmailnudge.cfg` and `creds_SMTP` as needed.
- Run manually as `sndemail`, or install the systemd service.
- When running in service mode (continuously looping) the config file may be edited and is reloaded when changed.  This allows for changing settings without having to restart the service.


<br/>

---

## Customization notes
- You may create whatever distribution list _aliases_ you wish for use with the CLI `--to` switch (see **Example CLI usage**, above).  

        family              email1@xyz.com  email2@gmail.com  email3@yahoo.com

<br/>

---

## Version history
- 2.1.1 240117 - service mode bug
- 2.1 240104 - Adjusted for cjnfuncs 2.1
- 2.0 230319 - New

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gmailnudge",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Chris Nelson <github@cjnaz.com>",
    "download_url": "https://files.pythonhosted.org/packages/c0/f2/8ebaa91d105b61c0aa53aa35fe31174be85b0d3583c2d70c5eb3ee65312d/gmailnudge-2.1.1.tar.gz",
    "platform": null,
    "description": "# gmailnudge - Nudge GMail so that it will frequently fetch new emails from another service\n\nI use GMail as my email UI, but publicly use non-GMail email addresses from my own domain.  How frequently GMail fetches any new messages from my server depends on \nhow frequently GMail _finds_ new messages to fetch.  If you only receive a few messages per day then GMail may not check but every hour... a useless lag in getting\nnew messages.\n\nThe known-fix is to regularly send dummy messages to your server so that GMail frequently finds new messages and thus will frequently check for new messages. (Also set up a filter\non the GMail side to delete messages with the given subject.)\n\nThe lag for messages from my server, using this tool, is no more that five minutes.  When you need a message immediately you can also open the GMail _Settings_ > _Account and Import_ page and force a \"Check mail now\".\n\n**gmailnudge in service mode** is configured to periodically send emails to your server for GMail to pick up.  \n- All settings are set in the config file, and a systemd service file is also provided.  \n- The config file may be modified while in use and is automatically reloaded if changed by the running service.\n- Logging goes to the config dir by default.\n\n**gmailnudge also provides a `sndemail` command line interface** for conveniently sending general messages and files.\n- Simple distribution list \"aliases\" may be defined in the config file for use with the `--to` CLI switch.\n- The body of the message may be some inline text, a text file, or a html formatted file.  File references may use an absolute path, or are taken as \nrelative to the shell current working directory.\n\nSupported on Python3.6+ on Linux and Windows.\n\n**NOTE:**  Due to as-of-yet unsolved problems with Python 3.6 and import_resources, the `--setup-user` and `--setup-site` switches are not working on Py 3.6.  Manually grab the files from the [github](https://github.com/cjnaz/XXXX) `src/deployment_files directory` and place them in the `~\\.config\\XXXX` directory.  These command line switches work correctly on Python 3.7+.\n\n<br/>\n\n---\n\n## Notable changes since prior release\nV2.1 - Adjusted for cjnfuncs V2.1 (module partitioning).\nSMTP params must be in the [SMTP] config file section.\n\n<br/>\n\n---\n\n## Usage\n```\n$ sndemail -h\nusage: sndemail [-h] [--to TO] [--subject SUBJECT] [--message MESSAGE] [--file FILE] [--htmlfile HTMLFILE] [--service] [--config-file CONFIG_FILE]\n                 [--print-log] [--setup-user] [--setup-site] [-V]\n\ngmailnudge\nSend frequent emails to personal server to be picked up by GMail, thus causing GMail to check more often for new mail.\nAlso serves as a general purpose command line email sender.\n2.1\n\noptions:\n  -h, --help            show this help message and exit\n  --to TO, -t TO        A single email address (contains an '@') or a config param ([SMTP] section) with a whitespace-separated-list of email addresses\n  --subject SUBJECT, -s SUBJECT\n                        Subject text\n  --message MESSAGE, -m MESSAGE\n                        Body text (--message wins over --file or --htmlfile)\n  --file FILE, -f FILE  Plain-test file to be sent (--file wins over --htmlfile)\n  --htmlfile HTMLFILE, -F HTMLFILE\n                        HTML formatted file to be sent\n  --service             Send emails in an endless loop for use as a systemd service\n  --config-file CONFIG_FILE, -c CONFIG_FILE\n                        Path to the config file (Default <gmailnudge.cfg>)\n  --print-log, -p       Print the tail end of the log file (default last 40 lines).\n  --setup-user          Install starter files in user space.\n  --setup-site          Install starter files in system-wide space. Run with root prev.\n  -V, --version         Return version number and exit\n\n```\n\n<br/>\n\n---\n\n## Example CLI usage\n```\n$ sndemail --to family --subject \"Here's the support log\" --file transcript.txt\n     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========\n     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>\n       cjnfuncs.snd_email            -  WARNING:  Email sent <Here's the support log>\n\n$ sndemail --to mygmail --subject \"Here's that report\" --htmlfile Report_221127.html \n     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========\n     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>\n       cjnfuncs.snd_email            -  WARNING:  Email sent <Here's that report>\n\n```\n\n\n<br/>\n\n---\n\n## Example service mode logfile output\nNudge messages sent every 5 minutes. Logging level changed from INFO to WARNING while running:\n```\n$ sndemail -p\n     gmailnudge.cli                  -  WARNING:  ========== gmailnudge (2.1) ==========\n     gmailnudge.cli                  -  WARNING:  Config file </path-to/gmailnudge.cfg>\nTail of  </path-to/log_gmailnudge.txt>:\n2023-03-19 13:29:00,908      gmailnudge.cli                   WARNING:  ========== gmailnudge (2.1) ==========\n2023-03-19 13:29:00,908      gmailnudge.cli                   WARNING:  Config file </path-to/gmailnudge.cfg>\n2023-03-19 13:29:02,262      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com\n2023-03-19 13:34:02,605      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com\n2023-03-19 13:39:02,447      gmailnudge.service                  INFO:  Nudge message sent to me@myserver.com\n2023-03-19 13:42:41,079      gmailnudge.service               WARNING:  NOTE - The config file has been reloaded.\n2023-03-19 15:28:18,650      gmailnudge.int_handler           WARNING:  Signal 2 received.  Exiting.\n2023-03-19 15:28:18,651      gmailnudge.cleanup               WARNING:  Cleanup\n```\n\n<br/>\n\n---\n\n## Setup and Usage notes\n- Install gmailnudge from PyPI (pip install gmailnudge).\n- Install the initial configuration files (`sndemail --setup-user` places files at ~/.config/gmailnudge).\n- Edit/configure `gmailnudge.cfg` and `creds_SMTP` as needed.\n- Run manually as `sndemail`, or install the systemd service.\n- When running in service mode (continuously looping) the config file may be edited and is reloaded when changed.  This allows for changing settings without having to restart the service.\n\n\n<br/>\n\n---\n\n## Customization notes\n- You may create whatever distribution list _aliases_ you wish for use with the CLI `--to` switch (see **Example CLI usage**, above).  \n\n        family              email1@xyz.com  email2@gmail.com  email3@yahoo.com\n\n<br/>\n\n---\n\n## Version history\n- 2.1.1 240117 - service mode bug\n- 2.1 240104 - Adjusted for cjnfuncs 2.1\n- 2.0 230319 - New\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Chris Nelson  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Nudge GMail so that it will frequently fetch new emails from another service",
    "version": "2.1.1",
    "project_urls": {
        "repository": "https://github.com/cjnaz/gmailnudge"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6cde4b1f96d881897c17a3e363fd69341db5d688195d410fe91bce877ed2b6a",
                "md5": "bd0a450937b8caaf710052e34805497d",
                "sha256": "fbae0971691e9b6e5654a979b863f1e545b797fbd81161a2396cfa594324ecb9"
            },
            "downloads": -1,
            "filename": "gmailnudge-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd0a450937b8caaf710052e34805497d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9443,
            "upload_time": "2024-01-17T17:01:24",
            "upload_time_iso_8601": "2024-01-17T17:01:24.504123Z",
            "url": "https://files.pythonhosted.org/packages/d6/cd/e4b1f96d881897c17a3e363fd69341db5d688195d410fe91bce877ed2b6a/gmailnudge-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0f28ebaa91d105b61c0aa53aa35fe31174be85b0d3583c2d70c5eb3ee65312d",
                "md5": "f004e3a304955436e306a678628be3c3",
                "sha256": "fe2a34bb43b5b436e0eedbfca56ea4105460d24d88cc58c471697e558dba6877"
            },
            "downloads": -1,
            "filename": "gmailnudge-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f004e3a304955436e306a678628be3c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10610,
            "upload_time": "2024-01-17T17:01:27",
            "upload_time_iso_8601": "2024-01-17T17:01:27.900323Z",
            "url": "https://files.pythonhosted.org/packages/c0/f2/8ebaa91d105b61c0aa53aa35fe31174be85b0d3583c2d70c5eb3ee65312d/gmailnudge-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 17:01:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cjnaz",
    "github_project": "gmailnudge",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gmailnudge"
}
        
Elapsed time: 0.21529s