Add net-smtp as a dependency for Ruby 3.1 compatibility
It was recently removed from the default gems:
- https://bugs.ruby-lang.org/issues/17873
- https://github.com/ruby/ruby/pull/4530
Also add net-imap and net-pop to the gemspec
This dependencies introduces `strscan` as a subdependency, but JRuby
only has prerelease support for it. Make sure the prerelease is
properly picked up by our tests by adding it to the `Gemfile`.
The released version of `truffleruby` does not work with old versions of
Bundler. However, it's not possible to specify a custom version of
Bundler in truffleruby, because the `ruby/setup-ruby` will ignore that
in the case of `truffleruby-22.0` (the current release) That's in my
opinion an issue with `ruby/setup-ruby` because it should respect user's
choice when it's explicit. But it's not possible to change that because
it was an explicit choice of that library.
So as an alternative solution, use `truffleruby-head`, which apparently
does not have the issue.
The standard `ruby/setup-ruby` action has all rubies that we need and
has the added advantages of builtin gem caching and providing an up to
date version of TruffleRuby, which behaves better.