I have various users connecting to the MTA node of node-red-node-email
When setting Users to 'No authentication' an error is thrown if the user connects with an uername.
Is there any way to just ignore supplied credentials when 'No authentication' is selected?
Hi - can you share a simple flow that shows this ? If I try locally (flow below) I don't seem to get an error.
[{"id":"5c3bc33c.d6f8bc","type":"debug","z":"b2841f81.4dd1e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":260,"wires":[]},{"id":"95327646.4b58d8","type":"e-mail mta","z":"b2841f81.4dd1e","name":"","port":"25","secure":false,"starttls":false,"certFile":"","keyFile":"","mtausers":[],"auth":"false","authType":"none","expert":"{\"logger\":false}","x":120,"y":260,"wires":[["5c3bc33c.d6f8bc","7ffae018.c915b"]]},{"id":"31847c00ada43b02","type":"inject","z":"b2841f81.4dd1e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"from","v":"me@myserver.com","vt":"str"},{"p":"to","v":"testuser@testserver.com","vt":"str"},{"p":"attachments","v":"[{\"filename\":\"foo.txt\",\"content\":\"Simple test message\"}]","vt":"json"},{"p":"priority","v":"high","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Some Subject or other","payload":"See file attached","payloadType":"str","x":132.5,"y":300,"wires":[["015f14e12afd555f"]]},{"id":"015f14e12afd555f","type":"e-mail","z":"b2841f81.4dd1e","server":"localhost","port":"25","authtype":"BASIC","saslformat":true,"token":"oauth2Response.access_token","secure":false,"tls":false,"name":"","dname":"","x":375,"y":300,"wires":[]},{"id":"c1003c6334fc9221","type":"global-config","env":[],"modules":{"node-red-node-email":"5.0.0"}}]
I'll try.
-
MTA node is used as is:
-
.NET SMTP client trying to authenticate:
try
{
ICredentials credentials = new NetworkCredential(section["Username"], section["Password"]);
client.Authenticate(credentials);
Console.WriteLine($"Authenticated...");
}
catch (Exception ex)
{
Console.WriteLine($"{ex.Message}");
}
throws an exception of : "The SMTP server does not support authentication."
- DVR setup with no username, works, and I see it in Node-red.
- DVR setup with username, fails (and I get no message in Node-red):
Not sure really - I have tried locally with both Node-RED sending the mail and a local Thunderbird client - and both work ok. To me they look like client errors that are reporting back that the server doesn't support authentication - which is indeed how you have set it up... so why would you want the server to mislead you ?
Not mislead. If no authentication is selected I would assume it would ignore credentials rather than reject.
No problem though, I'll work with it, thanks for the help.
Not sure why it actually rejects as all tests I have done still seem to deliver the mail. Maybe the client is refusing to send if it sees no handshake.

