mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-09 22:38:19 +02:00
Adding migration for handling incoming messages; adding exim4 scripts for routing messages to django_messages.
--HG-- branch : exim4_pipe
This commit is contained in:
parent
5cf07a1c7b
commit
24c2a98d81
4 changed files with 54 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
# Changing field 'Mailbox.uri'
|
||||
db.alter_column('django_mailbox_mailbox', 'uri', self.gf('django.db.models.fields.CharField')(max_length=255, null=True))
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
# User chose to not deal with backwards NULL issues for 'Mailbox.uri'
|
||||
raise RuntimeError("Cannot reverse this migration. 'Mailbox.uri' and its values cannot be restored.")
|
||||
|
||||
models = {
|
||||
'django_mailbox.mailbox': {
|
||||
'Meta': {'object_name': 'Mailbox'},
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'uri': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'})
|
||||
},
|
||||
'django_mailbox.message': {
|
||||
'Meta': {'object_name': 'Message'},
|
||||
'body': ('django.db.models.fields.TextField', [], {}),
|
||||
'from_address': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'mailbox': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messages'", 'to': "orm['django_mailbox.Mailbox']"}),
|
||||
'message_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'received': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'subject': ('django.db.models.fields.CharField', [], {'max_length': '255'})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['django_mailbox']
|
||||
|
|
@ -24,6 +24,7 @@ class Mailbox(models.Model):
|
|||
contain illegal characters (like @, :, etc).
|
||||
""",
|
||||
blank=True,
|
||||
null=True,
|
||||
default=None,
|
||||
)
|
||||
|
||||
|
|
|
|||
6
scripts/router
Normal file
6
scripts/router
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
django_mailbox:
|
||||
debug_print = 'R: django_mailbox for $localpart@$domain"
|
||||
driver = accept
|
||||
domains = +local_domains
|
||||
transport = send_to_django_mailbox
|
||||
local_parts = emailaddressusername : anotheremailaddressusername
|
||||
8
scripts/transport
Normal file
8
scripts/transport
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
send_to_django_mailbox:
|
||||
driver = pipe
|
||||
command = /path/to/python /path/to/manage.py processincomingmessage
|
||||
user = www-data
|
||||
group = www-data
|
||||
return_path_add
|
||||
delivery_date_add
|
||||
Loading…
Add table
Add a link
Reference in a new issue