Ban duration of IP blocking seems to be ignored

Issue Description

I set band duration but the actual result differs. i.e. I set block duration to 1 day and yet IPs get blocked for 1 hour.

Expected Behavior

The block duration should be respected.

Actual Behavior

Band duration is 1 h instead of 1 day.

Reproduction Steps

  • set block duration to 1 day for Port scanning ban
  • wait for an IP to get blocked due to Port scanning
  • check lsit of blocked IPs
  • see: created at: 30 Jun 2026, 10:03
  • see: expriatio ndate: 30 Jun 2026, 11:03

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Let me look into how IP blocking/ban duration is configured and handled in the codebase.

I found something very important. Looking at line 162:

blocked_ip_expiration: security.auth_ban_period.map(|v| v.as_secs()),

The blocked_ip_expiration field is only being populated from auth_ban_period, not from scan_ban_period. Let me verify this is used for all bans.

This has been fixed in v0.16.12 which will be released this week.