Mail backend fixes
This commit is contained in:
parent
e3ce126fd4
commit
6a52e99d10
14
TODO.md
14
TODO.md
|
@ -16,7 +16,7 @@ TODO
|
||||||
* move invoice contact to invoices app?
|
* move invoice contact to invoices app?
|
||||||
* PHPbBckendMiixin with get_php_ini
|
* PHPbBckendMiixin with get_php_ini
|
||||||
* Apache: `IncludeOptional /etc/apache2/extra-vhos[t]/account-site-custom.con[f]`
|
* Apache: `IncludeOptional /etc/apache2/extra-vhos[t]/account-site-custom.con[f]`
|
||||||
* rename account.user to primary_user
|
* rename account.user to main_user
|
||||||
* webmail identities and addresses
|
* webmail identities and addresses
|
||||||
* cached -> cached_property
|
* cached -> cached_property
|
||||||
* user.roles.mailbox its awful when combined with addresses:
|
* user.roles.mailbox its awful when combined with addresses:
|
||||||
|
@ -115,3 +115,15 @@ Remember that, as always with QuerySets, any subsequent chained methods which im
|
||||||
- system users are independent users, so they can have different passwords and all.
|
- system users are independent users, so they can have different passwords and all.
|
||||||
|
|
||||||
* take a look icons from ajenti ;)
|
* take a look icons from ajenti ;)
|
||||||
|
|
||||||
|
|
||||||
|
* Disable services is_active should be computed on the fly in order to distinguish account.is_active from service.is_active when reactivation.
|
||||||
|
* Perhaps it is time to create a ServiceModel ?
|
||||||
|
|
||||||
|
|
||||||
|
* COpy account.main_user.username to account.name for performance
|
||||||
|
|
||||||
|
* service backend execution dependency? first create user on NIS master then create directories on service server
|
||||||
|
|
||||||
|
* prevent deletion of main user by the user itself
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class MailboxAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
||||||
list_filter = ('use_custom_filtering', HasAddressListFilter)
|
list_filter = ('use_custom_filtering', HasAddressListFilter)
|
||||||
add_fieldsets = (
|
add_fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'fields': ('account', 'name'),
|
'fields': ('account', 'name', 'password'),
|
||||||
}),
|
}),
|
||||||
(_("Filtering"), {
|
(_("Filtering"), {
|
||||||
'fields': ('use_custom_filtering', 'custom_filtering'),
|
'fields': ('use_custom_filtering', 'custom_filtering'),
|
||||||
|
|
|
@ -55,10 +55,10 @@ class MailSystemUserBackend(ServiceController):
|
||||||
self.append("rm -fr %(home)s" % context)
|
self.append("rm -fr %(home)s" % context)
|
||||||
|
|
||||||
def get_context(self, mailbox):
|
def get_context(self, mailbox):
|
||||||
user = mailbox.user
|
|
||||||
context = {
|
context = {
|
||||||
'username': user.username,
|
'name': mailbox.nam,
|
||||||
'password': user.password if user.is_active else '*%s' % user.password,
|
'username': mailbox.name,
|
||||||
|
'password': mailbox.password if mailbox.is_active else '*%s' % mailbox.password,
|
||||||
'group': self.DEFAULT_GROUP
|
'group': self.DEFAULT_GROUP
|
||||||
}
|
}
|
||||||
context['home'] = settings.EMAILS_HOME % context
|
context['home'] = settings.EMAILS_HOME % context
|
||||||
|
|
|
@ -13,6 +13,7 @@ class Mailbox(models.Model):
|
||||||
"@/./+/-/_ only."),
|
"@/./+/-/_ only."),
|
||||||
validators=[RegexValidator(r'^[\w.@+-]+$',
|
validators=[RegexValidator(r'^[\w.@+-]+$',
|
||||||
_("Enter a valid mailbox name."), 'invalid')])
|
_("Enter a valid mailbox name."), 'invalid')])
|
||||||
|
password = models.CharField(_("password"), max_length=128)
|
||||||
account = models.ForeignKey('accounts.Account', verbose_name=_("account"),
|
account = models.ForeignKey('accounts.Account', verbose_name=_("account"),
|
||||||
related_name='mailboxes')
|
related_name='mailboxes')
|
||||||
use_custom_filtering = models.BooleanField(_("Use custom filtering"),
|
use_custom_filtering = models.BooleanField(_("Use custom filtering"),
|
||||||
|
@ -20,6 +21,7 @@ class Mailbox(models.Model):
|
||||||
custom_filtering = models.TextField(_("filtering"), blank=True,
|
custom_filtering = models.TextField(_("filtering"), blank=True,
|
||||||
validators=[validators.validate_sieve],
|
validators=[validators.validate_sieve],
|
||||||
help_text=_("Arbitrary email filtering in sieve language."))
|
help_text=_("Arbitrary email filtering in sieve language."))
|
||||||
|
is_active = models.BooleanField(_("is active"), default=True)
|
||||||
# addresses = models.ManyToManyField('mails.Address',
|
# addresses = models.ManyToManyField('mails.Address',
|
||||||
# verbose_name=_("addresses"),
|
# verbose_name=_("addresses"),
|
||||||
# related_name='mailboxes', blank=True)
|
# related_name='mailboxes', blank=True)
|
||||||
|
|
|
@ -3,7 +3,7 @@ from django.conf import settings
|
||||||
|
|
||||||
EMAILS_DOMAIN_MODEL = getattr(settings, 'EMAILS_DOMAIN_MODEL', 'domains.Domain')
|
EMAILS_DOMAIN_MODEL = getattr(settings, 'EMAILS_DOMAIN_MODEL', 'domains.Domain')
|
||||||
|
|
||||||
EMAILS_HOME = getattr(settings, 'EMAILS_HOME', '/var/vmail/%(account)s/%(name)s/')
|
EMAILS_HOME = getattr(settings, 'EMAILS_HOME', '/home/%(username)s/')
|
||||||
|
|
||||||
EMAILS_SIEVETEST_PATH = getattr(settings, 'EMAILS_SIEVETEST_PATH', '/dev/shm')
|
EMAILS_SIEVETEST_PATH = getattr(settings, 'EMAILS_SIEVETEST_PATH', '/dev/shm')
|
||||||
|
|
||||||
|
|
|
@ -17,5 +17,6 @@ class POSIX(models.Model):
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return str(self.user)
|
return str(self.user)
|
||||||
|
|
||||||
|
# TODO groups
|
||||||
|
|
||||||
roles.register('posix', POSIX)
|
roles.register('posix', POSIX)
|
||||||
|
|
|
@ -21,3 +21,13 @@ wget -O - http://apt.baruwa.org/baruwa-apt-keys.gpg | apt-key add -
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install mailscanner
|
apt-get install mailscanner
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
apt-get install dovecot-core dovecot-imapd dovecot-pop3d dovecot-sieve
|
||||||
|
apt-get install postfix
|
||||||
|
|
||||||
|
|
||||||
|
mail_location = maildir:~/Maildir
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue