Skip to content

Conversation

@0x46616c6b
Copy link
Member

@0x46616c6b 0x46616c6b commented Jan 5, 2026

This pull request introduces configurable SMTP quota limits at both the global (settings), user, and alias levels, allowing administrators to restrict the number of emails sent per hour and per day. It adds support for these limits in the backend, exposes them via a new API endpoint, and updates the admin UI and translations accordingly. Comprehensive tests are included to ensure correct behavior.

SMTP Quota Limit Functionality

  • Added global settings for smtp_quota_limit_per_hour and smtp_quota_limit_per_day, including validation and display in the settings UI. [1] [2] [3]
  • Extended the User and Alias entities to support custom SMTP quota limits, with corresponding getter/setter methods and database mapping. [1] [2] [3] [4]
  • Introduced the reusable form type SmtpQuotaLimitsType for editing quota limits, and integrated it into the admin forms for users and aliases. [1] [2] [3] [4] [5]

API and Backend Enhancements

  • Added a new API endpoint /api/postfix/quota/{email} to retrieve the effective SMTP quota limits for a user or alias, defaulting to global settings if no custom limits are set. [1] [2] [3]
Bildschirmfoto am 2026-01-05 um 22 15 07 Bildschirmfoto am 2026-01-05 um 22 14 42 Bildschirmfoto am 2026-01-05 um 22 14 30

@0x46616c6b 0x46616c6b added the enhancement New feature or request label Jan 5, 2026

smtp_quota_limit_per_minute:
type: integer
default: 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to define some sensible defaults?

->add('passwordChangeRequired', CheckboxType::class, [
]);

if ($this->security->isGranted(Roles::ADMIN)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only admins can set that per user, domain admins will not see that setting

@0x46616c6b 0x46616c6b force-pushed the Introduce-configurable-sending-quotas branch from 47800ea to d240042 Compare January 5, 2026 21:13
@0x46616c6b 0x46616c6b force-pushed the Introduce-configurable-sending-quotas branch from d240042 to 2bd2b11 Compare January 5, 2026 21:30
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants