Platform
macOS
Operating system version
Tahoe 26.3.1
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.28.0
PHP Version
PHP 8.4
Bug description
When sending an email via the Herd Mail SMTP server (port 2525) using a raw socket connection (e.g., basic PHP fsockopen), the Mailserver process crashes if the Date header is missing or malformed.
Steps to reproduce
Steps to Reproduce
- Start the Herd Mail service.
- Send a raw SMTP
DATA command payload that does not include a Date: header.
- The Node.js process for the mailserver will crash immediately with the above error.
Expected Behavior
- Automatically inject a valid
Date header if missing
- Fail gracefully with an SMTP error code rather than an uncaught Node.js exception that kills the service.
To solve it locally I popped in a date header, e.g: 'Date' => date('r'),
Log output
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at ensureMessageTypes (/snapshot/herd-mailserver/lib/ensureMessageTypes.js)
at /snapshot/herd-mailserver/index.js
Platform
macOS
Operating system version
Tahoe 26.3.1
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.28.0
PHP Version
PHP 8.4
Bug description
When sending an email via the Herd Mail SMTP server (port 2525) using a raw socket connection (e.g., basic PHP
fsockopen), the Mailserver process crashes if theDateheader is missing or malformed.Steps to reproduce
Steps to Reproduce
DATAcommand payload that does not include aDate:header.Expected Behavior
Dateheader if missingTo solve it locally I popped in a date header, e.g:
'Date' => date('r'),Log output