Incorrect Generation of AWS S3 "af-south-1" Region URL

Issue Description

Using S3-Compatible blob storage, and selecting the region “af-south-1”, the S3 url generated is “s3-af-south-1.amazonaws.com”, but the correct url is “s3.af-south-1.amazonaws.com”.

This is not a blocking issue because you can just give the correct URL as a custom region.

Expected Behavior

Requests s3.af-south-1 by default for af-south-1

Actual Behavior

Requests s3-af-south-1 by default for af-south-1

Reproduction Steps

Use s3 compatible blob storage with “af-south-1” region.

Relevant Log Output

2026-08-26T11:35:47Z ERROR Resource error (resource.error) reason = S3 error (store.s3-error) { reason = "reqwest: error sending request for url (https://s3-af-south-1.amazonaws.com/XYZ/ABC): error sending request for url (https://s3-af-south-1.amazonaws.com/XYZ/ABC): client error (Connect): dns error: failed to lookup address information: Name or service not known", causedBy = "crates/store/src/dispatch/blob.rs:52" }, url = "https://github.com/stalwartlabs/webui/releases/latest/download/webui.zip", details = "Failed to unpack application for prefixes: admin, account"

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

S3-compatible

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

This does appear to be a bug in how the built‑in “af-south-1” region is mapped to its endpoint. Stalwart’s S3 backend relies on the rust-s3 library’s Region enum, and Region::AfSouth1 resolves internally to s3-af-south-1.amazonaws.com instead of the correct s3.af-south-1.amazonaws.com. Since this mapping comes from the underlying S3 client library rather than Stalwart-specific config, your workaround of using the “Custom” region with the correct endpoint (s3.af-south-1.amazonaws.com) is the right approach until that mapping is corrected upstream.

Relevant code: crates/store/src/backend/s3/mod.rs, where the config’s region enum is mapped to the s3 crate’s Region variants (e.g. structs::S3StoreRegion::AfSouth1 => Region::AfSouth1).

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

This has been fixed in Stalwart v0.16.20 by overriding the hostname used by the rust-s3 crate.