1 (edited by rene.veerman 2020-12-06 20:36:09)

Topic: can't send mail through PHP PEAR Mail

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2 PGSQL version
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Both (nginx forwarding to apache)
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I'm trying to send mail through PHP PEAR Mail.php using the smtp plugin, but it is failing for my iRedMail installation (not so for gmail smtp servers)..

here's the function i'm using :

require_once ('Mail.php');
function webmail_send_mail ($serverConfig, $from, $to, $subject, $body) {
    $c = $serverConfig;
    $connectString =
        '{'.$c['IMAP']['domain'].':'.$c['IMAP']['port']
        .($c['IMAP']['requiresSSL']?'/imap/ssl':'')
        .($c['IMAP']['sslCertificateCheck']?'':'/novalidate-cert')
        .'}INBOX.Sent';
    $mbox = imap_open($connectString, $c['userID'], $c['userPassword']);

   
    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => 25,//$c['SMTP']['port for TLS'],
        'auth' => false,
        //'auth' => true,
        //'socket_options' => array('ssl' => array('verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );
//    echo json_encode($params, JSON_PRETTY_PRINT);
    $headers = array (
        'From' => $from,
        'To' => $to,
        'Subject' => $subject
    );
    $smtp = Mail::factory('smtp', $params);
    $mail = $smtp->send ($to, $headers, $body);
   
    if (PEAR::isError($mail)) {
        echo $mail->getMessage();
    } else {
        echo 'SUCCESS';
    }
}

here's the error message that i'm getting :

Failed to add recipient: rene.veerman.netherlands@gmail.com [SMTP: Invalid response code received from server (code: 554, response: 5.7.1 <localhost>: Helo command rejected: ACCESS DENIED. Your email was rejected because the sending mail server does not identify itself correctly (localhost))]"

however, i've set /etc/hosts and /etc/hostname to be something else than localhost, on both the sending machine and on the $params['host'] machine.

i've also tried using TLS to connect to the iRedMail installation :
    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        'auth' => true,
        'socket_options' => array('ssl' => array('verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );

but this results in the following error message :
authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Ready to start TLS)]

i've done extensive googling, but i can not find anyone who has solved this problem yet. sad
i'm hoping i can get some help here.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: can't send mail through PHP PEAR Mail

Use port 587 with TLS support to send email.
FYI: https://docs.iredmail.org/#mua

3

Re: can't send mail through PHP PEAR Mail

that's the thing, i tried that already..

both in Thunderbird (which gives me the following error)

Sending of the message failed.
Unable to communicate securely with peer: requested domain name does not match the server’s certificate.
The configuration related to smtp.nicer.app must be corrected.

and in PHP PEAR Mail.php as well, which gives me the following error

authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: smtp.nicer.app
PIPELINING
SIZE 15728640
ETRN
STARTTLS
ENHANCEDSTATUSCODES
8BITMIME
DSN
SMTPUTF8
CHUNKING)]

when i use the following settings :

    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'auth' => true,
        //'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );

when i use the following settings instead :

    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'auth' => true,
        'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );


i still get the following error :

authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: smtp.nicer.app
PIPELINING
SIZE 15728640
ETRN
STARTTLS
ENHANCEDSTATUSCODES
8BITMIME
DSN
SMTPUTF8
CHUNKING)]

i even tried whitelisting the sending IP range (192.168.178.*) in /opt/iredapd/settings.py and /etc/postfix/main.cf, and then restarting both iredapd and postfix (without error)

but that still results in the same errors from both Thunderbird and PHP PEAR Mail.php sad

4

Re: can't send mail through PHP PEAR Mail

my MX record for nicer.app points to smtp.nicer.app, but i also tried letting it point to mail.nicer.app, and even plain nicer.app.

nothing works! sad

5

Re: can't send mail through PHP PEAR Mail

seems you're using a self-signed ssl cert, you have to either disable cert verification in your PHP code, or grab a valid ssl cert.

FYI: https://docs.iredmail.org/letsencrypt.html

6 (edited by rene.veerman 2020-12-07 22:27:52)

Re: can't send mail through PHP PEAR Mail

ok, after following directions on the link you sent me, i can now send mails from thunderbird using my iRedMail smtp server, and these mails are also received properly by the gmail address that i'm sending them to.

however, sending from PHP still fails sad

it should be noted that the cert, although i used certbot with -d smtp.nicer.app, signs the certificate for the mail.nicer.app domain, and i needed to change thunderbird to use mail.nicer.app before it could actually send out the test mails.

so i changed my PHP config file to also use mail.nicer.app, but it shows up in the error message below here as smtp.nicer.app, and i have no idea what's causing this sad

authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: smtp.nicer.app
PIPELINING
SIZE 15728640
ETRN
STARTTLS
ENHANCEDSTATUSCODES
8BITMIME
DSN
SMTPUTF8
CHUNKING)]

7

Re: can't send mail through PHP PEAR Mail

also, i have postfix and dovecot set to their old settings, which allows me to send email from thunderbird.

if i follow your link's instructions to change the ssl cert to /etc/ssl/cert/iRedMail.crt, then thunderbird throws an error that STARTTLS isn't advertised by the mail server..

all in all, i'm still stuck on completing my PHP webmail solution..

8

Re: can't send mail through PHP PEAR Mail

i'm also having problems getting through to gmail... sad

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>: host
    gmail-smtp-in.l.google.com[2a00:1450:4013:c06::1a] said: 550-5.7.1
    [2001:980:ed77:1:6002:692b:a45:7025] Our system has detected that this
    550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR
    records 550-5.7.1 and authentication. Please review 550-5.7.1
    https://support.google.com/mail/?p=IPv6AuthError for more information 550
    5.7.1 . f8si8781557edc.529 - gsmtp (in reply to end of DATA command)


Reporting-MTA: dns; smtp.nicer.app
X-Postfix-Queue-ID: 4CqSN26yGdzbbcN
X-Postfix-Sender: rfc822; rene.veerman@nicer.app
Arrival-Date: Mon,  7 Dec 2020 16:46:26 +0100 (CET)

Final-Recipient: rfc822; rene.veerman.netherlands@gmail.com
Original-Recipient: rfc822;rene.veerman.netherlands@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [2001:980:ed77:1:6002:692b:a45:7025] Our
    system has detected that this 550-5.7.1 message does not meet IPv6 sending
    guidelines regarding PTR records 550-5.7.1 and authentication. Please
    review 550-5.7.1  https://support.google.com/mail/?p=IPv6AuthError for more
    information 550 5.7.1 . f8si8781557edc.529 - gsmtp

9 (edited by rene.veerman 2020-12-08 00:15:26)

Re: can't send mail through PHP PEAR Mail

ok, just to be clear.. i now changed /etc/postfix/main.cf to point to /etc/letsencrypt/live/smtp.nicer.app, and /etc/dovecot/dovecot.conf to /etc/letsencrypt/live/mail.nicer.app

this allows me to send out mails using thunderbird, but they bounce back with the error message as listed in my previous post in this forum thread.

PHP sending of the mails still produces the following error as well :

"{
    "host": "smtp.nicer.app",
    "port": "587",
    "auth": true,
    "socket_options": {
        "ssl": {
            "verify_peer": false,
            "verify_peer_name": false,
            "allow_self_signed": true
        }
    },
    "username": "rene.veerman@nicer.app",
    "password": "PASS_XYZ"
} authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: smtp.nicer.app
PIPELINING
SIZE 15728640
ETRN
STARTTLS
ENHANCEDSTATUSCODES
8BITMIME
DSN
SMTPUTF8
CHUNKING)]"

for the following PHP code :

require_once('Mail.php');
function webmail_send_mail ($serverConfig, $from, $to, $subject, $body) {
    $c = $serverConfig;
    $connectString =
        '{'.$c['IMAP']['domain'].':'.$c['IMAP']['port']
        .($c['IMAP']['requiresSSL']?'/imap/ssl':'')
        .($c['IMAP']['sslCertificateCheck']?'':'/novalidate-cert')
        .'}INBOX.Sent';
    $mbox = imap_open($connectString, $c['userID'], $c['userPassword']);

   
    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'auth' => true,
        'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );
    echo json_encode($params, JSON_PRETTY_PRINT);
    $headers = array (
        'From' => $from,
        'To' => $to,
        'Subject' => $subject
    );
    $smtp = Mail::factory('smtp', $params);
    $mail = $smtp->send ($to, $headers, $body);
   
    if (PEAR::isError($mail)) {
        echo $mail->getMessage();
    } else {
        echo 'SUCCESS';
    }
}

10

Re: can't send mail through PHP PEAR Mail

Please read the bounce message carefully, do not blindly complain it doesn't work.
https://forum.iredmail.org/post77855.html#p77855

11

Re: can't send mail through PHP PEAR Mail

with respect, the URL listed in the bounce message is of no help at all.
and when i google for the error message, it says something about the need for the loop ip_address->hostname->ip_address to be consistent and complete, which *it* *is*.

so i'm completely stuck here. i'm going to need a little more help.

12

Re: can't send mail through PHP PEAR Mail

root@mail:/home/rene/data1/htdocs/nicer.app# cat /etc/hosts
80.101.238.137    smtp.nicer.app mail.nicer.app nicer.app mail smtp localhost
127.0.0.1    smtp.nicer.app mail.nicer.app mail smtp localhost
127.0.1.1    albatross localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@mail:/home/rene/data1/htdocs/nicer.app# nslookup 80.101.238.137
137.238.101.80.in-addr.arpa    name = smtp.nicer.app.
137.238.101.80.in-addr.arpa    name = mail.nicer.app.
137.238.101.80.in-addr.arpa    name = nicer.app.
137.238.101.80.in-addr.arpa    name = mail.
137.238.101.80.in-addr.arpa    name = smtp.

Authoritative answers can be found from:

root@mail:/home/rene/data1/htdocs/nicer.app# nslookup smtp.nicer.app
Server:        127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:    smtp.nicer.app
Address: 80.101.238.137
Name:    smtp.nicer.app
Address: 127.0.0.1

13

Re: can't send mail through PHP PEAR Mail

ah! i had 'mail' and 'smtp' in my /etc/hosts.
replacing both with a custom name ('albatross', because it's my internet-viewable server, while my development machine is named 'crow'), fixed my Thunderbird problem! smile

i'll now check the PHP solution.

14

Re: can't send mail through PHP PEAR Mail

unfortunately my PHP solution still returns the following :

"{
    "host": "smtp.nicer.app",
    "port": "587",
    "auth": true,
    "socket_options": {
        "ssl": {
            "verify_peer": false,
            "verify_peer_name": false,
            "allow_self_signed": true
        }
    },
    "username": "rene.veerman@nicer.app",
    "password": "PASSWORD"
} authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: smtp.nicer.app
PIPELINING
SIZE 15728640
ETRN
STARTTLS
ENHANCEDSTATUSCODES
8BITMIME
DSN
SMTPUTF8
CHUNKING)]"

this is for the following code :

function webmail_send_mail ($serverConfig, $from, $to, $subject, $body) {
    $c = $serverConfig;
    $connectString =
        '{'.$c['IMAP']['domain'].':'.$c['IMAP']['port']
        .($c['IMAP']['requiresSSL']?'/imap/ssl':'')
        .($c['IMAP']['sslCertificateCheck']?'':'/novalidate-cert')
        .'}INBOX.Sent';
    $mbox = imap_open($connectString, $c['userID'], $c['userPassword']);

   
    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'auth' => true,
        //'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );
    echo json_encode($params, JSON_PRETTY_PRINT);
    $headers = array (
        'From' => $from,
        'To' => $to,
        'Subject' => $subject
    );
    $smtp = Mail::factory('smtp', $params);
    $mail = $smtp->send ($to, $headers, $body);
   
    if (PEAR::isError($mail)) {
        echo $mail->getMessage();
    } else {
        echo 'SUCCESS';
    }
}

changing $params to

    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'auth' => true,
    'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword']
    );

doesn't change the error message sad

15

Re: can't send mail through PHP PEAR Mail

FYI, i changed my /etc/hosts to this, but that does not change the PHP error message sad

root@mail:~# cat /etc/hosts
80.101.238.137    smtp.nicer.app mail.nicer.app
127.0.0.1    smtp.nicer.app mail.nicer.app localhost
127.0.1.1    albatross localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

16 (edited by rene.veerman 2020-12-08 14:54:10)

Re: can't send mail through PHP PEAR Mail

FYI, i changed my /etc/hostname to the following, but that *also* doesn't change my PHP error message sad

rene@smtp:~$ cat /etc/hostname
smtp


so i dug through the sourcecodes of PEAR Mail.php, and ended up in /etc/share/Net/SMTP.php
searching there for the error message showed me that i should be passing 'auth' as 'AUTH' instead in $params.

but that now results in an error

"{
    "host": "smtp.nicer.app",
    "port": "587",
    "AUTH": true,
    "socket_options": {
        "ssl": {
            "verify_peer": false,
            "verify_peer_name": false,
            "allow_self_signed": true
        }
    },
    "username": "rene.veerman@nicer.app",
    "password": "PASS"
}Failed to set sender: rene.veerman@nicer.app [SMTP: Invalid response code received from server (code: 530, response: 5.7.0 Must issue a STARTTLS command first)]"

17

Re: can't send mail through PHP PEAR Mail

after reading the PHP PEAR Mail documentation, i have changed $params to :

    $params = array (
        'host' => $c['SMTP']['domain'],
        'port' => $c['SMTP']['port for TLS'],
        //'auth' => false//,
        'AUTH' => true,
        'socket_options' => array('ssl' => array('verify_peer'=>false,'verify_peer_name' => false, 'allow_self_signed' => true)),
        'username' => $c['userID'],//array_key_exists('userID_smtp',$c) ? $c['userID_smtp'] : $c['userID'],
        'password' => $c['userPassword'],
        'debug' => true,
        'localhost' => 'smtp.nicer.app'
    );

and this results in the following debug information :

"{
    "host": "smtp.nicer.app",
    "port": "587",
    "AUTH": true,
    "socket_options": {
        "ssl": {
            "verify_peer": false,
            "verify_peer_name": false,
            "allow_self_signed": true
        }
    },
    "username": "rene.veerman@nicer.app",
    "password": "PASS",
    "debug": true,
    "localhost": "smtp.nicer.app"
}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: MAIL FROM:<rene.veerman@nicer.app>

DEBUG: Recv: 530 5.7.0 Must issue a STARTTLS command first
DEBUG: Send: RSET

DEBUG: Recv: 530 5.7.0 Must issue a STARTTLS command first
DEBUG: Send: QUIT

DEBUG: Recv: 221 2.0.0 Bye
Failed to set sender: rene.veerman@nicer.app [SMTP: Invalid response code received from server (code: 530, response: 5.7.0 Must issue a STARTTLS command first)]"

but because this is clearly something gone awfully wrong in the PHP Pear Mail code, i'll now take up this issue with their developers.. i'll post the link to the bug report when i've done that.

18

Re: can't send mail through PHP PEAR Mail

well, i couldn't get through to the PHP PEAR Mail developers, but i inspected the source of it a bit more, and sprinkled it with debug statements.

i'm now stuck at an authorization error.

the downside of it all, is that i can't get it to work for neither 'rene.veerman@nicer.app', 'rene.veerman', or even the plain unix account 'rene' (which is my root sudo account btw)

so i'm completely stuck again. could use some help here.

19 (edited by rene.veerman 2020-12-08 17:07:43)

Re: can't send mail through PHP PEAR Mail

the strange thing about this all, is that Thunderbird *can* succesfully send emails, using 'rene.veerman@nicer.app' as the sender, the same $params['host'], and the same password! sad sad

20

Re: can't send mail through PHP PEAR Mail

ok, while my thunderbird has broken down again, bouncing the messages with the same error message as before, despite me not changing my /etc/hosts,

i'm narrowing down the PHP error to https://www.php.net/manual/en/function. … crypto.php

but i can't get it to work by using  STREAM_CRYPTO_METHOD_ANY_SERVER nor  STREAM_CRYPTO_METHOD_ANY_CLIENT sad

21

Re: can't send mail through PHP PEAR Mail

