quick-yak
(Quick Yak)
November 24, 2023, 11:20am
1
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
``
quick-yak
(Quick Yak)
November 24, 2023, 11:26am
2
Mike
(Mike Hillyer)
November 24, 2023, 1:40pm
3
How was the error encountered? What client connecting to what host? Which produced the error?
quick-yak
(Quick Yak)
November 24, 2023, 3:48pm
4
it was done though the standard phpmailer connection through smtp connection.
quick-yak
(Quick Yak)
November 24, 2023, 3:59pm
7
[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
tom
(Tom Mairs)
November 24, 2023, 4:03pm
9
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.
tom
(Tom Mairs)
November 24, 2023, 4:04pm
11
Smtp_Auth inbound MUST be secured with TLS.
wez
(Wez Furlong)
November 24, 2023, 4:33pm
12
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.
quick-yak
(Quick Yak)
November 24, 2023, 4:35pm
13
<?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}";
}
tom
(Tom Mairs)
November 24, 2023, 4:40pm
14
^^ please tell me you obfuscated that password before posting it here.
tom
(Tom Mairs)
November 24, 2023, 4:41pm
15
It may be helpful to try with swaks to see if it is really a cert issue.
wez
(Wez Furlong)
November 24, 2023, 4:42pm
17
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}";
}
quick-yak
(Quick Yak)
November 24, 2023, 4:44pm
18
@faithful-ostrich with open relay ip i am able to sent emails without username & password
tom
(Tom Mairs)
November 24, 2023, 4:47pm
19
Hence the concept of “open relay”
tom
(Tom Mairs)
November 24, 2023, 4:47pm
20
Please do not use an open relay. Is not necessary unless you are managing inboxes