can't send mail through iRedMail postfix server using PHP PEAR Mail
| From: | Rene Veerman | Date: | Tue, 08 Dec 2020 10:35:30 +0000 |
| Subject: | can't send mail through iRedMail postfix server using PHP PEAR Mail | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327379@lists.php.net to get a copy of this message | ||
i've been at this for a few days now, but keep on getting stuck..
while it may be due to my debugging efforts, i can't even get Thunderbird
to send email through that postfix server of mine at the moment, it
delivers the following bounce messages, with a link that's completely
unhelpful :(
This is the mail system at host smtp.nicer.app.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<rene.veerman.netherlands@gmail.com> <rene.veerman.netherlands@gmail.com>: host
gmail-smtp-in.l.google.com[2a00:1450:4013:c03::1b] said: 550-5.7.1
[2001:980:ed77:1:d565:64ae:934a:c18d] Our system has detected that
550-5.7.1 this message does not meet IPv6 sending guidelines regarding PTR
550-5.7.1 records and authentication. Please review 550-5.7.1
https://support.google.com/mail/?p=IPv6AuthError
for more information 550
5.7.1 . bt17si3147299edb.469 - gsmtp (in reply to end of DATA command)
PHP PEAR Mail, with my custom debug commands added, returns the following :
"DEBUG: Recv: 220 smtp.nicer.app ESMTP Postfix DEBUG: Send: EHLO
smtp.nicer.app DEBUG: Recv: 250-smtp.nicer.app DEBUG: Recv: 250-PIPELINING
DEBUG: Recv: 250-SIZE 15728640 DEBUG: Recv: 250-ETRN DEBUG: Recv:
250-STARTTLS DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250-8BITMIME
DEBUG: Recv: 250-DSN DEBUG: Recv: 250-SMTPUTF8 DEBUG: Recv: 250 CHUNKING
DEBUG: Send: STARTTLS DEBUG: Recv: 220 2.0.0 Ready to start TLS ERROR
3d1ERROR 3dfalse126DEBUG: Send: QUIT "
the Error3dfalse means that
https://www.php.net/manual/en/function.stream-socket-enable-crypto.php
returned false.
the code for that is as follows :
if (isset($this->socket_options['ssl']['crypto_method'])) {
$crypto_method =
$this->socket_options['ssl']['crypto_method'];
} else {
/* STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT constant does not
exist
* and STREAM_CRYPTO_METHOD_SSLv23_CLIENT constant is
* inconsistent across PHP versions. */
$crypto_method = //STREAM_CRYPTO_METHOD_TLS_CLIENT
//| @STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
//| @STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
STREAM_CRYPTO_METHOD_ANY_SERVER;
echo 'ERROR 3d1';
}
if (PEAR::isError($result = $this->socket->enableCrypto(true,
$crypto_method))) {
echo 'ERROR 3c'; die();
return $result;
} elseif ($result !== true) {
echo 'ERROR
3d'.json_encode($result).json_encode($crypto_method); die();
return PEAR::raiseError('STARTTLS failed');
}
please note that i can not get this code to work with the original
$crypto_method, nor with STREAM_CRYPTO_METHOD_ANY_SERVER, nor with
STREAM_CRYPTO_METHOD_ANY_CLIENT
i am completely stuck at the moment, and would love some help with these
issues.