Which PHP version are you running?
Sending email with PHP is very easy, don't understand why you got so many issues. sad

22 (edited by rene.veerman 2020-12-13 17:50:25)

Re: can't send mail through PHP PEAR Mail

i run php7.4 on an Ubuntu nginx->apache2 stack. that's the default for ubuntu 20.04, btw

perhaps i should also inform you that i'm attempting to reach the machine for smtp.nicer.app from a different machine on the same LAN, that machine is named 'crow', and is IP-input-shielded from the outside world at my ADSL modem for that LAN (which is in my home).

crow also runs the default ubuntu 20.04 nginx->apache2->php7.4 stack.

both machines have iRedMail installed.

and i do run my OS updates as soon as they're offered.

point is : i need to be able to send mails from crow *and* php7.4 on smtp.nicer.app *to* smtp.nicer.app STARTTLS port (587), and from crow and smtp.nicer.app to any other email address on the planet. i also want to test my setup with Thunderbird, on both machines.

23

Re: can't send mail through PHP PEAR Mail

hm, using PHP's internal mail() function, *does* work, now that i have iRedMail installed on the machine that i'm sending from.
(i've finally had the time to look at this problem again)

thanks for your time, people.

i won't be needing PHP PEAR Mail again..

24

Re: can't send mail through PHP PEAR Mail

ehm, PHP's internal mail function works when i'm sending from PHP at crow.nicer.app and with From: rene.veerman@nicer.app and To: rene.veerman.netherlands@gmail.com, but *not* when i send from PHP at crow.nicer.app and with From: rene.veerman.27.05.1977@gmail.com (a valid backup gmail address of mine) and To: rene.veerman.netherlands@gmail.com

here's the relevant entries from /var/log/maillog on crow.nicer.app :

Dec 16 17:05:38 crow postfix/pickup[38843]: 4Cx0N22C67z49V1T: uid=33 from=<www-data>
Dec 16 17:05:38 crow postfix/cleanup[42890]: 4Cx0N22C67z49V1T: message-id=<4Cx0N22C67z49V1T@crow.nicer.app>
Dec 16 17:05:38 crow postfix/qmgr[4342]: 4Cx0N22C67z49V1T: from=<www-data@crow.nicer.app>, size=389, nrcpt=1 (queue active)
Dec 16 17:05:38 crow amavis[9084]: (09084-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection refused
Dec 16 17:05:39 crow amavis[9084]: (09084-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection refused
Dec 16 17:05:39 crow amavis[9084]: (09084-01) (!)clamav-socket: All attempts (1) failed connecting to /var/run/clamav/clamd.ctl, retrying (2)
Dec 16 17:05:45 crow amavis[9084]: (09084-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection refused
Dec 16 17:05:45 crow amavis[9084]: (09084-01) (!)clamav-socket av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (All attempts (1) failed connecting to /var/run/clamav/clamd.ctl) at (eval 113) line 659.\n
Dec 16 17:05:45 crow amavis[9084]: (09084-01) (!)WARN: all primary virus scanners failed, considering backups
Dec 16 17:05:51 crow amavis[9084]: (09084-01) (!)clamav-clamscan av-scanner FAILED: /usr/bin/clamscan DIED, signal 11 (008b) at (eval 113) line 951.
Dec 16 17:05:51 crow amavis[9084]: (09084-01) (!!)AV: ALL VIRUS SCANNERS FAILED
Dec 16 17:05:51 crow postfix/10025/smtpd[43055]: connect from crow.nicer.app[127.0.0.1]
Dec 16 17:05:51 crow postfix/10025/smtpd[43055]: 4Cx0NH66Lyz49V21: client=crow.nicer.app[127.0.0.1]
Dec 16 17:05:51 crow postfix/cleanup[42890]: 4Cx0NH66Lyz49V21: message-id=<4Cx0N22C67z49V1T@crow.nicer.app>
Dec 16 17:05:51 crow postfix/10025/smtpd[43055]: disconnect from crow.nicer.app[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Dec 16 17:05:51 crow postfix/qmgr[4342]: 4Cx0NH66Lyz49V21: from=<www-data@crow.nicer.app>, size=2013, nrcpt=1 (queue active)
Dec 16 17:05:51 crow amavis[9084]: (09084-01) Passed UNCHECKED {RelayedInternal}, ORIGINATING LOCAL [127.0.0.1] /ESMTP <www-data@crow.nicer.app> -> <rene.veerman.netherlands@gmail.com>, (), Message-ID: <4Cx0N22C67z49V1T@crow.nicer.app>, mail_id: tqHMIUvCYVio, b: rxG3_MpbR, Hits: 3.329, size: 389, queued_as: 4Cx0NH66Lyz49V21, Subject: "zet 4", From: <rene.veerman.27.05.1977@gmail.com>, X-Mailer: PHP/7.4.3, helo=, Tests: [BODY_SINGLE_WORD=0.001,DKIM_ADSP_CUSTOM_MED=0.001,FORGED_GMAIL_RCVD=1,FREEMAIL_FORGED_FROMDOMAIN=0.249,FREEMAIL_FROM=0.001,FREEMAIL_REPLYTO_END_DIGIT=0.25,HEADER_FROM_DIFFERENT_DOMAINS=0.249,NML_ADSP_CUSTOM_MED=1.2,NO_DNS_FOR_FROM=0.379,NO_RELAYS=-0.001], autolearn=no autolearn_force=no, autolearnscore=3.329, dkim_new=dkim:said.by, 13519 ms
Dec 16 17:05:51 crow postfix/amavis/smtp[42908]: 4Cx0N22C67z49V1T: to=<rene.veerman.netherlands@gmail.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=14, delays=0.04/0/0/14, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4Cx0NH66Lyz49V21)
Dec 16 17:05:51 crow postfix/qmgr[4342]: 4Cx0N22C67z49V1T: removed
Dec 16 17:05:51 crow postfix/smtp[43060]: Trusted TLS connection established to gmail-smtp-in.l.google.com[2a00:1450:4013:c08::1b]:25: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256
Dec 16 17:05:52 crow postfix/smtp[43060]: 4Cx0NH66Lyz49V21: to=<rene.veerman.netherlands@gmail.com>, relay=gmail-smtp-in.l.google.com[2a00:1450:4013:c08::1b]:25, delay=0.32, delays=0/0.03/0.08/0.21, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:4013:c08::1b] said: 550-5.7.1 [2001:980:ed77:1:ed55:90c5:4275:be8] Our system has detected that this 550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR records 550-5.7.1 and authentication. Please review 550-5.7.1  https://support.google.com/mail/?p=IPv6AuthError for more information 550 5.7.1 . p20si2823538eds.141 - gsmtp (in reply to end of DATA command))
Dec 16 17:05:52 crow postfix/cleanup[42890]: 4Cx0NJ1Lcdz49V22: message-id=<4Cx0NJ1Lcdz49V22@crow.nicer.app>
Dec 16 17:05:52 crow postfix/bounce[43061]: 4Cx0NH66Lyz49V21: sender non-delivery notification: 4Cx0NJ1Lcdz49V22
Dec 16 17:05:52 crow postfix/qmgr[4342]: 4Cx0NJ1Lcdz49V22: from=<>, size=4738, nrcpt=1 (queue active)
Dec 16 17:05:52 crow postfix/qmgr[4342]: 4Cx0NH66Lyz49V21: removed
Dec 16 17:05:52 crow postfix/local[43062]: 4Cx0NJ1Lcdz49V22: to=<www-data@crow.nicer.app>, relay=local, delay=0.03, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Dec 16 17:05:52 crow postfix/qmgr[4342]: 4Cx0NJ1Lcdz49V22: removed

25 (edited by rene.veerman 2020-12-17 02:56:38)

Re: can't send mail through PHP PEAR Mail

ok, after returning the PHP PEAR Mail functions back to their original versions (hence without all my debug statements), i can now :

- connect to gmail as someID@gmail.com and send to anotherID@gmail.com using PHP PEAR Mail

- connect to iRedMail at crow.nicer.app to send email as someID@nicer.app to anyID@anywhere.com, using the default internal PHP mail() function

which means that both my use cases are finally solved! smile