-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected errors if smtp support is disabled (on RHEL-9) #15472
Comments
• Setting CURLOPT_URL to a smtp:// url does not error
• The curl_easyoption option API makes it seem CURLOPT_MAIL_RCPT is
supported, however:
• Setting the CURLOPT_MAIL_RCPT gives a confusing error message An unknown
option was passed in to libcurl
I don't understand what you mean when you say both "the...API makes it seem
CURLOPT_MAIL_RCPT is supported" and "Setting the CURLOPT_MAIL_RCPT gives a
confusing error message" an error message (and error code) when setting
CURLOPT_MAIL_RCPT is a pretty good indication that the CURLOPT_MAIL_RCPT is NOT
supported, especially if the error code is CURLE_NOT_BUILT_IN. That should be a
good way to tell if the libcurl that's available supports sending mail or not.
The other would be to use curl_version_info() to look at the list of protocols
supported.
Example program
What is the output of your example program?
|
Let me quote a section of the CURLOPT_URL page:
|
The language bindings try help users at runtime by validating that we only expose options that exist in libcurl, and that the value passed by the user is of the correct type. If It is confusing that an option is advertised by One improvement could be if Alternatively an improvement could be that
I know now that in this case we should check if |
backgroundWhen someone decides to deliberately strip a libcurl build from features it would normally have, that libcurl build no longer supports what a plain default build would otherwise support. There are a few different reasons why people decide to strip libcurl but ultimately it is the choice of the one who builds it. How exactly libcurl should act when users try to use features that are explicitly disabled is not always consistent or perfected mostly because this is "off the mainstream". As one of the reasons people remove features is to reduce foot-print and size, we also don't want to add a lot of logic to handle cases where we remove features in the build. on the issueYes, it would be nice to have curl_easyoption reflect the build status.
|
That would be very helpful.
Ah ok that would be much better. Setting |
Yes, for most/all disabled options. |
RHEL 9: dual configuration
Users of the R bindings reported weird errors when sending sending emails on RHEL/Rockylinux version 9. It turns out the folks at Redhat have packaged libcurl in a unusual way.
RHEL version 9 ships a single
curl-devel
package, but two differentlibcurl
runtime builds. The default version installed on most systems is calledlibcurl-minimal
and it disables several protocols including smtp. An alternative more complete build is available in thelibcurl
package, but most servers don't have this installed.The problem
When a user of libcurl bindings has the
libcurl-minimal
package (which does not support smtp) installed on the server, we see the following behavior:CURLOPT_URL
to asmtp://
url does not errorcurl_easyoption
option API makes it seemCURLOPT_MAIL_RCPT
is supported, however:CURLOPT_MAIL_RCPT
gives a confusing error message An unknown option was passed in to libcurlExample program
An example
test.c
program to demonstrate this:You can easily run a RHEL-9 container in docker:
Then in docker you need to install the compiler and curl headers:
curl/libcurl version
curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.76.1 OpenSSL/3.0.7 zlib/1.2.11 nghttp2/1.43.0
operating system
Redhat 9 / RockyLinux 9
The text was updated successfully, but these errors were encountered: