T
Twenty17mo ago
ddimarx

Email SMTP Office365 Server configuration Issue

Hello! I'm self-hosting twenty using Docker Compose and I've tried to configure Email SMTP Office365 Server according to https://docs.twenty.com/start/self-hosting/ I've added the following in .env file --------------- EMAIL_FROM_ADDRESS=my_office365_email_address EMAIL_FROM_NAME=my_office365_email_address EMAIL_SYSTEM_ADDRESS=my_office365_email_address EMAIL_DRIVER=smtp EMAIL_SMTP_HOST=smtp.office365.com EMAIL_SERVER_PORT=587 EMAIL_SERVER_USER=my_office365_email_address EMAIL_SERVER_PASSWORD='my_office365_password' --------------- And added the related environment variables in the docker-compose.yml --------------- LOGGER_DRIVER: 'console' EXCEPTION_HANDLER_DRIVER: 'console' LOG_LEVELS: 'log' EMAIL_FROM_ADDRESS: ${EMAIL_FROM_ADDRESS} EMAIL_FROM_NAME: ${EMAIL_FROM_NAME} EMAIL_SYSTEM_ADDRESS: ${EMAIL_SYSTEM_ADDRESS} EMAIL_DRIVER: ${EMAIL_DRIVER} EMAIL_SMTP_HOST: ${EMAIL_SMTP_HOST} EMAIL_SERVER_PORT: ${EMAIL_SERVER_PORT} EMAIL_SERVER_USER: ${EMAIL_SERVER_USER} EMAIL_SERVER_PASSWORD: ${EMAIL_SERVER_PASSWORD} --------------- But when i tried to test this "SMTP Office365 Server" configuration by trying to sent a "Forgot your password?" to one of the already created users, i get the following ERROR: --------------- Server-1 | [Nest] 1 - 04/29/2024, 1:19:28 PM ERROR [SmtpDriver] sending email to 'my_office365_email_address': Error: Mail command failed: 530 5.7.57 Client not authenticated to send mail. [AM0PR10CA0070.EURPRD10.PROD.OUTLOOK.COM 2024-04-29T13:19:28.818Z **] --------------- I've also setup an App Password and use it as EMAIL_SERVER_PASSWORD but I still get the same error . Is it possible that I need to setup an other environment variables that will define the "EMAIL_SERVER_ENCRYPTION" with STARTTLS/TLS/NONE options that usually SMTP Office365 Server configuration it requires.
Welcome | Twenty - Documentation
Twenty is a CRM designed to fit your unique business needs.
4 Replies
charles
charles17mo ago
We have never tried with outlook but it should work. I thought we were using encrypted protocol but maybe we are not 😦 Do you have the technical skill to investigate?
Brendan
Brendan17mo ago
A problem i had recently was this: https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online - depending on your exchange settings this may also be a problem? nevermind this shouldn't be a problem for you in this case - for me on another project the nodemailer config looks something like this:
{host: 'imap-mail.outlook.com', secure: false, ignoreTls: false, auth: {method: "LOGIN", user: '***', pass: '***'}, tls: {minVersion: 'TLSv1', maxVersion: 'TLSv1.3', ciphers: 'ALL', rejectUnauthorized: false}}
{host: 'imap-mail.outlook.com', secure: false, ignoreTls: false, auth: {method: "LOGIN", user: '***', pass: '***'}, tls: {minVersion: 'TLSv1', maxVersion: 'TLSv1.3', ciphers: 'ALL', rejectUnauthorized: false}}
maybe parts of this help to setup a working config 🙂 settting ignore TLS: false and secure: false should use STARTTLS
gothson
gothson13mo ago
I just posted in another thread that I’m also struggling to get it working, but if Twenty doesn’t support SMTP TLS, I understand why it’s not working. Someone will need to confirm if that’s actually the case, as I’m not sure. If you're using Microsoft 365/Office 365 Exchange Online, it requires TLS security. Unfortunately, running unsecured connections in the cloud is not allowed.
charles
charles13mo ago
Interesting, could you open an issue on Github about it, this looks to be a super useful feature for the community closing this one and discussing on the other thread you have commented on

Did you find this page helpful?