Alfresco community 6.2 docker outbound email configuration

cancel
Showing results for 
Search instead for 
Did you mean: 
marcosfgo25
Active Member

Alfresco community 6.2 docker outbound email configuration

Spoiler
 

Hi, i need your help to configure outbound email in alfresco community 6.2 docker intallation.

who have some tutorial to send me the link please.

 

In advance thank you.

7 Replies
abhinavmishra14
Advanced

Re: Alfresco community 6.2 docker outbound email configuration

You can add following properties in docker-compose for alfresco service. Check the docs here : https://docs.alfresco.com/content-services/latest/config/email/

 

 -Dmail.host=smtphost
 -Dmail.port=25
 -Dmail.username=anonymous
 -Dmail.password=
 -Dmail.protocol=smtp
 -Dmail.smtps.starttls.enable=false
 -Dmail.smtps.auth=false

SAMPLE DOCKER COMPOSE: https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/docker-compose-v3.yml#L47

Make sure host and port is accessible and open to use 

Additionally, if you are maintaining the properties in alfresco-global.properties then you can add the above properties in there as well. You need to make sure the global properties is copied everytime you restart the containers, anychanges made to global properties on container level may be lost on restart and relaunch. 

You can make use of DockerFile and docker-compose in combination to copy the global properties file when image is build and container is launched. 

Sample use :

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/docker-compose-v3.yml#L9

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/configs-to-override/alfres...

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/configs-to-override/alfres...

You can also use this tool to generate a docker-compose with smtp configs, or at least take reference from the generated docker compose file:

https://github.com/Alfresco/alfresco-docker-installer

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
marcosfgo25
Active Member

Re: Alfresco community 6.2 docker outbound email configuration

Hi, thank you for your help,

Sorry i am new with alfresco and sorry for my English.

I use this in my docker-compose.yml file and i restart de alfresco docker but the email not work when i create task

-Dmail.host=smtp.gmail.com
-Dmail.port=465
-Dmail.username=marcos******@gmail.com
-Dmail.password=***************
-Dmail.protocol=smtp
-Dmail.smtps.starttls.enable=false
-Dmail.smtps.auth=false

Please help me to solve this problem.

 

EddieMay
Alfresco Employee

Re: Alfresco community 6.2 docker outbound email configuration

Hi @marcosfgo25 

Have you tried the following:

 

-Dmail.protocol=smtps
-Dmail.smtps.starttls.enable=true
-Dmail.smtps.auth=true

In the documentation it suggests the following config for Gmail:

 

# Sample Gmail settings
mail.host=smtp.gmail.com
mail.port=465
mail.username=user@gmail.com
mail.password=password
mail.protocol=smtps
mail.smtps.starttls.enable=true
mail.smtps.auth=true

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
marcosfgo25
Active Member

Re: Alfresco community 6.2 docker outbound email configuration

i did all this but email not working.

I have one con job with email configuration and its work good but my alfresco configuration not work.

abhinavmishra14
Advanced

Re: Alfresco community 6.2 docker outbound email configuration

as @EddieMay  mentioned and documented here: https://docs.alfresco.com/content-services/community/config/email/

the below config works fine. Make sure you have enabled less secure apps settings in your gmail: https://help.dreamhost.com/hc/en-us/articles/115001719551-Troubleshooting-GMAIL-SMTP-authentication-...

mail.host=smtp.gmail.com
mail.port=465
mail.username=xyz@gmail.com
mail.password=pass123
mail.protocol=smtps
mail.smtps.starttls.enable=true
mail.smtps.auth=true

In docker compose the config looks like:

acs62-aio-demo-project-acs:
    image: alfresco-content-services-acs62-aio-demo-project:development
    mem_limit: 1700m
    build:
      dockerfile: ./Dockerfile
      context: ../../../acs62-aio-demo-project-platform-docker/target
    environment:
      CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
      JAVA_OPTS: "
                -Dsample.site.disabled=true
                -Dftp.enabled=true
                -Dftp.port=21
                -Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
                -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
                -Dmessaging.broker.userName=admin
                -Dmessaging.broker.password=admin
                -Ddeployment.method=DOCKER_COMPOSE
                
                -Dlocal.transform.service.enabled=true
                -DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
                -DlocalTransform.imagemagick.url=http://imagemagick:8090/
                -DlocalTransform.libreoffice.url=http://libreoffice:8090/
                -DlocalTransform.tika.url=http://tika:8090/
                -DlocalTransform.misc.url=http://transform-misc:8090/
                
                -Dlegacy.transform.service.enabled=true
                -Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
                -Djodconverter.url=http://libreoffice:8090/
                -Dimg.url=http://imagemagick:8090/
                -Dtika.url=http://tika:8090/
                -Dtransform.misc.url=http://transform-misc:8090/
		-Dmail.host=smtp.gmail.com
		-Dmail.port=465
		-Dmail.username=xyz@gmail.com
		-Dmail.password=pass123
		-Dmail.protocol=smtps
		-Dmail.smtps.starttls.enable=true
		-Dmail.smtps.auth=true
                -Xms1500m -Xmx1500m
                "
      TZ: "America/New_York"
    ports:
      - "${acs.port}:8080"
      - "${acs.debug.port}:8888"
      - 21:2121   #FTP port
      - 25:2525   #SMTP port
      - 143:1143  #IMAP port
    volumes:
          #Bind mount SHORT SYNTAX - [SOURCE:]TARGET[:MODE]
          #SOURCE can be a named volume or a (relative or absolute) path on the host system. 
          #TARGET is an absolute path in the container where the volume is mounted. 
          #MODE is a mount option which can be read-only (ro) or read-write (rw) (default).
          - ../../../data/alfresco/alf_data:/usr/local/tomcat/alf_data/:rw
          - ../../../logs/alfresco:/usr/local/tomcat/logs/:rw
    depends_on:
      - acs62-aio-demo-project-postgres

