Go to file
Igor Ajdišek f5a7199254 Support email notification without SMTP auth.
Even if .drone.yml does not specify username and password,
gomail.NewPlainDialer is still populated with them - albeit empty -
which means they are still being sent to SMTP server. In case of
Google's smtp-relay.gmail.com this will result in an error, even
if CI's server IP address is added to exclusion list allowing it to
skip auth entirely.

This commit constructs gomail.Dialer without username and password
if there was no username found in .drone.yml.

* Constructs gomail.Dialer without username when no username in .drone.yml
* Replaces gomail.NewPlainDialer with gomail.NewDialer
2016-04-22 13:55:28 +02:00
.drone.sec Unification: Drone config, Makefile, structure and badges 2016-01-26 13:00:13 +01:00
.drone.yml Unification: Drone config, Makefile, structure and badges 2016-01-26 13:00:13 +01:00
.gitignore Updated gitignore to respect also coverage.out 2016-02-21 11:38:17 +01:00
Dockerfile Added make task for building docker container 2015-12-15 00:48:25 +01:00
DOCS.md Integrated skip verify, gomail and templates 2016-02-01 12:55:41 +01:00
LICENSE Removed empty lines 2015-12-11 10:40:37 +01:00
logo.svg initial commit. compiles but hasn't been tested. needs docs too 2015-10-26 15:31:42 -07:00
main.go Make the builds reproducable based on commit sha 2016-02-21 11:06:40 +01:00
MAINTAINERS Updated maintainers file, added names and athieriot 2016-02-21 11:20:00 +01:00
Makefile Make the builds reproducable based on commit sha 2016-02-21 11:06:40 +01:00
README.md Reference to DOCS.md from README.md for usage information 2016-02-26 00:00:29 +01:00
sender.go Support email notification without SMTP auth. 2016-04-22 13:55:28 +02:00
template.go Integrated skip verify, gomail and templates 2016-02-01 12:55:41 +01:00
types.go Integrated skip verify, gomail and templates 2016-02-01 12:55:41 +01:00

drone-email

Build Status Coverage Status

Drone plugin to send build status notifications via Email. For the usage information and a listing of the available options please take a look at the docs.

Binary

Build the binary using make:

make deps build

Example

./drone-email <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "number": 22,
        "status": "success",
        "started_at": 1421029603,
        "finished_at": 1421029813,
        "message": "Update the Readme",
        "author": "johnsmith",
        "author_email": "john.smith@gmail.com",
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/drone/drone"
    },
    "vargs": {
        "from": "noreply@foo.com",
        "host": "smtp.mailgun.org",
        "port": 587,
        "username": "",
        "password": "",
        "recipients": [
            "octocat@github.com"
        ]
    }
}
EOF

Docker

Build the container using make:

make deps docker

Example

docker run -i plugins/drone-email <<EOF
{
    "repo": {
        "clone_url": "git://github.com/drone/drone",
        "owner": "drone",
        "name": "drone",
        "full_name": "drone/drone"
    },
    "system": {
        "link_url": "https://beta.drone.io"
    },
    "build": {
        "number": 22,
        "status": "success",
        "started_at": 1421029603,
        "finished_at": 1421029813,
        "message": "Update the Readme",
        "author": "johnsmith",
        "author_email": "john.smith@gmail.com"
        "event": "push",
        "branch": "master",
        "commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
        "ref": "refs/heads/master"
    },
    "workspace": {
        "root": "/drone/src",
        "path": "/drone/src/github.com/drone/drone"
    },
    "vargs": {
        "from": "noreply@foo.com",
        "host": "smtp.mailgun.org",
        "port": 587,
        "username": "",
        "password": "",
        "recipients": [
            "octocat@github.com"
        ]
    }
}
EOF