Sending emal from Gmail

Hello,

I am having siginificant problems trying to configure sending email from the GMail SMTP service.
My configuration is as follows (not complete):

version: '3'
services:
es01:
image: 'docker.elastic.co/elasticsearch/elasticsearch:7.5.1'
container_name: es01
ports:
- '9200:9200'
restart: always
environment:
- node.name=es01
- discovery.type=single-node
- ELASTIC_PASSWORD=$ELASTIC_PASSWORD
- bootstrap.memory_lock=true
- xpack.ml.enabled=false
- 'ES_JAVA_OPTS=-Xms10240m -Xmx10240m'
- xpack.security.enabled=true
- xpack.security.http.ssl.enabled=true
- xpack.security.http.ssl.key=$CERTS_DIR/es01/es01.key
- xpack.security.http.ssl.certificate_authorities=$CERTS_DIR/ca/ca.crt
- xpack.security.http.ssl.certificate=$CERTS_DIR/es01/es01.crt
- xpack.security.transport.ssl.enabled=true
- xpack.security.transport.ssl.verification_mode=certificate
- xpack.security.transport.ssl.certificate_authorities=$CERTS_DIR/ca/ca.crt
- xpack.security.transport.ssl.certificate=$CERTS_DIR/es01/es01.crt
- xpack.security.transport.ssl.key=$CERTS_DIR/es01/es01.key
- XPACK_MONITORING_ENABLED=true
- XPACK_REPORTING_ENABLED=true
- xpack.notification.email.account:
gmail_account:
profile: gmail
smtp:
auth: true
starttls.enable: true
host: 'smtp.gmail.com'
port: 587
user: ***@gmail.com
password: *****
volumes:
- 'certs:$CERTS_DIR'
- './esdata2:/usr/share/elasticsearch/data'
ulimits:
memlock: {soft: -1, hard: -1}

However when I run the command, docker-compose -f docker-compose.yml config
I get the ERROR:
ompose file './docker-compose.yml' is invalid because:
services.es01.environment contains {"xpack.notification.email.account": {"gmail_account": {"profile": "gmail", "smtp": {"auth": true, "starttls.enable": true, "host": "smtp.gmail.com", "port": 587, "user": "@gmail.com", "password": ""}}}}, which is an invalid type, it should be a string

Any help/suggestions would be greatly appreciated

Hello @rmu

Which version of the Elastic stack are you running?

This is the lastest guide to setting up sending email via gmail - https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#gmail

It looks like the password field should be removed and the password should be stored in the keystore.

hope that helps,
Matt

Hey, I am using version 7.5.1

I removed the password, and I am stilll getting the same error as above

My docker compose is a bit rusty but lets try something -

Instead of passing a series of variables to xpack.notification.email.account instead pass each as an individual environment variable - xpack.notification.email.account.gmail_account.profile=gmail and xpack.notification.email.account.gmail_account.smtp.auth=true etc

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.