Change email and password as per your settings.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
marcosfgo25
Active Member

Re: Alfresco community 6.2 docker outbound email configuration

Thank you, but still not send email:

My docker-compose file:

services:
    alfresco:
        build:
          context: ./alfresco
          args:
            ALFRESCO_TAG: ${ALFRESCO_CE_TAG}
            DB: postgres
            API_EXPLORER_TAG: ${API_EXPLORER_TAG}
        mem_limit: 4416m
        depends_on: 
            - postgres  
        environment:
            JAVA_OPTS : '
                -Ddb.driver=org.postgresql.Driver
                -Ddb.username=alfresco
                -Ddb.password=alfresco
                -Ddb.driver=org.postgresql.Driver
                -Ddb.url=jdbc:postgresql://postgres:5432/alfresco  
                -Dsolr.host=solr6
                -Dsolr.port=8983
                -Dsolr.secureComms=none
                -Dsolr.baseUrl=/solr
                -Dindex.subsystem.name=solr6
                -Dalfresco.host=${SERVER_NAME}
                -Dalfresco.port=80
                
                -Dshare.host=${SERVER_NAME}
                -Dshare.port=80
                
                -Daos.baseUrlOverwrite=http://${SERVER_NAME}/alfresco/aos
                -Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
                -Ddeployment.method=DOCKER_COMPOSE
                -Dcsrf.filter.enabled=false 
                -Dopencmis.server.override=true
                -Dopencmis.server.value=http://${SERVER_NAME}:80
                -Dlocal.transform.service.enabled=true
                -DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
                -DlocalTransform.imagemagick.url=http://imagemagick:8090/
                -DlocalTransform.libreoffice.url=http://libreoffice:8090/
                -DlocalTransform.tika.url=http://tika:8090/
                -DlocalTransform.misc.url=http://transform-misc:8090/
                -Dlegacy.transform.service.enabled=true
                -Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
                -Djodconverter.url=http://libreoffice:8090/
                -Dimg.url=http://imagemagick:8090/
                -Dtika.url=http://tika:8090/
                -Dtransform.misc.url=http://transform-misc:8090/
                -Dcsrf.filter.enabled=false
                -Dalfresco.restApi.basicAuthScheme=true
                -Dauthentication.protection.enabled=false
                -XX:+UseG1GC -XX:+UseStringDeduplication

                -Dmail.host=smtp.gmail.com
                -Dmail.port=465
                -Dmail.username=my_gmail 
                -Dmail.password=my_gmail_password
                -Dmail.protocol=smtps
                -Dmail.smtps.starttls.enable=true
                -Dmail.smtps.auth=true

                -Xms3904m -Xmx3904m   
            '
        volumes: 
            - ./data/alf-repo-data:/usr/local/tomcat/alf_data
            - ./logs/alfresco:/usr/local/tomcat/logs   
        

    alfresco-pdf-renderer:
        image: alfresco/alfresco-pdf-renderer:${TRANSFORM_ENGINE_TAG}
        mem_limit: 512m
        environment:
            JAVA_OPTS: " -Xms256m -Xmx512m"
        ports:
            - 8090:8090

    imagemagick:
        image: alfresco/alfresco-imagemagick:${TRANSFORM_ENGINE_TAG}
        mem_limit: 512m
        environment:
            JAVA_OPTS: " -Xms256m -Xmx512m"
        ports:
            - 8091:8090

    libreoffice:
        image: alfresco/alfresco-libreoffice:${TRANSFORM_ENGINE_TAG}
        mem_limit: 512m
        environment:
            JAVA_OPTS: " -Xms256m -Xmx512m"
        ports:
            - 8092:8090

    tika:
        image: alfresco/alfresco-tika:${TRANSFORM_ENGINE_TAG}
        mem_limit: 512m
        environment:
            JAVA_OPTS: " -Xms256m -Xmx512m"
        ports:
            - 8093:8090

    transform-misc:
        image: alfresco/alfresco-transform-misc:${TRANSFORM_ENGINE_TAG}
        mem_limit: 512m
        environment:
            JAVA_OPTS: " -Xms256m -Xmx512m"
        ports:
            - 8094:8090

    share:
        build:
          context: ./share
          args:
            SHARE_TAG: ${SHARE_TAG}
            SERVER_NAME: ${SERVER_NAME}
        mem_limit: 1104m
        environment:
            REPO_HOST: "alfresco"
            REPO_PORT: "8080"
            CSRF_FILTER_REFERER: "http://localhost/.*"
            CSRF_FILTER_ORIGIN: "http://localhost"
            JAVA_OPTS: "
                -Xms976m -Xmx976m
                -Dalfresco.context=alfresco
                -Dalfresco.protocol=http
                "
        volumes: 
            - ./logs/share:/usr/local/tomcat/logs  

    
    postgres:
        image: postgres:${POSTGRES_TAG}
        mem_limit: 1104m
        environment:
            - POSTGRES_PASSWORD=alfresco
            - POSTGRES_USER=alfresco
            - POSTGRES_DB=alfresco
        command: "
            postgres
              -c max_connections=200
              -c logging_collector=on
              -c log_min_messages=LOG
              -c log_directory=/var/log/postgresql"
        ports:
            - 5432:5432
        volumes: 
            - ./data/postgres-data:/var/lib/postgresql/data
            - ./logs/postgres:/var/log/postgresql  
     

    solr6:
        build:
          context: ./search
          args:
            SEARCH_TAG: $SEARCH_CE_TAG
            SOLR_HOSTNAME: solr6
            ALFRESCO_HOSTNAME: alfresco
            ALFRESCO_COMMS: none
            CROSS_LOCALE: "true"
        mem_limit: 2208m
        environment:
            #Solr needs to know how to register itself with Alfresco
            SOLR_ALFRESCO_HOST: "alfresco"
            SOLR_ALFRESCO_PORT: "8080"
            #Alfresco needs to know how to call solr
            SOLR_SOLR_HOST: "solr6"
            SOLR_SOLR_PORT: "8983"
            #Create the default alfresco and archive cores
            SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
            SOLR_JAVA_MEM: "-Xms1952m -Xmx1952m"
            SOLR_OPTS: "
                -XX:NewSize=848m
                -XX:MaxNewSize=848m
            "
        volumes: 
            - ./data/solr-data:/opt/alfresco-search-services/data  
            - ./backup/solr/alfresco:/opt/alfresco-search-services/backup/alfresco
            - ./backup/solr/archive:/opt/alfresco-search-services/backup/archive

    activemq:
        image: alfresco/alfresco-activemq:${ACTIVEMQ_TAG}
        mem_limit: 1g
        ports:
            - 8161:8161 # Web Console
            - 5672:5672 # AMQP
            - 61616:61616 # OpenWire
            - 61613:61613 # STOMP

    content-app:
        image: alfresco/alfresco-content-app:${ACA_TAG}
        mem_limit: 256m
        depends_on:
            - alfresco
            - share

    # HTTP proxy to provide HTTP Default port access to services
    # SOLR API and SOLR Web Console are protected to avoid unauthenticated access
    proxy:
        image: angelborroy/acs-proxy:1.2.0
        mem_limit: 128m
        environment:
            - PORT=80
        depends_on:
            - alfresco
            - solr6
            - share
            - content-app
        volumes:
            - ./config/nginx.htpasswd:/etc/nginx/conf.d/nginx.htpasswd 
        ports:
            - 80:80
    #Email smtp configuration
    #smtp:
     #   image: mwader/postfix-relay
      #  networks:
       #   - internal

 And i get this error when send user notification:

