GoogleCloudPlatform / cloud-build-notifiers

Notifier images for Cloud Build, complete with build status filtering and Google Secret Manager integration
Apache License 2.0
135 stars 141 forks source link

[bug] aws ses send email fail ? #87

Open clhlc opened 3 years ago

clhlc commented 3 years ago

Hi,

I use aws ses to send cloudbuild email ,bu in the cloud run log I can see some error: E1210 04:12:44.669479 1 notifiers.go:449] failed to run SendNotification: failed to send email: 554 Message rejected: Email address is not verified. The following identities failed the check in region US-EAST-1: XXXXXXXXXXXXXXXX(My ses key)

But I write a easy go code to test ses send, is success.

there is My test code:



import (
    "log"
    "net/smtp"
)

func main() {
    // Set up authentication information.
    auth := smtp.PlainAuth("", "ses-key", "ses-secret", "ses-server")

    // Connect to the server, authenticate, set the sender and recipient,
    // and send the email all in one step.
    to := []string{"recipient@example.net"}
    msg := []byte("To: recipient@example.net\r\n" +
        "Subject: discount Gophers!\r\n" +
        "\r\n" +
        "This is the email body.\r\n")
    err := smtp.SendMail("server:587", auth, "sender@example.org", to, msg)
    if err != nil {
        log.Fatal(err)
    }
}
LOZORD commented 3 years ago

Hi Chao, Based on the way we do auth now, can you modify your notifier config at all to use the SES strings? I'm not familiar with SES myself, but setting those values Should Just Work (hopefully).

clhlc commented 3 years ago

@LOZORD I already modify the notifier config and upload to gcs. It always error 554.