Custom email without authentication

1. What is the issue? Please be detailed.

Is it possible to configure ODK Central to use a custom email server without authentication? We have an internal SMTP relay server that we typically use for notification services.

Unable to send email notifications using an internal SMTP relay without authentication. It seems ODK Central config requires username/password in the custom email configuration, but this results in an error 500 when creating a user account.

2. What steps can we take to reproduce this issue?
Set the custom email configuration to use an SMTP relay without authentication.

3. What have you tried to fix the issue?
Various combinations of secure true/false, TLS true/false, username/pw enabled/disabled.

4. Upload any forms or screenshots you can share publicly below.

Error: Invalid login: 535 5.7.3 Authentication unsuccessful
at SMTPConnection.\_formatError (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:938:19)
at SMTPConnection.\_actionAUTHComplete (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:1784:34)
at SMTPConnection. (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:1738:18)
at SMTPConnection.\_processResponse (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:1150:20)
at SMTPConnection.\_onData (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:898:14)
at SMTPConnection.\_onSocketData (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:224:44)
at TLSSocket.emit (node:events:514:28)
at TLSSocket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:567:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:518:3)
at Readable.push (node:internal/streams/readable:398:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:189:23) {
code: 'EAUTH',
response: '535 5.7.3 Authentication unsuccessful',
responseCode: 535,
command: 'AUTH LOGIN'

Thanks for reporting this issue. I've filed at https://github.com/getodk/central/issues/2295

One quick thing to try would be changing docker-compose.yml to omit the variables when they're unset by removing ${EMAIL_USER:-} and ${EMAIL_PASSWORD:-}.

So lines 75 and 76 in docker-compose.yml should look like this when you are done.

 - EMAIL_USER
 - EMAIL_PASSWORD

Then rebuild and see what if that workaround works.

docker compose build && docker compose stop && docker compose up --detach

Thank you for the suggestion. I tried and I still receive the 500 error when creating a test user, but interestingly the log error has changed slightly.

Error: Invalid login: 504 5.7.4 Unrecognized authentication type
    at SMTPConnection._formatError (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:938:19)
    at SMTPConnection._actionAUTHComplete (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:1784:34)
    at SMTPConnection.<anonymous> (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:669:26)
    at SMTPConnection._processResponse (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:1150:20)
    at SMTPConnection._onData (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:898:14)
    at SMTPConnection._onSocketData (/usr/odk/node_modules/nodemailer/lib/smtp-connection/index.js:224:44)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:567:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:518:3)
    at Readable.push (node:internal/streams/readable:398:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
  code: 'EAUTH',
  response: '504 5.7.4 Unrecognized authentication type',
  responseCode: 504,
  command: 'AUTH PLAIN'

I suppose it might be a matter of omitting the login method from nodemailer: SMTP Connection | Nodemailer