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:

apt update
apt install python3-dev python3-pip python3-setuptools
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 --auther-config auther.json --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 auther.json:

{
  "group": {
    "default": [
      "name@example.com"
    ],
    "ldap/name": "true"
  },
  "message": {
    "subject": "[trigger]"
  },
  "provider": {
    "ldap": {
      "base": "base",
      "host": "localhost",
      "pass": "pass",
      "port": 389,
      "user": "user"
    }
  }
}

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": {
    "server": [
      {
        "host": "localhost",
        "pass": "pass",
        "port": 8080,
        "user": "user"
      }
    ]
  },
  "jenkins": {
    "server": [
      {
        "host": "localhost",
        "pass": "pass",
        "port": 8081,
        "user": "user"
      }
    ]
  },
  "printer": {
    "file": "output.xlsx",
  }
}

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 abandon <host> <changenumber>
@gerrit help
@gerrit list
@gerrit query <host> <changenumber>
@gerrit rebase <host> <changenumber>
@gerrit restart <host>
@gerrit restore <host> <changenumber>
@gerrit review <host> <changenumber>
@gerrit reviewer <host> <changenumber> [add|remove] <reviewer>
@gerrit start <host>
@gerrit stop <host>
@gerrit submit <host> <changenumber>
@gerrit version <host>

Jenkins 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-4.0.0.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

mailtrigger-4.0.0-py2.py3-none-any.whl (20.4 kB view hashes)

Uploaded Python 2 Python 3

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