Maximum date range exceeded (max: 5 years), Build
Problem reported by George Rauscher - 10/28/2025 at 5:36 AM
Not A Problem

Subject: Reports module not loading after update – “Maximum date range exceeded (max: 5 years)”

SmarterMail Build 9427
(October 23, 2025)

Hi,

since updating SmarterMail last night to the latest build (October 28, 2025), I can no longer access any reports.

Every section under Reports (Protocol, Outbound Messages, Server Health, etc.) immediately shows the error:

“Maximum date range exceeded (max: 5 years)"


and the frontend freezes with the loading spinner. This happens across all browsers and devices.

I’m running SmarterMail on Linux, and the issue started right after the update. Before that, the reports worked fine.

Is this a known bug in the current build?

Is there any workaround or configuration file I can edit to reset the default report date range so I can access reports again?


Thanks in advance for your help,
George

George A. RauscherMember of the German Society for Criminology (Deutsche Gesellschaft für Kriminalistik e. V.)Member of "LEVA" Law Enforcement and Emergency Services Video Association, Inc.intelligent piXel GmbHExperts in forensic criminologyEnzianstr. 4a82319 Starnberg0800 - 999 8 99 88 (free*)Website: www.intelligent-pixel.comManaging Director: George A. RauscherAuthorized Representative: Dr. Louise MorgottTax Number: 143 / 150 / 31010HRB 207 679 / Munich Local Court
George Rauscher Replied
UPDATE - After thorough server investigation:

I've performed a complete system check and can confirm the following:

SYSTEM VERIFICATION:
✓ System locale unchanged: en_US.UTF-8 (verified via 'locale' command)
✓ /etc/default/locale contains: LANG=en_US.UTF-8, LANGUAGE=en_US.UTF-8
✓ No locale changes in system history
✓ All other SmarterMail services running normally (SMTP, IMAP, POP, Webmail)
✓ Stats files are being generated correctly (2.7MB in /etc/smartermail/Stats/)
✓ Service restarts cleanly but error persists on every startup
✓ Disk space: 50% usage, no storage issues
✓ No changes to system configuration before or after the update

ERROR CONSISTENCY:
- The systemEncoding error appears TWICE in the log on every service start
- Occurs immediately after "SmarterMail Starting" message
- Happens before any user interaction with the reports module
- The error is written by the MailService process itself during initialization

FRONTEND VS BACKEND:
- Frontend error "Maximum date range exceeded (max: 5 years)" is misleading
- Backend logs show NO date range validation errors
- The actual problem: Report API endpoints return HTTP 500 (Internal Server Error)
- The systemEncoding validation fails → Reports API crashes → Frontend shows 
  generic "date range exceeded" error as fallback

TIMELINE:
- October 27, 22:58 UTC: Updated to build 9427
- October 28, immediately after: Reports completely broken
- No other changes made to the system

CONCLUSION:
This appears to be a regression bug in build 9427's systemEncoding validation 
logic that affects Linux installations. The validation incorrectly flags the 
system encoding as "changed" even though it has been stable since installation.

The Windows-specific error message ("changing Windows locale") on a Linux system 
suggests the encoding validation code may not properly handle Linux environments.

