Roundcube Community Forum

SVN Releases => Issues & Bugs => Topic started by: skubik on September 06, 2022, 10:21:42 PM

Title: PHP-FPM 8.1.8 & Roundcube PEAR Error: Undefined Method Net_SMTP::starttls()
Post by: skubik on September 06, 2022, 10:21:42 PM
Hi there,

As the subject suggests, I'm having a problem sending mail in Roundcube 1.6.0.

I've built PHP 8.1.8 from source and have it up and running as PHP-FPM for use with my Nginx web server.
I've recently updated my install of Roundcube to 1.6.0 because the previous version (1.4.9) was giving errors with PHP 8.

I thought everything was working until I tried to send an email in Roundcube and it gave me an error. Checking my log, I found this:

Code: [Select]
Uncaught Error: Call to undefined method Net_SMTP::starttls() in /var/www/roundcubemail-1.6.0/program/lib/Roundcube/rcube_smtp.php:164

Apparently I needed to install the Net_SMTP package for PEAR, which I did using:

Code: [Select]
$ pear install Net_SMTP

It apparently worked. I checked using...
Code: [Select]
$ pear list -a

INSTALLED PACKAGES, CHANNEL __URI:
==================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL DOC.PHP.NET:
========================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE          VERSION STATE
Archive_Tar      1.4.14  stable
Console_Getopt   1.4.3   stable
Net_SMTP         1.10.0  stable
Net_Socket       1.2.2   stable
PEAR             1.10.13 stable
Structures_Graph 1.1.1   stable
XML_Util         1.4.5   stable

INSTALLED PACKAGES, CHANNEL PECL.PHP.NET:
=========================================
(no packages installed)

I restarted my PHP-FPM service AND my Nginx service and tried sending my email again, but I'm still getting the same error.

I've looked at phpinfo() from my web server and the include_path appears to be correct, and the path it's set to contains a System.php file and appears to contain the proper files (located under the 'Net/' subdir of the include_path).
I also wrote a quick script to import Net_SMTP and verifiy that starttls() exists; it does, so I don't think my problem is from Net_SMTP not being available on my PHP installation.

I don't know if this is a legit bug or it's something I've screwed up in my PHP config; either way, I'm stuck. I'd appreciate some help trying to figure this out if anyone has any insight.

Thanks!

- skubik
Title: Re: PHP-FPM 8.1.8 & Roundcube PEAR Error: Undefined Method Net_SMTP::starttls()
Post by: JohnDoh on September 07, 2022, 04:53:10 AM
I think you have run into this issue https://github.com/roundcube/roundcubemail/issues/8642 if you run the composer update manually it should sort itself out.
Title: Re: PHP-FPM 8.1.8 & Roundcube PEAR Error: Undefined Method Net_SMTP::starttls()
Post by: skubik on September 07, 2022, 10:54:56 PM
That helped! Thanks!
I ended up just reinstalling; redownloaded the complete package (I suspect I have have tried installing the dependent package previously), extracted it, ran the installer web script (the generated config.inc.php didn't work; it didn't actually use my provided imap/smtp host settings, so I ended up updating my old config) and everything worked fine now! Yay!

Thanks again!