## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: smtp.office365.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: test@example.fr
DISCOURSE_SMTP_PASSWORD: password
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_ENABLE_START_TLS: false
Any idea how to fix the problem ?
Another config:
## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: smtp.office365.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: test@example.fr
DISCOURSE_SMTP_PASSWORD: password
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_ENABLE_START_TLS: true
I get the following error:
550 5.7.60 SMTP; Client does not have permissions to send as this sender
The problem is from Discourse, because I can test with swaks and it’s working
Not Suggesting that You use office365 for SMTP but it seems like DISCOURSE_SMTP_AUTHENTICATION: login isn’t required … maybe try commenting that out and try again with STARTTLS set to True?
Okay the problem is now fixed. Huge mistake from my side : the email from Admin → settings → notification email was not the same from the smtp username.
Maybe a check should be made to prevent user to makes this mistake
but it seems like DISCOURSE_SMTP_AUTHENTICATION: login isn’t required
Sadly this solution is not working for me (I also tried to escape the password). I tried it with this SMTP setting problem with Office365 - #5 by ianwhite one which is working. But not everybody gets E-Mails…
If some people get mail then it’s the fault of office365, or their mail provider. The others should check their spam folder, though if they use a service life office365 it will silently drop mail that it thinks is spam.
Sounds like the address you are sending from is not one that the mail server supports. There is a line at the bottom of app.yml that week let you set the notification address. (you can set it in sure settings if you’re logged in)
Or maybe they have VERP enabled so the email address is replies+{key}@example.com instead of the authorized noreply@example.com That was the issue I’ve faced in past while trying to send mails from my own mail server. It’s usually easy to fix though.
Algunas instrucciones actualizadas para cualquiera que tenga problemas con Office 365 y entrega directa
Vaya al Centro de administración de Microsoft
Haga clic en Configuración y luego en Dominios
Haga clic en Agregar dominio
Siga las instrucciones en pantalla para agregar la URL de su foro (ejemplo: foro:susenlaces.com)
Una vez que haya completado los pasos anteriores y se haya verificado el DNS, ahora podrá crear una bandeja de entrada usando ese subdominio
Haga clic en Usuarios y luego en Usuarios activos
Haga clic en Agregar un usuario
Cree el buzón de correo para su foro (ejemplo: noreply@foro.susenlaces.com) el dominio del buzón debe coincidir con el nombre de host desde donde se ejecuta el foro
Haga clic en Licencias y aplicaciones
Asigne a este buzón una licencia de Exchange Online (Plan 1) (límite de 10,000 mensajes diarios, 30 mensajes/min) Es necesario tener una licencia adjunta al buzón para el propósito de entrega directa. En el momento de escribir esto, el costo es de $4.00 USD/mes o $5.10/CAD | Si requiere un límite más alto o un límite más corto, hay otros planes disponibles
Haga clic en Correo y luego en Administrar aplicaciones de correo electrónico
Habilite “SMTP autenticado”
Haga clic en Guardar cambios
Vaya a su portal de Azure
Vaya a su directorio activo
Seleccione Propiedades en la barra lateral izquierda, justo debajo de Configuración de usuario
Seleccione Administrar valores de seguridad
Establezca los valores de seguridad en “deshabilitado”
Haga clic en guardar
Vuelva a Usuarios > Usuarios activos
Haga clic en Autenticación multifactor
Deshabilite la MFA en el buzón que se está utilizando
El buzón ahora está listo para ser utilizado por su Discourse.
Establecer los valores predeterminados de seguridad en “deshabilitado”
Esto era lo único que impedía la autenticación SMTP…
He estado dándome cabezazos contra la pared durante días…
¿Por qué Microsoft hace las cosas tan difíciles…?
Deshabilitar los valores predeterminados de seguridad puede que ya no sea necesario con la aplicación de MFA. Si habilitas y luego aplicas MFA en una cuenta de M365, puedes ir a la página de configuración de MFA de la cuenta y agregar una contraseña de aplicación para usar y omitir MFA. Logré que funcionara con un usuario con licencia M365 Business Basic con la aplicación de MFA, SMTP AUTH y los valores predeterminados de seguridad habilitados. Solo tuve que aumentar los tiempos de espera de apertura y lectura de SMTP con dos líneas adicionales. 30 puede ser excesivo, pero 5 era muy poco.
Entrada de app.yml de trabajo, a partir de septiembre de 2023: