Your question
Hi, I’m new to Stalwart. I’ve only been running my server for a couple of weeks. I’m planning my first update. My server is currently running v0.16.20 and I’m going to update it to v0.16.23. I was hoping that if I share my update plan here with the community that others can verify that my plan is solid. Hope that’s OK!
BTW, I need to update to v0.16.23 to resolve this issue:
Stalwart support has confirmed that the bug was fixed in v0.16.23:
“0.16.23 was released on 21 September. The bug was in POP3 TOP, which Apple Mail uses to fetch headers and previews: it counted the requested lines from the first byte of the message, headers included, and reported the full size even for a partial answer. Messages Apple Mail already downloaded in that state may stay empty, so test with new HTML mail after upgrading. If the old ones are still blank, removing and re-adding the account (with mail left on the server) makes it fetch them again.”
My Stalwart server is running on macOS 26.6.2. Not using Docker.
Here’s my plan, please let me know if I’m missing anything. THANKS!
UPDATE STEPS v0.16.20 to v0.16.23
- Verify the current installation version.
stalwart --version
which stalwart
ps -ef | grep ‘[s]talwart’
sudo launchctl print system/stalwart
- Create rollback copy of the v0.16.20 binary.
sudo cp -p /usr/local/bin/stalwart /usr/local/bin/stalwart-0.16.20
- Verify the rollback copy of the binary exists and works.
ls -lh /usr/local/bin/stalwart /usr/local/bin/stalwart-0.16.20
/usr/local/bin/stalwart-0.16.20 --version
;Expected output:
;0.16.20
- Download the Stalwart v0.16.23 binary.
mkdir -p ~/stalwart-0.16.23
cd ~/stalwart-0.16.23
curl -L -O https://github.com/stalwartlabs/stalwart/releases/download/v0.16.23/stalwart-aarch64-apple-darwin.tar.gz
- Verify the download was successful.
ls -lh stalwart-aarch64-apple-darwin.tar.gz
shasum -a 256 stalwart-aarch64-apple-darwin.tar.gz
;Expected SHA-256 output:
;ccab39449b63443f62c433af8baf95e8317c9a7dea993d84e588b2900372414e
- Extract and verify the new Stalwart binary.
tar -xzf stalwart-aarch64-apple-darwin.tar.gz
~/stalwart-0.16.23/stalwart --version
file ~/stalwart-0.16.23/stalwart
;Expected output:
;0.16.23
;Mach-O 64-bit executable arm64
- Stop the Stalwart server.
sudo launchctl kill SIGTERM system/stalwart
sleep 5
- Verify Stalwart has stopped.
ps -ef | grep ‘[s]talwart’
;Expected:
;No output.
;IMPORTANT: If a Stalwart process is still running, stop here and investigate before continuing.
- Replace the old binary with the new binary in /usr/local/bin.
sudo cp ~/stalwart-0.16.23/stalwart /usr/local/bin/stalwart
sudo chown root:wheel /usr/local/bin/stalwart
sudo chmod 755 /usr/local/bin/stalwart
- Verify the installed version, with the new binary in place.
/usr/local/bin/stalwart --version
;Expected:
;0.16.23
- Start the Stalwart server.
sudo launchctl kickstart -k system/stalwart
sleep 5
- Verify Stalwart is running.
ps -ef | grep ‘[s]talwart’
sudo launchctl print system/stalwart
stalwart --version
;Expected:
;0.16.23
- Check the current active Stalwart log for activity.
sudo tail -50 /var/log/stalwart/stalwart.$(date +%Y-%m-%d)
;Check for any obvious errors, startup failures, configuration errors, database errors, or listener failures.
- Check the listening ports of the Stalwart server.
sudo lsof -nP -iTCP -sTCP:LISTEN | grep stalwart
- Perform some basic network port connectivity tests.
nc -vz xxxxxxxxx.net 25
nc -vz xxxxxxxxx.net 587
nc -vz xxxxxxxxx.net 993
nc -vz xxxxxxxxx.net 995
- Perform mail testing.
- Send an external test email TO a xxxxxxxxx.net account.
- Send an email FROM a xxxxxxxxx.net account to an external address.
- Send a NEW HTML-format test email to the iPhone POP3 account.
- Test POP3 on the iPhone using Apple Mail.
- Verify that the new HTML message displays correctly in Apple Mail.
;IMPORTANT: Messages that Apple Mail downloaded while the POP3 TOP bug was present may remain empty even after upgrading. If previously downloaded messages are still blank, remove and re-add the POP3 account, leaving the mail on the server, so Apple Mail downloads the messages again.
- Monitor the Stalwart log and mail delivery after the upgrade.
sudo tail -f /var/log/stalwart/stalwart.$(date +%Y-%m-%d)
;IMPORTANT: Pay particular attention to mail delivery and queued messages. I am aware of a community-reported issue involving v0.16.23 where mail delivery can stop while messages remain queued, so I want to monitor the server after the upgrade to make sure this does not occur.
- Perform another launchd status check after the mail tests.
sudo launchctl print system/stalwart | grep -E ‘state =|pid =|program =’
END OF UPDATE STEPS
ROLLBACK STEPS v0.16.23 to v0.16.20
-
If there are any issues with the new v0.16.23 binary, rollback to the old binary.
-
Stop the Stalwart server.
sudo launchctl kill SIGTERM system/stalwart
sleep 5
- Verify Stalwart has stopped.
ps -ef | grep ‘[s]talwart’
;Expected:
;No output.
- Copy the old v0.16.20 binary back to /usr/local/bin/stalwart.
sudo cp -p /usr/local/bin/stalwart-0.16.20 /usr/local/bin/stalwart
sudo chown root:wheel /usr/local/bin/stalwart
sudo chmod 755 /usr/local/bin/stalwart
- Verify the restored binary version.
/usr/local/bin/stalwart --version
;Expected:
;0.16.20
- Start the Stalwart server.
sudo launchctl kickstart -k system/stalwart
sleep 5
- Verify Stalwart is running.
ps -ef | grep ‘[s]talwart’
sudo launchctl print system/stalwart
- Verify the Stalwart version.
stalwart --version
;Expected:
;0.16.20