screwdriver-cd / screwdriver

An open source build platform designed for continuous delivery.
http://screwdriver.cd
Other
1.02k stars 169 forks source link

Email notifications for gmail #1259

Closed arunp7080 closed 6 years ago

arunp7080 commented 6 years ago

Notifications can be configured for slack and email, I am not sure if it is configurable for gmail accounts as there are no documents for that. General settings like below doesn't work for gmail.

notifications:
    email:
        host: smtp.yourhost.com
        port: 25
        from: example@email.com
tkyi commented 6 years ago

I haven't tried using Gmail, but nodemailer, the npm package we are using for our notifications-email-plugin has some documentation about using Gmail. Google strictly enforces Email Sender authorization before it does any spam analysis or whitelist checking. If you have a process that sends mail that isn't properly authorized, it will not get delivered.

So some things to consider when sending mail depends on what host you're using:

  1. Sending from a host in a datacenter: You will want to adjust your code/script/configuration to make sure that you're sending from a valid email address (@gmail.com, etc). If you're setting both the Envelope Sender and the From: header, you want to make sure those domains match. If they don't align, they will fail DMARC as well. (example: If your code uses sendmail, for instance, you probably want to use the -f option.)

  2. Sending from AWS SES: You will want to use the EasyDKIM option. You'll need to add a username and password in your email notifications configuration.

    notifications:
    email:
        host: smtp.yourhost.com
        username: AKIA1234567ABCD
        password: AbCdEfGHi123456
        port: 25
        from: example@email.com

Side note: I notice that these fields are missing from our docs. I'll update the missing documentation with those fields, too.

arunp7080 commented 6 years ago

@tkyi thanks for your quick response. Above recommended settings doesn't work on gmail as i get authentication issues in api logs. I am using kubernetes for api setup...is there any specific way I can make this work and where does that configuration resides you have suggested above !

tkyi commented 6 years ago

Which settings did you try and what authentication issues are you seeing?

The configuration documentation has been updated here: https://docs.screwdriver.cd/cluster-management/configure-api#notifications-plugin

Have you been following the steps outlined in our Kubernetes example? https://docs.screwdriver.cd/cluster-management/kubernetes Though it might be a bit outdated, the general idea should still be about the same.

jithine commented 6 years ago

Closing this, please re-open if this is still an issue.

arunp7080 commented 6 years ago

@jithin1987 @tkyi I am using same settings as you described in step2 for sending mails via gmail but unfortunately it is not being authenticated. Could you see this error .

screen shot 2018-09-12 at 9 46 17 pm