Background context: New mailserver using php8.1, Ubuntu 22.04. Old server php7.4, Debian Stretch both using Phpmailer 5.5.
Previous server would send emails with an attachment and place a copy including attachment in sent folder. New server sends properly, but will not save a copy (to sent folder).
The error message is:
TLS/SSL failure for [server name]: SSL negotiation failed (errflg=2) in Unknown on line 0
I can not find any detail of what this error is in the mail.log
This is the code I have used successfully before, extended class (but with temporary debug lines to verify the data being passed to imap_append):
$imapStream = imap_open(“{” . $this->Host . “}” . $path , $this->Username, $this->Password);
echo "nHost: ".$this->Host."n";
echo "npath: ".$path."n";
echo "nUsername: ".$this->Username."n";
echo "nPassword: ".$this->Password."n";
echo "nimapStream: ".$imapStream."n";
imap_append($imapStream, "{" . $this->Host . "}" . $path, $message);
imap_close($imapStream);
Thunderbird and Dovecot both work perfectly, it is literally just Phpmailer with the problem. The php imap extension is installed.
I have tried upgrading Phpmailer for a newer version -6.9.1, but that has brought a raft of other issues.
This is obviously an IMAP auth issue, but I have no idea where to get information to troubleshoot it.
Any help would be much appreciated.