I have some old code that sends emails out using the default php mail() function. It has been working for years sending out simple text emails to Gmail etc. It however stopped working in the past few months and I can't figure the best way to resolve it. I've found in the error logs the following.
email used changed for security reasons
Sep 8 18:00:31 localhost sendmail[2462345]: 288I0VdW2462345: from=www-data, size=1132, class=0, nrcpts=1, msgid=<202209081800.288I0VdW2462345@localhost.localdomain>, relay=www-data@localhost
Sep 8 18:00:31 localhost sm-mta[2462346]: 288I0Vdb2462346: from=<www-data@localhost.localdomain>, size=1368, class=0, nrcpts=1, msgid=<202209081800.288I0VdW2462345@localhost.localdomain>, proto=ESMTP, daemon=MTA-v4, relay=localhost [12>
Sep 8 18:00:31 localhost sendmail[2462345]: 288I0VdW2462345: to=email@email.com, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31132, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (288I0Vd>
Sep 8 18:00:31 localhost sm-mta[2462348]: STARTTLS=client, relay=d219236.a.ess.uk.barracudanetworks.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256
Sep 8 18:00:34 localhost sm-mta[2462348]: 288I0Vdb2462346: to=<email@email.com>, ctladdr=<www-data@localhost.localdomain> (33/33), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=121368, relay=d219236.a.ess.uk.barracudanet>
Sep 8 18:00:34 localhost sm-mta[2462348]: 288I0Vdb2462346: 288I0Ydb2462348: DSN: Service unavailable
Sep 8 18:00:34 localhost sm-mta[2462348]: 288I0Ydb2462348: to=<www-data@localhost.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
Any help would be appreciated. The dedicated server is different to the domains other SMTP server. The IP has been whitelisted in the SPF record.