Gmail smtp relay issue

Describe the problem/error/question

I have set up a new n8n container however I am trying to get SMTP to work. I have set the relevant environment variables, however I believe I have found what the issue is, I just don’t know how to work around it.

We use smtp-relay.gmail.com which is working through a trusted IP, it does not require authentication to work. However, if I set my environment variables as follows:

N8N_EMAIL_MODE=‘smtp’
N8N_SMTP_HOST=‘smtp-relay.gmail.com
N8N_SMTP_PORT=25
N8N_SMTP_USER=‘’
N8N_SMTP_PASS=‘’
N8N_SMTP_SENDER=‘[email protected]
N8N_SMTP_SSL=‘false’

When I try to run through the “forgot password” process, I get:

Please contact your admin. n8n isn’t set up to send email right now.

Now if I specify a username and password in the environment variables and I try again, it attempts to send an email but of course, it fails with “invalid username/password”.

I believe the issue here is that n8n won’t allow you to have a blank username/password in the environment variables and uses this as a check to determine if smtp should be used, rather than using N8N_EMAIL_MODE=‘smtp’

Is there a workaround to this or can n8n be updated to look at the N8N_EMAIL_NODE to determine if email is configured on the system which will allow it to not auth using a username and password to the SMTP server?

Thanks for any assistance.

Information on your n8n setup

  • **n8n version:docker.n8n.io/n8nio/n8n
  • Database (default: SQLite): SQLite
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • **Running n8n via Docker

Hey @aurora,

Welcome to the community :cake:

We don’t currently support anonymous authentication for the user management SMTP server which is likely to be why it is failing. Do you have an smtp server that does require authentication that you can use instead?

Hi Jon,

Thanks for the reply. Is this something that is planned? I’ve seen others in this community asking for such feature.

It is interesting because the smtp block works with blank username/password (which is the main part I guess, the rest we can work around).

Regards

Hey @aurora,

I think it is something that has been planned for a while and there might even be a PR already in for it but I am not sure why we have not added this yet I suspect it is just down to time and other features having a higher priority.