Catalog · How the catalog works
apex_mail_relay
- ★ 2 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
# Athexa APEX SMTP Relay
Windows SMTP relay for Oracle APEX (Delphi 12, Indy) with durable disk spool, retry policy, and restricted inbound access.
What Is New In UI
- Static DFM-based UI (no runtime component generation).
- Tabs:
Dashboard,Config,Log. - Dashboard includes:
- Queue summary block,
- Actions block,
- Relay status block,
Messages per hour (last 24h)chart,- pie charts for inbound/outbound distribution and problematic percentage.
- Config tab includes grouped settings for:
- Inbound,
- Inbound auth,
- Outbound,
- Outbound auth,
- Queue,
- UI config,
- Retry policy.
- Log tab contains live in-memory log memo.
- Multi-language captions/hints: English, Russian, Indonesian.
Highlights
- Inbound SMTP listener for APEX only (
AllowedClientIP). - Inbound SMTP auth support:
CRAM-MD5,LOGIN,PLAIN. - Inbound auth requirement logic:
- if
RequireAuthCredentials = false, anonymous sending is allowed; - if
RequireAuthCredentials = trueand inbound credentials are filled,MAIL FROMrequires successful AUTH; - if inbound username/password are empty, relay allows both authenticated and anonymous flow regardless of checkbox.
- if
- Outbound delivery to smarthost with
PLAIN,STARTTLS, orSSL_IMPLICIT. - Durable queue (
new,inflight,deferred,dead,tmp) with crash recovery. - Retry policy with exponential backoff + jitter.
Flush Nowforces deferred items todue nowand wakes sender workers.- Dead-letter purge from UI.
- In-memory ring log (no file logs).
- Optional detailed SMTP tracing (
C:,S:,C-DATA:,EVT:) via UI checkbox. - Credentials are encrypted and stored in INI:
[Inbound] AuthUser/AuthPassword,[Outbound] AuthUser/AuthPassword.
- Runtime state persistence: listener/senders auto-start after restart if they were running before shutdown.
Reset to defaultskeeps outbound SMTP credentials intact.- Any setting change is saved automatically (no explicit Save button).
- If listener/senders are running, they are restarted automatically after config change.
Build
Open MailRelay.dproj in RAD Studio 12 and build Win32 Debug (or Release).
Runtime Notes
- Keep OpenSSL DLLs near executable for TLS modes in Indy.
- Default queue path is
./spool. - Active config path is logged as
Using INI: <path>. - Queue and dashboard charts are based on queue snapshot metadata.
User Scenarios
1) Basic Oracle APEX Relay (No Inbound AUTH Required)
Use when Oracle APEX is in trusted local network.
- Open
Configtab. - In
Inbound config, setBind IP,Bind Port,Allowed Client IP(comma-separated list is supported). - In
Inbound auth config, keep username/password empty and uncheckRequire auth credentials. - In
Outbound config, set smarthost host/port/TLS/workers. - In
Outbound auth credentials, set smarthost login/password if required by provider. - Changes are saved automatically after edit.
- Go to
Dashboard, clickStart Listener, thenStart Senders.
2) Strict Inbound AUTH Required
Use when inbound clients must always authenticate.
- Open
Configtab ->Inbound auth config. - Fill inbound
UsernameandPassword. - Enable
Require auth credentials. - Changes are saved automatically after edit.
- Restart listener from
Dashboard(Stop Listener->Start Listener).
Expected behavior:
MAIL FROMis rejected with auth-required response until AUTH succeeds.
3) Compatibility Mode For Mixed Clients
Use when some clients authenticate and some do not.
- Keep inbound username/password empty.
Require auth credentialsmay be on or off.- Changes are saved automatically after edit.
Expected behavior:
- relay accepts both authenticated and anonymous sessions.
4) Smarthost Credential Rotation Without Downtime
- Open
Configtab ->Outbound auth credentials. - Update SMTP username/password.
- Changes are saved automatically after edit.
- If senders are running, click
Flush Nowto accelerate processing.
5) Recover Deferred Queue Immediately
Use after temporary smarthost outage.
- Ensure senders are running.
- Click
Flush NowinDashboard. - Watch queue counters and charts.
Expected behavior:
- deferred items are marked due-now and reattempted.
6) Clean Up Dead-Letters
- Click
Purge Dead-lettersinDashboard. - Confirm action.
- Verify dead count drops.
7) Safe Reset Of Settings
- Click
Reset to defaultsinConfig. - Confirm action.
Expected behavior:
- most config values return to defaults,
- outbound credentials remain preserved.
8) Capacity Tuning For High Volume
- Increase
Queue MaxQueueItemsandQueue MaxQueueBytesMB. - Tune retry (
MaxAttempts,BaseDelaySec,MaxDelaySec,JitterPct). - Increase
Workersif smarthost allows parallel sends. - Changes are saved automatically; monitor
Messages per hourchart.
9) Observability / Troubleshooting Session
- Enable
Enable detail logging. - Reproduce issue.
- Open
Logtab and inspect SMTP dialog lines. - Disable detail logging after diagnostics to reduce noise.
10) Planned Restart With State Restore
- Keep listener/senders running.
- Close application normally.
- Start application again.
Expected behavior:
- relay restores previous runtime state (
ListenerStarted/SendersStarted).
Troubleshooting
- If inbound AUTH fails unexpectedly, verify inbound username/password and
RequireAuthCredentials. - If outbound send fails with
SMTP 535, re-save outbound credentials and verify:- smarthost host/port/TLS,
- provider account policy,
- active INI path from
Using INI: ....
- If dashboard looks stale, verify
StatsRefreshMsand sender/listener status. - If queue growth is too fast, increase queue limits or reduce upstream flow.
License
See LICENSE.md.

