Postfix's Transport Encryption under Control of the User
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from django.db import models
  2. from django.contrib.auth.models import AbstractUser
  3. class User(AbstractUser):
  4. """
  5. Custom User Model
  6. see: Two Scoops of Django, page 258
  7. see: https://www.youtube.com/watch?v=0bAJV0zNWQw
  8. """
  9. pass
  10. class TLSNotification(models.Model):
  11. """Log entries for notifications"""
  12. queue_id = models.CharField('Queue ID', max_length=20)
  13. notification = models.DateTimeField('Notification') # Time of the last notification
  14. def __str__(self):
  15. return self.queue_id
  16. class TLSLogEntry(models.Model):
  17. """Log entries for handled mails (forwarded/deleted)"""
  18. queue_id = models.CharField('Queue ID', max_length=20)
  19. sender = models.CharField('Sender', max_length=255)
  20. recipients = models.CharField('Recipients', max_length=255, null=True)
  21. action = models.CharField('Action', max_length=100)
  22. date = models.DateTimeField('Date')
  23. def __str__(self):
  24. return self.queue_id
  25. class MandatoryTLSDomains(models.Model):
  26. """For these domains the user shouln't be allowed to send emails unencrypted"""
  27. domain = models.CharField('Domain', max_length=100)
  28. def __str__(self):
  29. return self.domain