Skip to main content

Remote service trigger with mail

Project description

Mail Trigger

PyPI Travis Coverage License

Requirements

  • Python (3.7+)
  • pip
  • python-dev

Installation

On Ubuntu / Mint, install Mail Trigger with the following commands:

sudo apt update
sudo apt install python3-dev python3-pip python3-setuptools
sudo pip install mailtrigger

On OS X, install Mail Trigger via Homebrew (or via Linuxbrew on Linux):

TBD

On Windows, install Mail Trigger with the following commands:

pip install -U pywin32
pip install -U PyInstaller
pip install -Ur requirements.txt

pyinstaller --clean --name mailtrigger -F trigger.py

Updating

pip install mailtrigger --upgrade

Running

mailtrigger --mailer-config mailer.json --scheduler-config scheduler.json --trigger-config trigger.json

Settings

Mail Trigger parameters can be set in the directory config.

An example of configuration in mailer.json:

{
  "pop3": {
    "host": "pop.example.com",
    "pass": "pass",
    "port": 995,
    "ssl": true,
    "timeout": 10,
    "user": "user"
  },
  "smtp": {
    "host": "smtp.example.com",
    "pass": "pass",
    "port": 465,
    "ssl": true,
    "timeout": 10,
    "user": "user"
  }
}

An example of configuration in scheduler.json:

{
  "interval": 30
}

An example of configuration in trigger.json:

{
  "gerrit": {
    "filter": [
      {
        "from": "name@example.com",
        "subject": "[trigger]"
      }
    ],
    "server": [
      {
        "host": "localhost",
        "pass": "pass",
        "port": 8080,
        "user": "user"
      }
    ]
  },
  "helper": {
    "filter": [
      {
        "from": "name@example.com",
        "subject": "[trigger]"
      }
    ]
  },
  "jenkins": {
    "filter": [
      {
        "from": "name@example.com",
        "subject": "[trigger]"
      }
    ],
    "server": [
      {
        "host": "localhost",
        "pass": "pass",
        "port": 8081,
        "user": "user"
      }
    ]
  },
  "jira": {
    "filter": [
      {
        "from": "name@example.com",
        "subject": "[trigger]"
      }
    ],
    "server": [
      {
        "host": "localhost",
        "pass": "pass",
        "port": 8082,
        "user": "user"
      }
    ]
  },
  "printer": {
    "file": "output.xlsx",
    "filter": [
      {
        "from": "name@example.com",
        "subject": ""
      }
    ]
  }
}

Usage

Subject

[trigger]: Write your description here

Note: [trigger] is the reserved word in subject

Recipient

The recipient is mail receiver as Mail Trigger.

Content

Gerrit Trigger

@gerrit help
@gerrit list
@gerrit restart <host>
@gerrit start <host>
@gerrit stop <host>
@gerrit abandon <host> <commit|changenumber,patchset>
@gerrit restore <host> <commit|changenumber,patchset>
@gerrit review <host> <commit|changenumber,patchset>
@gerrit submit <host> <commit|changenumber,patchset>
@gerrit version <host>

Jenkins Trigger

TBD

Jira Trigger

TBD

Trigger Help

@help

License Apache

Project License can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailtrigger-3.0.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

mailtrigger-3.0.0-py2.py3-none-any.whl (19.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mailtrigger-3.0.0.tar.gz.

File metadata

  • Download URL: mailtrigger-3.0.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for mailtrigger-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0ac1ce768cac7376d276f26e85c996e2392ee60704c2fa3c607dcfa7260d7e53
MD5 2d5d78eb8840256fd8d3b053124a7496
BLAKE2b-256 a4c326e5ba0556450d61e8bb757a17e391fb3451bf1b13b8a36ae7d9b2b8bdcf

See more details on using hashes here.

File details

Details for the file mailtrigger-3.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mailtrigger-3.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for mailtrigger-3.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c660e8b0a2cfe414426cdfebae27b9316399940c9d5d9337fe6c6888524870dc
MD5 68445e64c72eecaf5a39758abfd15d8d
BLAKE2b-256 aab4064e0f2e1fd57f01fe032fc84a71e32744173f93a0df87bd292ac80103dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page