This problem seems to have arisen since the recent Gmail changes.
I can send emails fine using msmtp, but if I use mpack (I want to be able to email files) I run into problems. The return code (echo $?) from mpack is 0, but after about 30 seconds, I get the following email to the local mail box on the Pi.
--394963F55A.1659185921/pi2 Content-Description: Delivery report Content-Type: message/delivery-status
Reporting-MTA: dns; pi2 X-Postfix-Queue-ID: 394963F55A X-Postfix-Sender: rfc822; snipped-for-privacy@pi2.ffoil.org.uk Arrival-Date: Sat, 30 Jul 2022 12:58:35 +0000 (UTC)
Final-Recipient: rfc822; snipped-for-privacy@gmail.com Original-Recipient: rfc822; snipped-for-privacy@gmail.com Action: failed Status: 5.7.26 Remote-MTA: dns; gmail-smtp-in.l.google.com Diagnostic-Code: smtp; 550-5.7.26 This message does not pass authentication checks (SPF and DKIM both 550-5.7.26 do not pass). SPF check for [pi2.ffoil.org.uk] does not pass 550-5.7.26 with ip: [81.187.18.146].To best protect our users from spam, the 550-5.7.26 message has been blocked. Please visit 550-5.7.26
550 5.7.26 information. o6-20020a05600002c600b0021e8c772ea6si4998559wry.1022 - gsmtp
--394963F55A.1659185921/pi2 Content-Description: Undelivered Message Headers Content-Type: text/rfc822-headers Content-Transfer-Encoding: 8bit
Return-Path: snipped-for-privacy@pi2.ffoil.org.uk>
Received: by pi2 (Postfix, from userid 1000) id 394963F55A; Sat, 30 Jul 2022 12:58:35 +0000 (UTC) Message-ID: <27775.1659185916@pi2>
Mime-Version: 1.0 To: snipped-for-privacy@gmail.com Subject: Front Door Alert Content-Type: multipart/mixed; boundary="-" Date: Sat, 30 Jul 2022 12:58:35 +0000 (UTC) From: snipped-for-privacy@pi2.ffoil.org.uk
--394963F55A.1659185921/pi2--
My understanding is that mpack uses the same configuration files as msmtp (/etc/msmtprc), so the 16 character code that is now used instead of the password ought to get picked up there, however this is rather poorly documented online
A search online for the error and mpack configuration has not proved fruitful. The Google link provided above doesn't really seem to help as the implication is that I need to set up some stuff, but it doesn't tell me how.
Thanks in advance
Adrian