From 64307aefd3eb8ea74a3827084eb3949013d81177 Mon Sep 17 00:00:00 2001
From: Benjamin Diedrichsen
Date: Thu, 12 Mar 2015 18:35:58 +0100
Subject: [PATCH 1/9] Added examples for CSV import
I found the descriptions for the import rather confusing and needed several tries to get it to work. I think examples help.
---
modoboa/locale/en/LC_MESSAGES/django.po | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/modoboa/locale/en/LC_MESSAGES/django.po b/modoboa/locale/en/LC_MESSAGES/django.po
index 67b20d79c..a25eb7666 100644
--- a/modoboa/locale/en/LC_MESSAGES/django.po
+++ b/modoboa/locale/en/LC_MESSAGES/django.po
@@ -1394,7 +1394,11 @@ msgid ""
" %s\n"
"\n"
"The first element of each line is mandatory and must be equal to one of "
-"the previous values.
\n"
+"the previous values.Example:
\n"
+"\n"
+" domain; sample.tld; 500; true \n"
+" domainalias; alias.tdl; sample.tld; true \n"
+" \n"
"You can use a different character as separator.
\n"
msgstr ""
@@ -1423,7 +1427,12 @@ msgid ""
"dlist; address; enabled; recipient; recipient; ... \n"
"\n"
"The first element of each line is mandatory and must be equal to one of "
-"the previous values.
\n"
+"the previous values.Example:\n"
+"\n"
+" alias; somebody@sample.tld; true; somebody-else@sample.tld \n"
+" forward; nobody@sample.tld; true; somebody-else@somewhere.tld \n"
+" dlist; agroup@sample.tld; true; user1@online.tld; user12@online.tld \n"
+" \n"
"\n"
"You can use a different character as separator.
\n"
msgstr ""
From 2f47184656453fa9bb4bec248c8676b0014089fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vincent=20G=C3=A9nieux?=
Date: Sun, 29 Mar 2015 22:58:36 +0530
Subject: [PATCH 2/9] improved: webmail compose form now displays cc/cci only
when required improved: webmail compose form error messages on To field are
more clear
---
.../webmail/templates/webmail/compose.html | 47 ++++++++++++++-----
modoboa/extensions/webmail/validators.py | 2 +-
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/modoboa/extensions/webmail/templates/webmail/compose.html b/modoboa/extensions/webmail/templates/webmail/compose.html
index 06db8600f..916323b34 100644
--- a/modoboa/extensions/webmail/templates/webmail/compose.html
+++ b/modoboa/extensions/webmail/templates/webmail/compose.html
@@ -2,42 +2,67 @@
diff --git a/modoboa/extensions/webmail/validators.py b/modoboa/extensions/webmail/validators.py
index fab794a43..3ec697f0f 100644
--- a/modoboa/extensions/webmail/validators.py
+++ b/modoboa/extensions/webmail/validators.py
@@ -14,7 +14,7 @@ class EmailListValidator(object):
value = force_text(value)
emails = [unicode.strip(email) for email in value.split(",")]
addresses = getaddresses(emails)
- [validate_email(e) for r, e in addresses.values]
+ [validate_email(e) for r, e in addresses]
validate_email_list = EmailListValidator()
From ca22c6504038f86553268e0107717b9e3eb0009f Mon Sep 17 00:00:00 2001
From: Antoine Nguyen
Date: Sun, 29 Mar 2015 19:29:41 +0200
Subject: [PATCH 3/9] Fix webmail error.
---
modoboa/extensions/webmail/validators.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modoboa/extensions/webmail/validators.py b/modoboa/extensions/webmail/validators.py
index fab794a43..3ec697f0f 100644
--- a/modoboa/extensions/webmail/validators.py
+++ b/modoboa/extensions/webmail/validators.py
@@ -14,7 +14,7 @@ class EmailListValidator(object):
value = force_text(value)
emails = [unicode.strip(email) for email in value.split(",")]
addresses = getaddresses(emails)
- [validate_email(e) for r, e in addresses.values]
+ [validate_email(e) for r, e in addresses]
validate_email_list = EmailListValidator()
From 9b9a3734ff1dc9e55617cbdd706991244b4f47c8 Mon Sep 17 00:00:00 2001
From: Antoine Nguyen
Date: Wed, 1 Apr 2015 15:13:45 +0200
Subject: [PATCH 4/9] Rename license file.
fix #703
---
COPYING => LICENSE | 0
MANIFEST.in | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename COPYING => LICENSE (100%)
diff --git a/COPYING b/LICENSE
similarity index 100%
rename from COPYING
rename to LICENSE
diff --git a/MANIFEST.in b/MANIFEST.in
index 88324387f..efcdcdd0c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,4 @@
-include README.rst COPYING requirements.txt
+include README.rst LICENSE requirements.txt
recursive-include modoboa *.html *.js *.css *.png *.po *.mo *.json *.gif *.ttf *.woff
recursive-include modoboa/core/templates *.tpl
recursive-include modoboa/core/commands/templates *.tpl
From b556920af508da586756fc46d38e4828b79ce2f3 Mon Sep 17 00:00:00 2001
From: Antoine Nguyen
Date: Wed, 1 Apr 2015 15:24:31 +0200
Subject: [PATCH 5/9] Fixing factories.
---
.../postfix_relay_domains/factories.py | 20 +++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/modoboa/extensions/postfix_relay_domains/factories.py b/modoboa/extensions/postfix_relay_domains/factories.py
index 1a0c0a5a2..74400e0fb 100644
--- a/modoboa/extensions/postfix_relay_domains/factories.py
+++ b/modoboa/extensions/postfix_relay_domains/factories.py
@@ -4,14 +4,22 @@ from . import models
class ServiceFactory(factory.DjangoModelFactory):
- FACTORY_FOR = models.Service
- FACTORY_DJANGO_GET_OR_CREATE = ('name', )
+
+ """Factory to create Service instances."""
+
+ class Meta:
+ model = models.Service
+ django_get_or_create = ('name', )
name = 'dummy'
class RelayDomainFactory(PermissionFactory):
- FACTORY_FOR = models.RelayDomain
+
+ """Factory to create RelayDomain instances."""
+
+ class Meta:
+ model = models.RelayDomain
target_host = 'external.host.tld'
enabled = True
@@ -20,6 +28,10 @@ class RelayDomainFactory(PermissionFactory):
class RelayDomainAliasFactory(PermissionFactory):
- FACTORY_FOR = models.RelayDomainAlias
+
+ """Factory to create RelayDomainAliases instances."""
+
+ class Meta:
+ model = models.RelayDomainAlias
enabled = True
From 256014b20377c4039d36ca092a39b34bf85d2e28 Mon Sep 17 00:00:00 2001
From: Antoine Nguyen
Date: Wed, 8 Apr 2015 16:35:30 +0200
Subject: [PATCH 6/9] Fix wrong attribute name.
---
modoboa/extensions/webmail/templates/webmail/compose.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modoboa/extensions/webmail/templates/webmail/compose.html b/modoboa/extensions/webmail/templates/webmail/compose.html
index 916323b34..9f649823b 100644
--- a/modoboa/extensions/webmail/templates/webmail/compose.html
+++ b/modoboa/extensions/webmail/templates/webmail/compose.html
@@ -18,7 +18,7 @@
{# handling cc and cci buttons #}
- {% if not form.cc.value or not form.cci.valie %}
+ {% if not form.cc.value or not form.cci.value %}
{% if not form.cc.value %}
From d729ac4af833e16b32cc647a25571217eab9e562 Mon Sep 17 00:00:00 2001
From: Antoine Nguyen
Date: Wed, 8 Apr 2015 16:40:47 +0200
Subject: [PATCH 7/9] Revert "Added examples for CSV import"
---
modoboa/locale/en/LC_MESSAGES/django.po | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/modoboa/locale/en/LC_MESSAGES/django.po b/modoboa/locale/en/LC_MESSAGES/django.po
index a25eb7666..67b20d79c 100644
--- a/modoboa/locale/en/LC_MESSAGES/django.po
+++ b/modoboa/locale/en/LC_MESSAGES/django.po
@@ -1394,11 +1394,7 @@ msgid ""
" %s\n"
"\n"
"The first element of each line is mandatory and must be equal to one of "
-"the previous values.Example:
\n"
-"\n"
-" domain; sample.tld; 500; true \n"
-" domainalias; alias.tdl; sample.tld; true \n"
-" \n"
+"the previous values.\n"
"You can use a different character as separator.
\n"
msgstr ""
@@ -1427,12 +1423,7 @@ msgid ""
"dlist; address; enabled; recipient; recipient; ... \n"
"\n"
"The first element of each line is mandatory and must be equal to one of "
-"the previous values.Example:
\n"
-"\n"
-" alias; somebody@sample.tld; true; somebody-else@sample.tld \n"
-" forward; nobody@sample.tld; true; somebody-else@somewhere.tld \n"
-" dlist; agroup@sample.tld; true; user1@online.tld; user12@online.tld \n"
-" \n"
+"the previous values.\n"
"\n"
"You can use a different character as separator.
\n"
msgstr ""
From 10df752dc2eeeb642cd72c1aa41ecc6a7a0a944b Mon Sep 17 00:00:00 2001
From: Andrew Fyfe
Date: Thu, 9 Apr 2015 00:17:44 +0100
Subject: [PATCH 8/9] Gather statistics for spam and virus messages
---
modoboa/extensions/stats/graphics.py | 4 +++-
modoboa/extensions/stats/management/commands/logparser.py | 8 ++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/modoboa/extensions/stats/graphics.py b/modoboa/extensions/stats/graphics.py
index 80ca0af88..13a943085 100644
--- a/modoboa/extensions/stats/graphics.py
+++ b/modoboa/extensions/stats/graphics.py
@@ -109,8 +109,10 @@ class AverageTraffic(Graphic):
recv = Curve("recv", "steelblue", ugettext_lazy("received messages"))
bounced = Curve("bounced", "yellow", ugettext_lazy("bounced messages"))
reject = Curve("reject", "tomato", ugettext_lazy("rejected messages"))
+ virus = Curve("virus", "orange", ugettext_lazy("virus messages"))
+ spam = Curve("spam", "silver", ugettext_lazy("spam messages"))
- order = ['reject', 'bounced', 'recv', 'sent']
+ order = ['reject', 'bounced', 'recv', 'sent', 'virus', 'spam']
class AverageTrafficSize(Graphic):
diff --git a/modoboa/extensions/stats/management/commands/logparser.py b/modoboa/extensions/stats/management/commands/logparser.py
index e898d338c..7af07fa18 100644
--- a/modoboa/extensions/stats/management/commands/logparser.py
+++ b/modoboa/extensions/stats/management/commands/logparser.py
@@ -297,6 +297,14 @@ class LogParser(object):
if not m:
return
host, prog, pid, log = m.groups()
+ m = re.search("(INFECTED|SPAMMY) .* <[^>]+> -> <[^@]+@([^>]+)>.*", log)
+ if m is not None:
+ if m.group(2) in self.domains:
+ if m.group(1) == 'INFECTED':
+ self.inc_counter(m.group(2), 'virus')
+ elif m.group(1) == 'SPAMMY':
+ self.inc_counter(m.group(2), 'spam')
+ return
m = self._id_expr.match(log)
if m is None:
self._dprint("Unknown line format: %s" % log)
From 6b1c93415478d7614ef682d34c507f6d6c0de971 Mon Sep 17 00:00:00 2001
From: Andrew Fyfe
Date: Thu, 9 Apr 2015 17:09:35 +0100
Subject: [PATCH 9/9] Look for SPAM as well when filtering the mail log.
---
modoboa/extensions/stats/management/commands/logparser.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modoboa/extensions/stats/management/commands/logparser.py b/modoboa/extensions/stats/management/commands/logparser.py
index 7af07fa18..a09241e80 100644
--- a/modoboa/extensions/stats/management/commands/logparser.py
+++ b/modoboa/extensions/stats/management/commands/logparser.py
@@ -297,12 +297,13 @@ class LogParser(object):
if not m:
return
host, prog, pid, log = m.groups()
- m = re.search("(INFECTED|SPAMMY) .* <[^>]+> -> <[^@]+@([^>]+)>.*", log)
+ m = re.search("(INFECTED|SPAM|SPAMMY) .* <[^>]+> -> <[^@]+@([^>]+)>.*",
+ log)
if m is not None:
if m.group(2) in self.domains:
if m.group(1) == 'INFECTED':
self.inc_counter(m.group(2), 'virus')
- elif m.group(1) == 'SPAMMY':
+ elif m.group(1) == 'SPAM' or m.group(1) == 'SPAMMY':
self.inc_counter(m.group(2), 'spam')
return
m = self._id_expr.match(log)