aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman_pgp/model/address.py2
-rw-r--r--src/mailman_pgp/model/list.py13
-rw-r--r--src/mailman_pgp/model/sighash.py2
-rw-r--r--src/mailman_pgp/plugin.py14
-rw-r--r--src/mailman_pgp/rules/encryption.py2
-rw-r--r--src/mailman_pgp/rules/signature.py2
6 files changed, 17 insertions, 18 deletions
diff --git a/src/mailman_pgp/model/address.py b/src/mailman_pgp/model/address.py
index 9444f5a..ee84d22 100644
--- a/src/mailman_pgp/model/address.py
+++ b/src/mailman_pgp/model/address.py
@@ -42,8 +42,8 @@ class PGPAddress(Base):
def __init__(self, address):
super().__init__()
- self.email = address.email
self._init()
+ self.email = address.email
self._address = address
@reconstructor
diff --git a/src/mailman_pgp/model/list.py b/src/mailman_pgp/model/list.py
index 9bee16d..da542de 100644
--- a/src/mailman_pgp/model/list.py
+++ b/src/mailman_pgp/model/list.py
@@ -22,14 +22,16 @@ from os.path import exists, isfile, join
from flufl.lock import Lock
from mailman.database.types import Enum, SAUnicode
from mailman.interfaces.action import Action
-from mailman.interfaces.listmanager import IListManager
+from mailman.interfaces.listmanager import IListManager, ListDeletedEvent
from pgpy import PGPKey
from public import public
from sqlalchemy import Boolean, Column, Integer
from sqlalchemy.orm import reconstructor
from zope.component import getUtility
+from zope.event import classhandler
from mailman_pgp.config import config
+from mailman_pgp.database import transaction
from mailman_pgp.model.base import Base
from mailman_pgp.pgp.keygen import ListKeyGenerator
@@ -143,3 +145,12 @@ class PGPMailingList(Base):
if mlist is None:
return None
return PGPMailingList.query().filter_by(list_id=mlist.list_id).first()
+
+
+@classhandler.handler(ListDeletedEvent)
+def on_delete(mlist):
+ pgp_list = PGPMailingList.for_list(mlist)
+ if pgp_list:
+ with transaction() as session:
+ # TODO shred the list key
+ session.delete(pgp_list)
diff --git a/src/mailman_pgp/model/sighash.py b/src/mailman_pgp/model/sighash.py
index 6511484..9803ffc 100644
--- a/src/mailman_pgp/model/sighash.py
+++ b/src/mailman_pgp/model/sighash.py
@@ -24,7 +24,7 @@ from mailman_pgp.model.base import Base
class PGPSigHash(Base):
""""""
- __tablename__ = 'sighash'
+ __tablename__ = 'pgp_sighashes'
hash = Column(LargeBinary, primary_key=True)
fingerprint = Column(String(50), index=True)
diff --git a/src/mailman_pgp/plugin.py b/src/mailman_pgp/plugin.py
index 2b59236..c33c99d 100644
--- a/src/mailman_pgp/plugin.py
+++ b/src/mailman_pgp/plugin.py
@@ -17,15 +17,12 @@
"""A PGP plugin for GNU Mailman."""
-from mailman.interfaces.listmanager import ListDeletedEvent
from mailman.interfaces.plugin import IPlugin
from public import public
-from zope.event import classhandler
from zope.interface import implementer
from mailman_pgp.config import config
-from mailman_pgp.database import Database, transaction
-from mailman_pgp.model.list import PGPMailingList
+from mailman_pgp.database import Database
from mailman_pgp.pgp import PGP
from mailman_pgp.rest.root import RESTRoot
@@ -48,12 +45,3 @@ class PGPMailman:
def rest_object(self):
"""See `IPlugin`."""
return RESTRoot()
-
-
-@classhandler.handler(ListDeletedEvent)
-def on_delete(mlist):
- pgp_list = PGPMailingList.for_list(mlist)
- if pgp_list:
- with transaction() as session:
- # TODO shred the list key
- session.delete(pgp_list)
diff --git a/src/mailman_pgp/rules/encryption.py b/src/mailman_pgp/rules/encryption.py
index 1a14b97..de3b51f 100644
--- a/src/mailman_pgp/rules/encryption.py
+++ b/src/mailman_pgp/rules/encryption.py
@@ -32,7 +32,7 @@ class Encryption:
description = _(
"A rule which jumps to the moderation chain, "
"when the incoming runner instructs it to.")
- record = True
+ record = False
def check(self, mlist, msg, msgdata):
"""See `IRule`."""
diff --git a/src/mailman_pgp/rules/signature.py b/src/mailman_pgp/rules/signature.py
index dd90a9b..7742278 100644
--- a/src/mailman_pgp/rules/signature.py
+++ b/src/mailman_pgp/rules/signature.py
@@ -46,7 +46,7 @@ class Signature:
name = 'pgp-signature'
description = _(
'A rule which enforces PGP enabled list signature configuration.')
- record = True
+ record = False
def check(self, mlist, msg, msgdata):
"""See `IRule`."""