proxy_1                  | 192.168.1.246 - - [03/May/2021:09:57:45 +0000] "POST /share/proxy/alfresco/api/sites/teste/invitations HTTP/1.1" 408 0 "http://192.168.1.242/share/page/site/teste/add-users" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0"
alfresco_1               | 2021-05-03 09:57:55,410  ERROR [action.executer.MailActionExecuter] [http-nio-8080-exec-10] Failed to send email to antonio.smonteiro@gov.cv : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out); message exceptions (1) are:Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out)

Adicional information:

I use this link to install alfresco:

https://hub.alfresco.com/t5/alfresco-content-services-blog/installing-alfresco-6-community-edition-i...

And i can send email from my ubuntu server 20.04 when i make alfresco backup in bash script

I have the google less secure app enabled

 

 

abhinavmishra14
Advanced

Re: Alfresco community 6.2 docker outbound email configuration

I see, but this error:

alfresco_1               | 2021-05-03 09:57:55,410  ERROR [action.executer.MailActionExecuter] [http-nio-8080-exec-10] Failed to send email to antonio.smonteiro@gov.cv : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out); message exceptions (1) are:Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 465; timeout -1;  nested exception is:	java.net.ConnectException: Connection timed out (Connection timed out)

Indicates that, it can't connect to gmail SMTP server. It could be due to your server blocking the connection or server doesn't have connectivity enabled for public internet. May be check this one 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)