We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
@wez here's my super minimal rspamd client:
pub struct RspamdClient { client: reqwest::Client, url: String, } impl RspamdClient { pub fn new(rspamd_origin: &str) -> anyhow::Result<Self> { Ok(Self { client: reqwest::Client::new(), url: format!("{}/checkv2", rspamd_origin), }) } pub async fn check( &self, from: &str, ip: IpAddr, helo: Option<&str>, message: Bytes, ) -> Result<Response, reqwest::Error> { let mut request = self .client .get(&self.url) .header("From", from) .header("IP", ip.to_string()); if let Some(helo) = helo { request = request.header("Helo", helo); } request .body(message) .send() .await? .error_for_status()? .json::<Response>() .await } } #[derive(Deserialize)] pub struct Response { pub score: f32, }
Sorry, something went wrong.
Thanks! I think we could fairly trivially write a little lua script that lives in assets/policy-extras/rspamd.lua that uses https://docs.kumomta.com/reference/kumo.http/build_client/ (which is a wrapper around reqwest) under the covers. Just pass in a Message and it can extract the ip from the metadata and the from field from the message sender. https://docs.kumomta.com/reference/connectionmeta/
assets/policy-extras/rspamd.lua
Message
We don't currently capture the ehlo string in the connection metadata, but we probably should and then we could use that here as well.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: