Mail: There was an error while setting up your account

Received that error in the Nextcloud UI when trying to add an account in Mail. Other Nextcloud accounts have Mail accounts and are working fine, can send/receive, etc. I don’t believe anyone has added a Mail account for some time so I don’t know when this happened. This is a production server so I can’t just randomly try things. Also can’t upgrade to the latest version of NC as a couple key apps aren’t yet compatible.

Browser logs:
XHR POST https://mycloud/index.php/apps/mail/api/accounts
[HTTP/1.1 500 Internal Server Error 113ms]

[ERROR] mail: could not save account details

Error from nextcloud.log
“/index.php/apps/mail/api/accounts”,“message”:“Class ‘IPLib\Factory’ not found in file ‘/var/www/html/apps/mail/lib/Net/IpAddressClassifier.php’ line 52”

That makes sense, as Mail does not include that lib. I could potentially provide it if I knew where Mail was expecting to find it.

Additional info. Adding the mail account from occ works fine

In server. Are you on Nextcloud 24?

Can’t upgrade though as a few apps I need aren’t compatible.
Do you know where that lib should go?

This was also reported in Class "IPLib\Factory" not found in file '/var/www/html/apps/mail/lib/Net/IpAddressClassifier.php' line 53 · Issue #7816 · nextcloud/mail · GitHub

As far as I know [stable1.15] fix: check that IpUtils is available by kesselb · Pull Request #7858 · nextcloud/mail · GitHub addressed this issue. But it’s unreleased. I’ll ask the maintainer for a release.

The PR is in fact released as 1.15.1.

We might need a similar check for IpLibs similar to IpUtils.

I’m reopening Class "IPLib\Factory" not found in file '/var/www/html/apps/mail/lib/Net/IpAddressClassifier.php' line 53 · Issue #7816 · nextcloud/mail · GitHub

Great. Thanks. I’ll see how it works when I upgrade. For now I just added the Mail account from occ so my immediate problem is solved.

1 Like

I can confirm upgrading to 24.0.9 fixed this