Scheduled send fails in Mail 5.8.0: `MimeMessage::build()` Argument #3 must be bool, array given
@kesselb is already working on this.
Since May 26, 2026.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
Scheduled send fails in Mail 5.8.0: MimeMessage::build() Argument #3 must be bool, array given
Summary
Scheduled sending does not work in Nextcloud Mail 5.8.0.
The global Nextcloud cron works correctly. The Mail OutboxWorkerJob is registered, runs normally, and executes after the scheduled send time. However, the scheduled message is not sent because OutboxWorkerJob fails with a TypeError in MimeMessage::build().
Immediate/manual sending from the Mail UI works.
Environment
- Nextcloud AIO
- Nextcloud AIO version:
13.0.4 - Nextcloud version:
33.0.3 - Mail app version:
5.8.0 - Background jobs mode:
Cron - User timezone:
Europe/Bratislava - Server/container time: correct
- No Mail app update is currently available through OCC/App Store
What I tested
The test message was scheduled for:
21:55 CEST
UTC equivalent:
19:55 UTC
The Mail outbox background job ran after the scheduled time:
OCA\Mail\BackgroundJob\OutboxWorkerJob
Last executed: 2026-05-19T19:57:34+00:00
So the job clearly ran after the message should have been sent.
The message was a plain text test email without attachments.
Mail background job exists and runs
| 82495485209419777 | OCA\Mail\BackgroundJob\OutboxWorkerJob | 2026-05-19T19:57:34+00:00 | null |
Manual execution of the job also works:
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ background-job:execute --force-execute 82495485209419777
Output:
Job class: OCA\Mail\BackgroundJob\OutboxWorkerJob
Arguments: null
Type: timed
Forcing execution of the job
Job executed!
Timezone checks
Host local time:
Tue May 19 09:49:21 PM CEST 2026
Host UTC time:
Tue May 19 07:49:21 PM UTC 2026
User timezone:
Europe/Bratislava
Nextcloud system default timezone:
Europe/Bratislava
The OutboxWorkerJob timestamp is in UTC and matches the expected CEST offset. This does not look like a timezone or cron scheduling issue.
Error from nextcloud.log
At the time when the scheduled message should have been processed, this error appears:
Could not send outbox message 101: OCA\Mail\Service\MimeMessage::build(): Argument #3 ($isPgpEncrypted) must be of type bool, array given, called in /var/www/html/custom_apps/mail/lib/Service/MailTransmission.php on line 138
Relevant part of the trace:
OCA\Mail\Service\MimeMessage->build(
"Skusobny email\n--\u00a0\u00a0\nTony Kraj\u010d\u00edk\n+421 949 731110\n\u00a0",
null,
[],
false
)
The third argument passed to MimeMessage::build() is an array [], but the method expects a boolean $isPgpEncrypted.
Full relevant log entry
{
"level": 2,
"time": "2026-05-19T19:57:34+00:00",
"app": "mail",
"scriptName": "occ",
"message": "Could not send outbox message 101: OCA\\Mail\\Service\\MimeMessage::build(): Argument #3 ($isPgpEncrypted) must be of type bool, array given, called in /var/www/html/custom_apps/mail/lib/Service/MailTransmission.php on line 138",
"version": "33.0.3.2",
"occ_command": [
"occ",
"background-job:worker"
],
"exception": {
"Exception": "TypeError",
"Message": "OCA\\Mail\\Service\\MimeMessage::build(): Argument #3 ($isPgpEncrypted) must be of type bool, array given, called in /var/www/html/custom_apps/mail/lib/Service/MailTransmission.php on line 138",
"File": "/var/www/html/custom_apps/mail/lib/Service/MimeMessage.php",
"Line": 35
}
}
Available Mail OCC commands
There does not seem to be a dedicated OCC command to repair or process the Mail outbox / scheduled-send queue.
mail:account:create
mail:account:debug
mail:account:delete
mail:account:diagnose
mail:account:export
mail:account:export-threads
mail:account:sync
mail:account:train
mail:account:update
mail:clean-up
mail:repair:system-autoresponders
mail:repair:tags
mail:tags:migration-jobs
mail:thread
Expected behavior
The scheduled email should be sent by OCA\Mail\BackgroundJob\OutboxWorkerJob after the scheduled time.
Actual behavior
The scheduled email is not sent.
OutboxWorkerJob runs, but fails with:
MimeMessage::build(): Argument #3 ($isPgpEncrypted) must be of type bool, array given
Conclusion
This looks like a bug/regression in the scheduled send / outbox processing path in Nextcloud Mail 5.8.0.
The job runs correctly, but MailTransmission.php appears to call MimeMessage::build() with arguments in the wrong order or with the wrong type.
Immediate sending through the UI works, but scheduled sending through OutboxWorkerJob fails.
Expected behavior
reported above
Actual behavior
reported above
Mail app version
5.8.0
Nextcloud version
33.0.3
Mailserver or service
No response
Operating system
Nextcloud AIO - Ububtu server 24.0.4
PHP engine version
None
Nextcloud memory caching
No response
Web server
None
Database
None
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.