mailboxes ratelimit and groups
This commit is contained in:
parent
67c291cb99
commit
e15d2acd13
|
@ -679,29 +679,23 @@ class RSpamdRatelimitController(ServiceController):
|
||||||
def save(self, mailbox):
|
def save(self, mailbox):
|
||||||
context = self.get_context(mailbox)
|
context = self.get_context(mailbox)
|
||||||
self.append(textwrap.dedent("""
|
self.append(textwrap.dedent("""
|
||||||
# sed -i '/^%(user)s$/d' %(maps)s
|
sed -i '/^%(user)s$/d' %(maps)s
|
||||||
# echo '%(user)s' >> %(path_maps)s%(ratelimit)s.map
|
echo '%(user)s' >> %(path_maps)s%(ratelimit)s.map
|
||||||
if ! grep -qx '%(user)s' /etc/rspamd/local.d/maps/usuariosbase.map; then
|
systemctl reload rspamd.service
|
||||||
echo '%(user)s' >> /etc/rspamd/local.d/maps/usuariosbase.map
|
|
||||||
RELOAD_RSPAMD=1
|
|
||||||
fi
|
|
||||||
""") % context
|
""") % context
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete(self, mailbox):
|
def delete(self, mailbox):
|
||||||
context = self.get_context(mailbox)
|
context = self.get_context(mailbox)
|
||||||
self.append(textwrap.dedent("""
|
self.append(textwrap.dedent("""
|
||||||
# sed -i '/^%(user)s$/d' %(maps)s
|
sed -i '/^%(user)s$/d' %(maps)s
|
||||||
if grep -qx '%(user)s' /etc/rspamd/local.d/maps/usuariosbase.map; then
|
systemctl reload rspamd.service
|
||||||
sed -i '/^%(user)s$/d' /etc/rspamd/local.d/maps/usuariosbase.map
|
|
||||||
RELOAD_RSPAMD=1
|
|
||||||
fi
|
|
||||||
""") % context
|
""") % context
|
||||||
)
|
)
|
||||||
|
|
||||||
def commit(self):
|
# def commit(self):
|
||||||
self.append('# [[ $RELOAD_RSPAMD -eq 1 ]] && systemctl reload rspamd.service')
|
# self.append('[[ $RELOAD_RSPAMD -eq 1 ]] && systemctl reload rspamd.service')
|
||||||
super().commit()
|
# super().commit()
|
||||||
|
|
||||||
def get_context(self, mailbox):
|
def get_context(self, mailbox):
|
||||||
maps = self.extract_group_maps()
|
maps = self.extract_group_maps()
|
||||||
|
|
Loading…
Reference in a new issue