Is there a way to disable this validation or can we expect a hotfix soon?
George A. RauscherMember of the German Society for Criminology (Deutsche Gesellschaft für Kriminalistik e. V.)Member of "LEVA" Law Enforcement and Emergency Services Video Association, Inc.intelligent piXel GmbHExperts in forensic criminologyEnzianstr. 4a82319 Starnberg0800 - 999 8 99 88 (free*)Website: www.intelligent-pixel.comManaging Director: George A. RauscherAuthorized Representative: Dr. Louise MorgottTax Number: 143 / 150 / 31010HRB 207 679 / Munich Local Court
Derek Curtis Replied
Employee Post
Hi, George. I created a ticket on this. We'll do some testing on our end and see if it's a bug. Thanks for reporting it. 
Derek Curtis COO SmarterTools Inc. www.smartertools.com
George Rauscher Replied
Thank you, Derek 
George A. RauscherMember of the German Society for Criminology (Deutsche Gesellschaft für Kriminalistik e. V.)Member of "LEVA" Law Enforcement and Emergency Services Video Association, Inc.intelligent piXel GmbHExperts in forensic criminologyEnzianstr. 4a82319 Starnberg0800 - 999 8 99 88 (free*)Website: www.intelligent-pixel.comManaging Director: George A. RauscherAuthorized Representative: Dr. Louise MorgottTax Number: 143 / 150 / 31010HRB 207 679 / Munich Local Court
George Rauscher Replied
Good news, Derek: I found the root cause after several hours of digging through my systemd configs and bash history. Turns out this was 100% on my end, not a SmarterMail bug. I'm honestly relieved and a bit embarrassed at the same time.

Here's what happened:
About two weeks ago (October 15th), I was troubleshooting some systemEncoding errors in the logs and added an environment variable to the systemd service configuration in an attempt to fix it. Specifically, I added this line to /etc/systemd/system/smartermail.service.d/override.conf:

Environment=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

At the time, the Reports module was still working fine (this was before the 9427 update). Fast forward to October 27th when SmarterMail updated to Build 9427, and suddenly all Reports started throwing HTTP 500 errors with that misleading "Maximum date range exceeded" message on the frontend.

I spent hours looking at logs, checking disk space, verifying locale settings, examining the Stats folder, and everything looked perfectly fine. The systemEncoding error was still in the logs occasionally, so I never connected the dots that my "fix" from two weeks earlier was actually causing the Reports crash.

Tonight I was reviewing my change history and noticed the locale modifications from October 15th. That's when I found the DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 flag buried in the systemd override config. As soon as I removed that single line and restarted the service, every single Report came back online immediately. Problem completely solved.

So what happened: Build 9427 apparently has stricter requirements or different handling for the globalization settings. The DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 flag disables all .NET globalization features, which Build 9427 seems to need for the Reports API. Earlier builds must have been more tolerant of this configuration.

Your fresh Ubuntu 22.04 test obviously didn't have this custom environment variable, which is exactly why you couldn't replicate it. The server itself was perfectly configured, it was just that one stray environment variable from my previous troubleshooting session that was breaking things.

Lesson learned: I'm going to be way more careful about adding environment variables to production services and will definitely document these kinds of changes better going forward. Also going to think twice before trying to "fix" .NET runtime behaviors without fully understanding the implications.

Sorry for the wild goose chase and for taking up your time with this. I should have checked my own customizations more thoroughly before opening the ticket. The good news is everything is running smoothly now, and I know exactly what not to do in the future.

Thanks again for your patience and for the reboot suggestion (which actually did end up being part of the solution after removing that environment variable). You guys have been great through this whole process.

All the best,
George Rauscher
intelligent piXel GmbH

PS: For anyone else who might run into this, if your Reports suddenly stop working after an update, check your systemd override configs for any DOTNET_* environment variables. They might have worked fine in older builds but can cause issues with newer releases.
George A. RauscherMember of the German Society for Criminology (Deutsche Gesellschaft für Kriminalistik e. V.)Member of "LEVA" Law Enforcement and Emergency Services Video Association, Inc.intelligent piXel GmbHExperts in forensic criminologyEnzianstr. 4a82319 Starnberg0800 - 999 8 99 88 (free*)Website: www.intelligent-pixel.comManaging Director: George A. RauscherAuthorized Representative: Dr. Louise MorgottTax Number: 143 / 150 / 31010HRB 207 679 / Munich Local Court
Derek Curtis Replied
Employee Post
Appreciate you updating the thread, George. And congrats on figuring it out!
Derek Curtis COO SmarterTools Inc. www.smartertools.com

Reply to Thread

Enter the verification text