diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index 86de6f1c5..529e16315 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -647,6 +647,10 @@ pub async fn send_federation_request(&self, destination: &ServerName, request where T: OutgoingRequest + Debug, { + if !services().globals.allow_federation() { + return Err(Error::bad_config("Federation is disabled.")); + } + if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { info!( "Destination {} is an IP literal, checking against IP range denylist.",