Increase connection timeout

This commit is contained in:
David Bürgin 2022-03-14 08:31:38 +01:00
parent abb905cbd0
commit e9d5124a26
2 changed files with 15 additions and 2 deletions

View file

@ -1,5 +1,13 @@
# SpamAssassin Milter changelog # SpamAssassin Milter changelog
## 0.3.1 (unreleased)
### Fixed
* The milters connection timeout duration has been increased substantially. The
previously used duration of five minutes turned out to be too short for some
slow SMTP conversations.
## 0.3.0 (2022-03-08) ## 0.3.0 (2022-03-08)
In this release, the milter implementation has been replaced with the new In this release, the milter implementation has been replaced with the new

View file

@ -17,7 +17,7 @@ mod error;
pub use crate::config::{Config, ConfigBuilder}; pub use crate::config::{Config, ConfigBuilder};
use indymilter::IntoListener; use indymilter::IntoListener;
use std::{future::Future, io}; use std::{future::Future, io, time::Duration};
/// The name of the SpamAssassin Milter application. /// The name of the SpamAssassin Milter application.
pub const MILTER_NAME: &str = "SpamAssassin Milter"; pub const MILTER_NAME: &str = "SpamAssassin Milter";
@ -56,7 +56,12 @@ pub async fn run(
shutdown: impl Future, shutdown: impl Future,
) -> io::Result<()> { ) -> io::Result<()> {
let callbacks = callbacks::make_callbacks(config); let callbacks = callbacks::make_callbacks(config);
let config = Default::default();
// Override default timeout, which is too short in practice.
let config = indymilter::Config {
connection_timeout: Duration::from_secs(7210),
..Default::default()
};
indymilter::run(listener, callbacks, config, shutdown).await indymilter::run(listener, callbacks, config, shutdown).await
} }