New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug: Anonymous SMTP authentication fails #7103
Comments
I am having the same issue in our environment. We have a local only SMTP relay setup to allow anonymous requests, but get this same error in nocodb. Did you end up finding a way around this? |
No so far I did not solve this. There were other things with priority in the meantime but I am still very keen on getting this running. |
I spent a few more hours trying then eventually gave up and used Office365 directly with their SMTP service. We would have much preferred to use our relay which is already set up how we like it, but that wasn't in the cards it seems. |
I was able to resolve the issue by adding a name parameter with the domain to the nodemailer config. In my case I manually input the domain into the compiled Would it be possible to add the name as an input field or set a default value that is derived from the from address? const config = {
name: 'your-domain.com',
host: this.input?.host,
...
} The idea came from a related discussion on the NodeBB community. |
Thanks @MarleTangible for linking this here. Indeed adding the name attribute alone did not help, I additionally had to remove the authentication attribute to allow anonymous authentication. First modification as suggested: if (process.env.NC_SMTP_FROM && process.env.NC_SMTP_HOST && process.env.NC_SMTP_PORT) {
const e = await E.default.getPluginByTitle(y.default.title);
await E.default.update(e.id, {
active: !0,
input: JSON.stringify({
from: process.env.NC_SMTP_FROM,
name: 'my-domain.name',
})
}) Second modification: async init() {
var e, t, a, i, r, l, c, d, u, p, m;
const _ = {
...
// remove the following lines
auth: {
user: null === (u = this.input) || void 0 === u ? void 0 : u.username,
pass: null === (p = this.input) || void 0 === p ? void 0 : p.password
},
...
};
this.transporter = s.default.createTransport(_)
} To avoid doing this manually all the time I added the following commands to my update script docker exec -t -i mysql_nocodb_1 sed -i -e "s/from:process.env.NC_SMTP_FROM,host:process.env.NC_SMTP_HOST/from:process.env.NC_SMTP_FROM,name:'my-domain.name',host:process.env.NC_SMTP_HOST/g" docker/main.js
docker exec -t -i mysql_nocodb_1 sed -i -e "s/d.ignoreTLS),auth:{user:null===(u=this.input)||void 0===u?void 0:u.username,pass:null===(m=this.input)||void 0===m?void 0:m.password},tls:/d.ignoreTLS),tls:/g" docker/main.js From my side, I can live with this solution,. However, I would very much welcome if future versions of NocoDB would include the option for anonymous authentication. |
@aretaon Somehow the And this is the code I had to replace: I believe the sed command would look like this: |
@MarleTangible Thanks for pointing out the correct position of the |
@MarleTangible @aretaon Can you try this docker build?
|
@DarkPhoenix2704 it worked for me. Would it be possible to rename the
|
Updated. This pr will fix the issue |
Please confirm if bug report does NOT exists already ?
Steps to reproduce ?
Use the SMTP App to configure sending mails to internal web server that accepts anonymous authentication via Port 465.
Enter server hostname, from and smtp port, leave the username and password fields blank and click on "test".
Nocodb will inform that "SMTP test failed, please check server log for more details." and the log will state
response: '535 5.7.8 Error: authentication failed: authentication failure',
This is possibly related to #5559 but reopened here as new issue for better reference.
Desired Behavior
The SMTP app sends an email via anonymous authentication (see #520) and does not produce an error.
Project Details
NocoDB used as docker: yes
NocoDB version: "nocodb/nocodb:latest"
Database used: mysql
OS: Ubuntu 22.04
Detailed log:
Attachments
No response
The text was updated successfully, but these errors were encountered: