Issue Description
SPF Verification is EHLO relaxed and MAIL FROM strict.
When receiving an email from a domain without SPF it is mention in log that it was reject because was too large.
Expected Behavior
I was expecting to see the MAIL FROM line before line SPF From check failed and a line mentioning that the email was rejected because of SPF failed not because the message was too large.
If who is reading can very easily blame the size of the email instead of the real reason problems with SPF configuration of the remote domain.
Actual Behavior
Sender is receiving the real reason SPF rejected but in the log is mentioning Mail too large after SPF From check failed. SPF From check failed line it will be written to the logs even the email is accepted (if SPF Verification->MAIL FROM is set as relaxed.
Reproduction Steps
MTA->Sender Authentication->SPT Verification:
- EHLO: if local_port == 25 then relaxed
else disable - MAIL FROM: if local_port == 25 then strict
else disable
Relevant Log Output
2026-07-01T09:04:21Z INFO SMTP EHLO command (smtp.ehlo) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616, domain = “mail-ej1-f42.google.com”
2026-07-01T09:04:21Z INFO SMTP EHLO command (smtp.ehlo) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510, domain = “mail-ed1-f42.google.com”
2026-07-01T09:04:21Z INFO SPF EHLO check failed (smtp.spf-ehlo-fail) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616, domain = “mail-ej1-f42.google.com”, result = No SPF record (spf.none), elapsed = 31ms
2026-07-01T09:04:21Z INFO SPF EHLO check failed (smtp.spf-ehlo-fail) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510, domain = “mail-ed1-f42.google.com”, result = No SPF record (spf.none), elapsed = 33ms
2026-07-01T09:04:22Z INFO TLS handshake (tls.handshake) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616, listenerId = “smtp”, version = “TLSv1_3”, details = “TLS13_AES_256_GCM_SHA384”
2026-07-01T09:04:22Z INFO TLS handshake (tls.handshake) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510, listenerId = “smtp”, version = “TLSv1_3”, details = “TLS13_AES_256_GCM_SHA384”
2026-07-01T09:04:22Z INFO IPREV check passed (smtp.iprev-pass) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510, domain = “mail-ed1-f42.google.com”, result = IPREV check passed (iprev.pass) { details = [“mail-ed1-f42.google.com.”] }, elapsed = 84ms
2026-07-01T09:04:22Z INFO IPREV check passed (smtp.iprev-pass) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616, domain = “mail-ej1-f42.google.com”, result = IPREV check passed (iprev.pass) { details = [“mail-ej1-f42.google.com.”] }, elapsed = 91ms
2026-07-01T09:04:22Z INFO SPF From check failed (smtp.spf-from-fail) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510, domain = “mail-ed1-f42.google.com”, from = “[email protected]”, result = No SPF record (spf.none), elapsed = 36ms
2026-07-01T09:04:22Z INFO SPF From check failed (smtp.spf-from-fail) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616, domain = “mail-ej1-f42.google.com”, from = “[email protected]”, result = No SPF record (spf.none), elapsed = 32ms
2026-07-01T09:04:22Z INFO Message too large (smtp.message-too-large) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.208.42, remotePort = 48510
2026-07-01T09:04:22Z INFO Message too large (smtp.message-too-large) listenerId = “smtp”, localPort = 25, remoteIp = 209.85.218.42, remotePort = 48616
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
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