SMTP configuration test connection error

!Connection unsuccessful: Connection unsuccessful: authentication failed: unencrypted connection

im using connection security is “None”.

1 Like

Can you post a screenshot of your SMTP settings?


please find the attachment.

I see you’re accessing port 25 in your example. I’m guessing maybe it expects SMTP over TLS on port 587?

I don’t have TLS and STARTTLS for connection security. That’s why I use “None”.

What do the mail server logs say?

Sir,
Please find the logs attached below.

Mattermost Log:

{“timestamp”:“2025-01-09 15:57:30.458
+05:30”,“level”:“warn”,“msg”:“Error decoding the config”,“caller”:“api4/system.go:220”,“path”:“/api/v4/email/test”,“request_id”:“jo8e1xtonir7um16ywrtacnhaa”,“ip_addr”:“x.x.x.x”,
“user_id”:“7549heur47yfpq85etsqdwiqjc”,“method”:“POST”,“error”:“EOF”}
{“timestamp”:“2025-01-09 15:57:30.462
+05:30”,“level”:“error”,“msg”:“Connection unsuccessful: authentication failed:unencrypted
connection”,“caller”:“web/context.go:124”,“path”:“/api/v4/email/test”,“request_id”:“jo8e1xtonir7um16ywrtacnhaa”,“ip_addr”:“x.x.x.x”,“user_id”:“7549heur47yfpq85etsqdwiqjc”,“method”:“POST”,“err_where”:“testEmail”,“http_code”:500,“error”:“testEmail: Connection unsuccessful: authentication failed: unencrypted connection”}

Mail Srever Log

Jan 9 15:58:38 mcl postfix/smtpd[24376]: connect from unknown[x.x.x.x]
Jan 9 15:58:38 mcl postfix/smtpd[24376]: disconnect from unknown[x.x.x.x]
Jan 9 15:58:46 mcl postfix/smtpd[24376]: connect from unknown[x.x.x.x]
Jan 9 15:58:46 mcl postfix/smtpd[24376]: disconnect from unknown[x.x.x.x]

I’d look at making the postfix logs more chatty, give more info. There area few ways to do this. Postfix Debugging Howto

This is almost certainly coming from the postfix side… Mattermost doesn’t decide these things, it just uses the config you supply and tries to open a connection. It’s receiving something it interprets as “unencrypted connection” from postfix. Getting more verbose logs should give some details as to why.

While sending mails directly from mattermost server using telnet, it is going. Please find the commands in mattremost server and logs in mail server.

Logs while sending mail from mattermost server using telnet
//////////////////////////////////////////////////////

Commands from mattermost server
////////////////////////
root@vssc:/opt/mattermost/config# telnet x.x.x.x 25
Trying x.x.x.x…
Connected to x.x.x.x.
Escape character is ‘^]’.
220 mcl3hci.vssc.gov.in ESMTP Postfix
ehlo vssc.gov.in
250-mcl3hci.vssc.gov.in
250-PIPELINING
250-SIZE 31457280
250-VRFY
250-ETRN
250-AUTH GSS-SPNEGO GSSAPI LOGIN PLAIN
250-AUTH=GSS-SPNEGO GSSAPI LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
dnMwODE0NA==
334 UGFzc3dvcmQ6
dnMwODE0NA==
235 2.7.0 Authentication successful
mail from: vs_smitha@vssc.gov.in
250 2.1.0 Ok
rcpt to: helpdeskmail@vssc.gov.in
250 2.1.5 Ok
data
354 End data with .
tets mail from mattermost server using telnet
.
250 2.0.0 Ok: queued as 04310200E9A3
]

Mail server Log:
/////////////////////////
cat /var/log/maillog | grep 04310200E9A3
Jan 31 15:53:48 mcl3hci postfix/smtpd[21203]: input attribute value:
04310200E9A3
Jan 31 15:53:48 mcl3hci postfix/smtpd[21203]: 04310200E9A3:
client=unknown[y.y.y.y], sasl_method=LOGIN,
sasl_username=vs08144@vssc.gov.in
Jan 31 15:54:08 mcl3hci postfix/cleanup[21206]: 04310200E9A3:
message-id=<>
Jan 31 15:54:08 mcl3hci postfix/qmgr[22003]: 04310200E9A3:
from=<vs_smitha@vssc.gov.in>, size=236, nrcpt=1 (queue active)
Jan 31 15:54:08 mcl3hci postfix/smtpd[21203]: > unknown[y.y.y.y:
250 2.0.0 Ok: queued as 04310200E9A3
Jan 31 15:54:08 mcl3hci postfix/smtp[21184]: 04310200E9A3:
to=<helpdeskmail@vssc.gov.in>, relay=10.41.6.112[10.41.6.112]:25,
delay=35, delays=35/0/0/0, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued
as 746418E806DD)
Jan 31 15:54:08 mcl3hci postfix/qmgr[22003]: 04310200E9A3: removed

Userid and password are encoded in Base64 and given in telnet mail sending command as follows.

echo -n “vs08144” | base64
dnMwODE0NA==

We tried to copy the same user-id and password in config.json file SMTP part and tried. But mails are not going from mattermost. It seems that mattermost is not able to identify / decode the userid and password given. We are not using TLS encryption here.