smtp authentication with port 25 & 587 not working

getting following errors
``
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failedSMTP server error: QUIT command failed Detail: cIĝh6H az)N&(o҆3PJpzn~ƌ!uS&BXkrOHڴxz]oEobpOlkgRPÊ%mX=NZXU"d>_L0T.zHSkxk5S-,Dq BFڈF,tQ3w48gn*b&9~R6E

``

https://gist.github.com/mailergeek/4c9e66cbdd5553bb555e459310c2a983

do find the config which i had used

How was the error encountered? What client connecting to what host? Which produced the error?

it was done though the standard phpmailer connection through smtp connection.

Do you have a trace?

[2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 0ns === Connected 2023-11-24 15:54:55.532224578 UTC [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 0ns === conn_meta received_from="2xx.xxx.xx.xx:40422" [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 0ns === conn_meta received_via="1xx.x.xxx.xx:587" [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 0ns === conn_meta reception_protocol="ESMTP" [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 17µs <- 220 kumomta.abcdef.com KumoMTA [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 182ms -> EHLO kumomta.abcdef.com [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 183ms === smtp_server_ehlo: Ok [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 183ms <- 250-kumomta.abcdef.com Aloha kumomta.abcdef.com [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 183ms <- 250-PIPELINING [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 183ms <- 250-ENHANCEDSTATUSCODES [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 183ms <- 250 STARTTLS [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 588ms -> STARTTLS [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 588ms <- 220 Ready to Start TLS [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 1s -> QUIT [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 1s <- 221 So long, and thanks for all the fish! [2xx.xxx.xx.xx:40422->1xx.x.xxx.xx:587] 1s === Closed

Show the phpmailer code?

It looks like this failed at the STARTTLS which typically indicates the injection system is not using TLS or has a failed cert.
try opening a new terminal on the KumoMTA host and running the kcli server trace to see all the inbound details.

Smtp_Auth inbound MUST be secured with TLS.

Based on the trace, it seems like the cert didn’t verify. The binary junk your client prints out is concerning; can you try a different client to see if you get better diagnostics? in a pinch, openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25 can be useful.

<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'vendor/autoload.php'; $mail = new PHPMailer(true); try { $mail->SMTPDebug = 2; $mail->isSMTP(); $mail->Hostname = 'kumomta.abcd.com'; $mail->Host = 'kumomta.abcd.com'; $mail->SMTPAuth = true; $mail->Username = 'abcd@abcd.in'; $mail->Password = 'QSFNLjc3JE4jZWF2NSVeITAw'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->AuthType = 'PLAIN'; $mail->setFrom('abcd@kumomta.abcd.com', 'Susu'); $mail->addAddress('xyz@gmail.com'); $mail->isHTML(true); $mail->Subject = 'Subject'; $mail->Body = 'HTML message body in bold '; $mail->AltBody = 'Body in plain text for non-HTML mail clients'; $mail->send(); echo "Mail has been sent successfully!"; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; }

^^ please tell me you obfuscated that password before posting it here.

It may be helpful to try with swaks to see if it is really a cert issue.

Probably also a good idea to print the details from the $e exception here in case there is additional context:

} catch (Exception $e) {
        echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

@faithful-ostrich with open relay ip i am able to sent emails without username & password

Hence the concept of “open relay”

Please do not use an open relay. Is not necessary unless you are managing inboxes