lettre / lettre

a mailer library for Rust

Home Page:https://lettre.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using rustls-tls feature still depends on 'openssl-sys'

farazfazli opened this issue · comments

Describe the bug
Lettre still depends on 'openssl-sys' despite the 'rustls-tls' feature being enabled.

To Reproduce
Using the following line in Cargo.toml:

lettre = { version = "0.10.4", features = ["rustls-tls"] }

With these imports:

use lettre::{
    message::header::ContentType, transport::smtp::SmtpTransportBuilder, Message, SmtpTransport,
    Transport,
}

causes the following stack-trace:

  run pkg_config fail: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 1
  error: could not find system library 'openssl' required by the 'openssl-sys' crate

  --- stderr
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'openssl', required by 'virtual:world', not found
...

Expected behavior
I expected cargo build to not look for OpenSSL on my system and instead rely on rustls-tls as other packages (actix-web, reqwest) are doing in my project.

Environment

  • Lettre version: 0.10.4
  • OS: RHEL 9.1 (Plow)

Additional context
If any additional information/context is needed, please feel free to let me know and I will provide it. Thank you.

Have you tried disabling default features?

Thanks for the swift reply @paolobarbolini. I tried with the following Cargo.toml line:

lettre = { version = "0.10.4", features = ["rustls-tls"], default-features = false }

and it fixed it. Thank you so much!