Handle message size limits on SMTP
Open
Nobody has claimed this yet.
1. to develop
bug
feature parity
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Have a server with a message size restriction, e.g. 10MB
- Send email with a 11.5MB attachment
Expected behavior
Message is sent
Actual behavior
https://nextcloud-gmbh.sentry.io/issues/4032642026
Horde_Smtp_Exception: Message size exceeds fixed limit
#14 /mail/vendor/nextcloud/horde-smtp/lib/Horde/Smtp.php(1076): Horde_Smtp::_getResponse
#13 /mail/vendor/nextcloud/horde-smtp/lib/Horde/Smtp.php(659): Horde_Smtp::send
#12 /mail/vendor/bytestream/horde-mail/lib/Horde/Mail/Transport/Smtphorde.php(143): Horde_Mail_Transport_Smtphorde::send
#11 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Part.php(1620): Horde_Mime_Part::send
#10 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Mail.php(479): Horde_Mime_Mail::send
#9 /mail/lib/Service/MailTransmission.php(272): OCA\Mail\Service\MailTransmission::sendMessage
#8 /mail/lib/Service/MailTransmission.php(344): OCA\Mail\Service\MailTransmission::sendLocalMessage
#7 /mail/lib/Service/OutboxService.php(142): OCA\Mail\Service\OutboxService::sendMessage
#6 /mail/lib/Controller/OutboxController.php(227): OCA\Mail\Controller\OutboxController::send
#5 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OC\AppFramework\Http\Dispatcher::executeController
#4 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher::dispatch
#3 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\App::main
#2 /var/www/cloud.domain.com/nextcloud/lib/private/Route/Router.php(315): OC\Route\Router::match
#1 /var/www/cloud.domain.com/nextcloud/lib/base.php(1052): OC::handleRequest
#0 /var/www/cloud.domain.com/nextcloud/index.php(36): null
Horde_Mail_Exception: Message size exceeds fixed limit
#12 /mail/vendor/bytestream/horde-mail/lib/Horde/Mail/Transport/Smtphorde.php(145): Horde_Mail_Transport_Smtphorde::send
#11 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Part.php(1620): Horde_Mime_Part::send
#10 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Mail.php(479): Horde_Mime_Mail::send
#9 /mail/lib/Service/MailTransmission.php(272): OCA\Mail\Service\MailTransmission::sendMessage
#8 /mail/lib/Service/MailTransmission.php(344): OCA\Mail\Service\MailTransmission::sendLocalMessage
#7 /mail/lib/Service/OutboxService.php(142): OCA\Mail\Service\OutboxService::sendMessage
#6 /mail/lib/Controller/OutboxController.php(227): OCA\Mail\Controller\OutboxController::send
#5 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OC\AppFramework\Http\Dispatcher::executeController
#4 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher::dispatch
#3 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\App::main
#2 /var/www/cloud.domain.com/nextcloud/lib/private/Route/Router.php(315): OC\Route\Router::match
#1 /var/www/cloud.domain.com/nextcloud/lib/base.php(1052): OC::handleRequest
#0 /var/www/cloud.domain.com/nextcloud/index.php(36): null
Horde_Mime_Exception: Message size exceeds fixed limit
#11 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Part.php(1642): Horde_Mime_Part::send
#10 /mail/vendor/bytestream/horde-mime/lib/Horde/Mime/Mail.php(479): Horde_Mime_Mail::send
#9 /mail/lib/Service/MailTransmission.php(272): OCA\Mail\Service\MailTransmission::sendMessage
#8 /mail/lib/Service/MailTransmission.php(344): OCA\Mail\Service\MailTransmission::sendLocalMessage
#7 /mail/lib/Service/OutboxService.php(142): OCA\Mail\Service\OutboxService::sendMessage
#6 /mail/lib/Controller/OutboxController.php(227): OCA\Mail\Controller\OutboxController::send
#5 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OC\AppFramework\Http\Dispatcher::executeController
#4 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher::dispatch
#3 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\App::main
#2 /var/www/cloud.domain.com/nextcloud/lib/private/Route/Router.php(315): OC\Route\Router::match
#1 /var/www/cloud.domain.com/nextcloud/lib/base.php(1052): OC::handleRequest
#0 /var/www/cloud.domain.com/nextcloud/index.php(36): null
OCA\Mail\Exception\ServiceException: Could not send message: Message size exceeds fixed limit
#9 /mail/lib/Service/MailTransmission.php(274): OCA\Mail\Service\MailTransmission::sendMessage
#8 /mail/lib/Service/MailTransmission.php(344): OCA\Mail\Service\MailTransmission::sendLocalMessage
#7 /mail/lib/Service/OutboxService.php(142): OCA\Mail\Service\OutboxService::sendMessage
#6 /mail/lib/Controller/OutboxController.php(227): OCA\Mail\Controller\OutboxController::send
#5 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OC\AppFramework\Http\Dispatcher::executeController
#4 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher::dispatch
#3 /var/www/cloud.domain.com/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\App::main
#2 /var/www/cloud.domain.com/nextcloud/lib/private/Route/Router.php(315): OC\Route\Router::match
#1 /var/www/cloud.domain.com/nextcloud/lib/base.php(1052): OC::handleRequest
#0 /var/www/cloud.domain.com/nextcloud/index.php(36): null
Mail app version
3.0.0
Mailserver or service
No response
Operating system
No response
PHP engine version
None
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.
Research direction
Start in lib/Service/MailTransmission.php, following the send flow through OutboxService and OutboxController; the reported stack trace identifies these entry points and the Horde SMTP and MIME layers involved. Reproduce the 10 MB server limit with an oversized attachment, then determine the intended handling for the size exception and verify that sending produces the appropriate result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100