log4js (node) cannot send via SMTP appender with no auth

357 Views Asked by At

I'm using a port of log4js designed for javascript in node and am having some trouble using the SMTP appender where the SMTP relay does not use authentication

Here is my configuration:

"appenders": [ {
    "type": "smtp",
    "recipients": "[email protected]",
    "sendInterval": 60,
    "transport": "SMTP",
    "SMTP": {
        "host": "smtp.noauth.relay",
        "secureConnection": false,
        "port": 25,
        "auth": {
            "user": "[email protected]",
            "pass": ""
        }
    }
} ]

has anyone had any success with this? it works fine if I use gmail relay and put in my gmail credentials but other than that I can't work it.

edit okay so I'm getting some responses from the server saying authentication failed. so it seems like it is trying to authenticate itself with a blank password when the server expects no authentication. I removed the auth portion of from the config and the server gave an OK response. BUT... now I have to figure out how to send the sender address because they're just coming through as anonymous...

so here is the working config for no authentication:

"appenders": [ {
    "type": "smtp",
    "sender": "[email protected]"
    "recipients": "[email protected]",
    "sendInterval": 60,
    "transport": "SMTP",
    "SMTP": {
        "host": "smtp.noauth.relay",
        "secureConnection": false,
        "port": 25,
    }
} ]

hope this helps someone in the future

0

There are 0 best solutions below