[GH-ISSUE #3779] security.W001 (django.middleware.security.SecurityMiddleware) and fields.W342 (ForeignKey(unique=True) is usually better served by a OneToOneField) #1905

Closed
opened 2026-02-27 11:19:49 +03:00 by kerem · 2 comments
Owner

Originally created by @linuxmaster on GitHub (Nov 3, 2025).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3779

Impacted versions

  • OS Type: Ubuntu
    OS Version: 24.04
  • Database Type: PostgreSQL
  • Database version: 16
  • Modoboa: 2.6.2
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

python manage.py check --deploy
WARNINGS:
?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect.
amavis.Msgrcpt.mail: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
        HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
amavis.Quarantine.mail: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
        HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.

Current behavior

Amavis does not work right (amavis management in web interface does not effect on amavis service). Maybe fixing this will help.

Expected behavior

No errors and warnings...

Originally created by @linuxmaster on GitHub (Nov 3, 2025). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3779 # Impacted versions * OS Type: Ubuntu OS Version: 24.04 * Database Type: PostgreSQL * Database version: 16 * Modoboa: 2.6.2 * installer used: Yes * Webserver: Nginx # Steps to reproduce ``` python manage.py check --deploy WARNINGS: ?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settings will have no effect. amavis.Msgrcpt.mail: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. amavis.Quarantine.mail: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. ``` # Current behavior Amavis does not work right (amavis management in web interface does not effect on amavis service). Maybe fixing this will help. <!-- How to fix this warnings and do not break modoboa? --> # Expected behavior No errors and warnings...
kerem 2026-02-27 11:19:49 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jan 8, 2026):

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

<!-- gh-comment-id:3721694962 --> @github-actions[bot] commented on GitHub (Jan 8, 2026): This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

This issue was closed because it has been stalled for 14 days with no activity.

<!-- gh-comment-id:3782301860 --> @github-actions[bot] commented on GitHub (Jan 22, 2026): This issue was closed because it has been stalled for 14 days with no activity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1905
No description provided.