OpenSign icon indicating copy to clipboard operation
OpenSign copied to clipboard

[Bug]: SMTP sending assumes SMTP User as having a domain name

Open fbatschi opened this issue 1 year ago • 3 comments

Issue Description

In order to authenticate against a custom SMTP server (SMTP_ENABLE=true), the env var SMTP_USER_EMAIL is used.

In my case the user to authenticate does not have a @domain.tld in it, just smtpuser

Problem is, the SMTP_USER_EMAIL is also used as the MAIL FROM in the SMTP connect. This leads to an SMTP error

error in send OTP mail Error: Mail command failed: 501 5.5.4 Invalid FROM: Missing domain
     at SMTPConnection._formatError (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)
     at SMTPConnection._actionMAIL (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:1616:34)
     at SMTPConnection.<anonymous> (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:1085:18)
     at SMTPConnection._processResponse (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:991:20)
     at SMTPConnection._onData (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:772:14)
     at SMTPConnection._onSocketData (/usr/src/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)
     at TLSSocket.emit (node:events:519:28)
     at TLSSocket.emit (node:domain:488:12)
     at addChunk (node:internal/streams/readable:559:12)
     at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) {
   code: 'EENVELOPE',
   response: '501 5.5.4 Invalid FROM: Missing domain',
   responseCode: 501,
   command: 'MAIL FROM'
 }

Expected Behavior

There should be an additional, different env var, that defines the sender email address to use. For instance SMTP_FROM where you can set the name and email address to use as sender.

Current Behavior

The smtp user to authenticate with is also used as the mail sender.

Steps to reproduce

No response

Screenshots of the issue(optional)

No response

Operating System [e.g. MacOS Sonoma 14.1, Windows 11]

No response

What browsers are you seeing the problem on?

No response

What version of OpenSignâ„¢ are you seeing this issue on? [e.g. 1.0.6]

2.4.1

What environment are you seeing the problem on?

Hosted (app.yourdomain.com)

Please check the boxes that apply to this issue report.

  • [X] I have searched the existing issues & discussions to make sure that this is not a duplicate.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I have searched the existing issues & discussions to make sure that this is not a duplicate.

fbatschi avatar Oct 12 '24 19:10 fbatschi

Having a related issue when using an email relay. The user needs to be [email protected] to send properly. However, this makes all emails comes from the relay itself, [email protected]. The sender should be [email protected]. A SMTP_FROM variable that sets the MAIL FROM value to [email protected] would solve this.

RobertPosluszny avatar Feb 25 '25 23:02 RobertPosluszny

We have already done some changes related to this which are being tested locally. These changes should be available by next week.

andrew-opensignlabs avatar Feb 26 '25 13:02 andrew-opensignlabs

I have the same issue, my smtp user id is NOT an email address, so can't make this work. Is a fix still in the works? I use DuoCircle for my smtp relaying, works great on all services I use it with except..... Opensign.

Cd084 avatar Oct 08 '25 16:10 Cd084