in reply to Re: getting SMTP capability working
in thread getting SMTP capability working

Mail::Webmail::Gmail has a date of 2006 on it. I'm going to guess that a 16 year old module probably isn't compatible with Google's current implementation of webmail. And yes, any modern "web" module should just depend on LWP::UserAgent and not have a direct dependency on SSLeay. (with the exception of event-driven modules which often have to re-invent things themselves)

Ok, and thanks for your reply. I don't know how to say it in the language of perl modules, but I think it's clear that Google is shutting the door on the type of access that Mail::Webmail::Gmail provided before the free service became a magnet for bad actors. If I were putting up the sign it would say:

STOP. Here swirls Charybdis. Do not play this logic game.

If you want to inspect a Gmail mailbox, you can currently go into Google settings and enable "insecure" protocols (for i.e. IMAP and SMTP) and then use Perl's IMAP modules to interact with the mailbox. This support is supposedly going away some time, but works for now. I don't know if there is a native API client for Google's mail back-end, in Perl.

Let me again repost what I discovered upthread from google:

To help keep your account secure, starting May 30, 2022, Google will no longer support the use of third-party apps or devices w +hich ask you to sign in to your Google Account using only your user n +ame and password.

Regarding what back ends there might be, my strong suspicion would be that you will be able to do this if you're a paying client. At least that's what I read into the following paragraph

Please note this deadline does not apply to Google Workspace or Google Cloud Identity customers. The enforcement date for these customers will be announced on the Workspace blog at a later date.

I'd be curious if someone among us had experience with either Google Workspace or Google Cloud Identity. I do not. My guess is that they might have backends for perl access, but the landscape is changing so fast. A lot of people's stuff is gonna break down at the end of this month. And it's not just gmail, it's anything without a subscription, as far as I can tell. I clicked around a bit to see what was still out there,and I fear that this type of access to gratis webmail is going the way of the dodo.

When you configure the outgoing SMTP host, you need to first make sure that that host is actually running an SMTP server. "fourth" looks like the host name of your raspberry Pi, so you should first make sure you installed Postfix correctly. But also, if you installed postfix locally, then you can deliver mail directly to postfix without using SMTP at all, and test this from the command line using the 'sendmail' or 'mail' commands. Also, using SSL from a local service to a local service is unnecessary complication. SSL needs a certificate, and it won't match for the local host name, forcing you to also set flags to disable host name checks.

Now that I'm halfway through this thread, I'd like to refine the task I'm doing to be one where I'm sending an email from my rpi to my droplet. I think of my rpi as being "out in the field" and my droplet as a never-blinking observer, and an appropriate place to build what I need to house emails. Since there is so much involved in setting up the server, the folks at digital ocean try to pour water on it with why-you-may-not-want-to-run-your-own-mail-server. This article also neatly states what a person needs to do, including the (sometimes confusing) acronyms. So far, I've successfully created the LAMP stack following install-linux-apache-mysql-php-lamp-stack-on-ubuntu. What's more, I created an MX record to point to mail.(domain name) and am trying to get my ducks in a row to install postfix, where my install had been hanging. I've learned over the years not to present a question to the monastery without doing an internet search on it, so I did: just-f***ing-google.it and found installing-postfix-hangs-at-postfix-configuration-screen. I was shocked to find that the culprit was the size of my terminal. I was unable to select anything when it was small, but maximized, the install moves forward without complaint.

None of this yet touches on *receiving* email to your raspberry Pi, like giving the raspberry Pi its own DNS name with MX (mail exchange) records. That also involves Postfix (a very different configuration) and some way to locally store the email, like Dovecot IMAP.

Ok, so I just broke through with postfix and have Dovecot on the install list.

Thanks again for your comment,

Replies are listed 'Best First'.
Re^3: sending an email from my rpi to my droplet [gmail workaround]
by Aldebaran (Curate) on May 24, 2022 at 23:49 UTC
    I clicked around a bit to see what was still out there,and I fear that this type of access to gratis webmail is going the way of the dodo.

    Not really, just the death of one-step authentication. I've been looking at workarounds and took the bold step of just f***ing googling it, which revealed this reddit thread. The poster describes the workaround for Auth 2.0. 2-step auth has to be authorized, so you're ok if you have a phone number to give to google:

    Log into gmail Click the user icon in the top-right corner and select "Manage your Go +ogle Account" Go to the security page (from the list at the left) [This is necessary for the next step, but will stop your scripts from +logging into smtp with your regular password. This is sort of the poi +nt of no return. Make sure you are ready to go all the way and update + all of your email-sending scripts before continuing.] Enable two-ste +p authentication. Once two-step authentication is enabled, go back to the security page. + There should now be a new section called "App Passwords". Select it. + You will probably be asked to log in again. Generate a new app password. I put in "Mail" under "select app" and "O +ther" under "select device," but I don't think any of the information + you put it matters. It will give you a 16-character app password which will be shown in ye +llow. Have your scripts use this password to log into smtp instead of your r +egular password and everything should work. It will not prompt you fo +r 2-step verification. After doing this, my scripts seem to work. I did not have to make any +other changes to the code other than substituting the app password fo +r the original one. Hopefully it helps you too.

    Gmailpocalypse this is not....