mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
wip: amavis sql schema upgrade
* The *local* field from the *users* table was removed because it is commented out by default in README.sql* files * We now use msgrcpt.content instead of msgs.content to reflect per-recipient settings see #287
This commit is contained in:
@@ -138,7 +138,7 @@ You are free to change the frequency.
|
||||
.. note::
|
||||
|
||||
If you want to let users release their messages alone (not
|
||||
recommanded), change the value of the ``USER_CAN_RELEASE`` parameter
|
||||
recommended), change the value of the ``USER_CAN_RELEASE`` parameter
|
||||
into the admin panel.
|
||||
|
||||
Self-service mode
|
||||
|
||||
@@ -36,7 +36,7 @@ class Amavis(ModoExtension):
|
||||
except Users.DoesNotExist:
|
||||
p = Policy.objects.create(policy_name=dom.name)
|
||||
Users.objects.create(email="@%s" % dom.name, fullname=dom.name,
|
||||
local="1", priority=7, policy=p)
|
||||
priority=7, policy=p)
|
||||
|
||||
def load(self):
|
||||
parameters.register_admin(
|
||||
@@ -100,7 +100,7 @@ def on_create_domain(user, domain):
|
||||
from models import Users, Policy
|
||||
p = Policy.objects.create(policy_name=domain.name)
|
||||
Users.objects.create(email="@%s" % domain.name, fullname=domain.name,
|
||||
local="1", priority=7, policy=p)
|
||||
priority=7, policy=p)
|
||||
|
||||
@events.observe("DomainModified")
|
||||
def on_domain_modified(domain):
|
||||
|
||||
@@ -126,7 +126,6 @@ class Migration(SchemaMigration):
|
||||
'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
|
||||
'fullname': ('django.db.models.fields.CharField', [], {'max_length': '765', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'local': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
|
||||
'policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['amavis.Policy']"}),
|
||||
'priority': ('django.db.models.fields.IntegerField', [], {})
|
||||
},
|
||||
|
||||
@@ -197,7 +197,6 @@ class Migration(DataMigration):
|
||||
'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
|
||||
'fullname': ('django.db.models.fields.CharField', [], {'max_length': '765', 'blank': 'True'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'local': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
|
||||
'policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['amavis.Policy']"}),
|
||||
'priority': ('django.db.models.fields.IntegerField', [], {})
|
||||
},
|
||||
|
||||
@@ -169,7 +169,6 @@ class Users(models.Model):
|
||||
policy = models.ForeignKey(Policy)
|
||||
email = models.CharField(unique=True, max_length=255)
|
||||
fullname = models.CharField(max_length=765, blank=True)
|
||||
local = models.CharField(max_length=3, blank=True)
|
||||
class Meta:
|
||||
db_table = u'users'
|
||||
managed = False
|
||||
|
||||
@@ -70,7 +70,7 @@ class SQLconnector(MBconnector):
|
||||
"subject" : qm.mail.subject,
|
||||
"mailid" : qm.mail_id,
|
||||
"date" : qm.mail.time_num,
|
||||
"type" : qm.mail.content}
|
||||
"type" : rcpt.content}
|
||||
if rcpt.rs == '':
|
||||
m["class"] = "unseen"
|
||||
elif rcpt.rs == 'R':
|
||||
|
||||
Reference in New Issue
Block a user