diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 3e2f7fd1..2dc00ccf 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -56,7 +56,7 @@ local function time_and_clean(_session, now) module:log("debug", "checking outgoing streams for inactivity..."); for _, host in pairs(hosts) do for domain, session in pairs(host.s2sout) do - if now - (session.last_send or 0) > max_inactivity then session:close(); end + if not session.notopen and now - session.last_send > max_inactivity then session:close(); end end end last_inactive_clean = now;