Docker-compose gmail sending - Offering $20 via venmo

I’ve posted about this issue here about two months ago and I’m burnt out trying to figure out what I’m doing wrong.

Last post: Docker Setup Not Sending Email
(URL ends in 587… insult to injury >.<)

I will gladly Venmo $20 USD to the first individual who can post an example below providing a working example of SMTP Gmail (over port 587) sending via docker-compose.

As seen in my last post running this command ./bin/cake passbolt send_test_email within the container results in this error:

root@passbolt:/var/www/passbolt# ./bin/cake passbolt send_test_email

      ____                  __          ____  
    / __ \____  _____ ____/ /_  ____  / / /_ 
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/ 
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /    
 /_/    \__,_/____/____/_.___/\____/_/\__/   

 Open source password manager for teams
---------------------------------------------------------------
 Debug email shell
---------------------------------------------------------------

Email configuration
---------------------------------------------------------------
Host: smtp.gmail.com
Port: 587
Username: 
Password: *********
TLS: true

Sending email from: mytestemail@gmail.com
Sending email to: doesnotexist@passboltdummydomain.com
---------------------------------------------------------------


Trace
[220] smtp.gmail.com ESMTP e1-v6sm10910457pgt.71 - gsmtp
> EHLO localhost
[250] smtp.gmail.com at your service, [X.X.X.X]
[250] SIZE 35882577
[250] 8BITMIME
[250] STARTTLS
[250] ENHANCEDSTATUSCODES
[250] PIPELINING
[250] CHUNKING
[250] SMTPUTF8
> STARTTLS
[220] 2.0.0 Ready to start TLS
> EHLO localhost
[250] smtp.gmail.com at your service, [X.X.X.X]
[250] SIZE 35882577
[250] 8BITMIME
[250] AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
[250] ENHANCEDSTATUSCODES
[250] PIPELINING
[250] CHUNKING
[250] SMTPUTF8

A test email could not be sent.
Error: SMTP Error: 530 5.5.1  https://support.google.com/mail/?p=WantAuthError e1v6sm10910457pgt.71 - gsmtp

I’m in desperate need and any help is genuinely appreciated.

Hi @rhett!!

Sorry to hear that you are experiencing problems with the email sending. Have you enabled “less secure apps” access in your gmail account?

Note: If you use 2factor auth for gmail you could also craft a gmail app password for passbolt to work with gmail.

https://myaccount.google.com/lesssecureapps
https://myaccount.google.com/apppasswords

Hey @diego, I have allowed less secure apps and ran the captcha unlock google provides. This same email account is being used on two other docker-compose applications that are sending via smtp.

My question is does gmail smtp sending work for anyone on docker-compose? If so, could anyone provide me an example of their docker-compose.yml env/passbolt.env? If it works for me, $20 via Venmo.

Hi @rhett
Here a working snippet with gmail. Note that previously you require to create an app password in gmail:

EMAIL_DEFAULT_FROM=your_address@gmail.com
EMAIL_TRANSPORT_DEFAULT_HOST=smtp.gmail.com
EMAIL_TRANSPORT_DEFAULT_PORT=587
EMAIL_TRANSPORT_DEFAULT_USERNAME=your_address@gmail.com
EMAIL_TRANSPORT_DEFAULT_PASSWORD=your_app_password
EMAIL_TRANSPORT_DEFAULT_TLS=true

Those are the only email env variables you need to customize to make passbolt send emails with gmail.

Here some snip of the su -c 'bin/cake passbolt send_test_email' -s /bin/bash www-data

If you receive this email, it means that your passbolt smtp configuration is working fine.




.
[250] 2.0.0 OK 1529346783 q14-v6sm967867wmd.20 - gsmtp
> QUIT

Hope this helps :smiley:

Thanks, Diego.

I’ll have time to give it a try within the next 24 hours. I’ll update here whether it works.

I appreciate the responses!

Thanks,

1 Like

Hey @diego, no luck, getting the same error.

A test email could not be sent.
Error: SMTP Error: 530 5.5.1  https://support.google.com/mail/?p=WantAuthError h62-v6sm4357508ioa.22 - gsmtp

I’m going to PM you something.

Hi @rhett

This looks like there is a problem with your credentials or your setup on the gmail side.
Remember that docker-compose env files syntax doesn’t handle quotation and so quotes would be part of the val (just in case you are quoting the password).
For instance if you use an app password (16 digit password generated by gmail) the passbolt.env file would look like:

EMAIL_DEFAULT_FROM=xxx@gmail.com
EMAIL_TRANSPORT_DEFAULT_HOST=smtp.gmail.com
EMAIL_TRANSPORT_DEFAULT_PORT=587
EMAIL_TRANSPORT_DEFAULT_USERNAME=xxxx@gmail.com
EMAIL_TRANSPORT_DEFAULT_PASSWORD=axvupqmxzhgnmtfv
EMAIL_TRANSPORT_DEFAULT_TLS=true

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